Class AbstractTubeModule

java.lang.Object
me.desht.pneumaticcraft.common.tubemodules.AbstractTubeModule
Direct Known Subclasses:
AbstractNetworkedRedstoneModule, AbstractRedstoneEmittingModule, AbstractRedstoneReceivingModule, AirGrateModule, ChargingModule, LogisticsModule

public abstract class AbstractTubeModule extends Object
  • Field Details

    • MAX_VALUE

      public static final float MAX_VALUE
      See Also:
    • pressureTube

      protected final PressureTubeBlockEntity pressureTube
    • dir

      protected final net.minecraft.core.Direction dir
    • upgraded

      protected boolean upgraded
    • lowerBound

      public float lowerBound
    • higherBound

      public float higherBound
    • advancedConfig

      public boolean advancedConfig
  • Constructor Details

    • AbstractTubeModule

      public AbstractTubeModule(net.minecraft.core.Direction dir, PressureTubeBlockEntity pressureTube)
  • Method Details

    • markFake

      public void markFake()
    • isFake

      public boolean isFake()
    • getTube

      public PressureTubeBlockEntity getTube()
    • isValid

      public boolean isValid()
    • setChanged

      protected final void setChanged()
    • getWidth

      public double getWidth()
      Get the module's width (in range 0..16 as passed to Block.box(double, double, double, double, double, double)
      Returns:
      the width
    • getHeight

      protected double getHeight()
      Get the module's height (in range 0..16 as passed to Block.box(double, double, double, double, double, double)
      Returns:
      the height
    • getThreshold

      public float getThreshold(int redstone)
    • getDrops

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> getDrops()
      Returns the item(s) that this part drops.
      Returns:
      the module item and possibly an Advanced PCB too
    • getItem

      public abstract net.minecraft.world.item.Item getItem()
    • getDirection

      public net.minecraft.core.Direction getDirection()
    • readFromNBT

      public void readFromNBT(net.minecraft.nbt.CompoundTag nbt)
    • writeToNBT

      public net.minecraft.nbt.CompoundTag writeToNBT(net.minecraft.nbt.CompoundTag nbt)
    • tickCommon

      protected void tickCommon()
    • tickClient

      public void tickClient()
    • tickServer

      public void tickServer()
    • onNeighborTileUpdate

      public void onNeighborTileUpdate()
    • onNeighborBlockUpdate

      public void onNeighborBlockUpdate()
    • getType

      public final net.minecraft.resources.ResourceLocation getType()
    • getRedstoneLevel

      public int getRedstoneLevel()
    • updateNeighbors

      public void updateNeighbors()
    • isInline

      public boolean isInline()
    • sendDescriptionPacket

      public void sendDescriptionPacket()
    • addInfo

      public void addInfo(List<net.minecraft.network.chat.Component> curInfo)
    • canUpgrade

      public boolean canUpgrade()
    • upgrade

      public void upgrade()
    • isUpgraded

      public boolean isUpgraded()
    • onActivated

      public boolean onActivated(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
    • hasGui

      public boolean hasGui()
      Does this module have a gui? Server also needs to know about this, since module GUI's are opened in response to a packet from the server.
      Returns:
      true if the module has a gui
    • getShape

      public net.minecraft.world.phys.shapes.VoxelShape getShape()
    • getRenderBoundingBox

      public net.minecraft.world.phys.AABB getRenderBoundingBox()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • onPlaced

      public void onPlaced()
    • onRemoved

      public void onRemoved()
      Called just before a module is removed from a pressure tube, either by a player wrenching it, or when data that is read from NBT causes the module to be removed.
    • isInlineAndFocused

      public boolean isInlineAndFocused(PressureTubeBlock.TubeHitInfo hitInfo)
      Only relevant to inline modules, where the inline module may cover more of the tube than just the side it's installed on.
    • canConnectTo

      public boolean canConnectTo(AbstractTubeModule other)