Class LinearApi

java.lang.Object
tschipp.linear.api.LinearApi

public final class LinearApi extends Object
Linear's API for other mods. Works the same on every loader; register during common setup, after checking that Linear is loaded.
  • Method Details

    • registerSupply

      public static void registerSupply(BlockSupply supply)
      Adds a source of blocks besides the player's inventory. Supplies are asked in order.
    • registerHeldItem

      public static void registerHeldItem(HeldItemHandler handler)
      Lets a non-block item draw lines. The first matching handler is used.
    • supplies

      public static List<BlockSupply> supplies()
    • handlerFor

      @Nullable public static @Nullable HeldItemHandler handlerFor(net.minecraft.world.item.ItemStack held)
    • isBuildingEnabled

      public static boolean isBuildingEnabled(net.minecraft.world.entity.player.Player player)
      Whether the player has building enabled. Works on the server and for the local player.
    • isDragging

      public static boolean isDragging(net.minecraft.world.entity.player.Player player)
      Whether the player is dragging a line. Client side, local player only.