Class AbstractTubeModule
java.lang.Object
me.desht.pneumaticcraft.common.tubemodules.AbstractTubeModule
- Direct Known Subclasses:
AbstractRedstoneEmittingModule,AbstractRedstoneReceivingModule,AirGrateModule,ChargingModule,LogisticsModule,RedstoneModule
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanprotected final net.minecraft.core.Directionfloatfloatstatic final floatprotected final PressureTubeBlockEntityprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTubeModule(net.minecraft.core.Direction dir, PressureTubeBlockEntity pressureTube) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleannet.minecraft.core.Directionnet.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>getDrops()Returns the item(s) that this part drops.protected doubleGet the module's height (in range 0..16 as passed toBlock.box(double, double, double, double, double, double)abstract net.minecraft.world.item.ItemgetItem()intnet.minecraft.world.phys.AABBnet.minecraft.world.phys.shapes.VoxelShapegetShape()floatgetThreshold(int redstone) getTube()final net.minecraft.resources.ResourceLocationgetType()doublegetWidth()Get the module's width (in range 0..16 as passed toBlock.box(double, double, double, double, double, double)booleanhasGui()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.inthashCode()booleanisFake()booleanisInline()booleanOnly relevant to inline modules, where the inline module may cover more of the tube than just the side it's installed on.booleanvoidmarkFake()booleanonActivated(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) voidvoidvoidonPlaced()voidCalled 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.voidreadFromNBT(net.minecraft.nbt.CompoundTag nbt) voidprotected final voidvoidprotected voidvoidvoidvoidupgrade()net.minecraft.nbt.CompoundTagwriteToNBT(net.minecraft.nbt.CompoundTag nbt)
-
Field Details
-
MAX_VALUE
public static final float MAX_VALUE- See Also:
-
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
-
-
Method Details
-
markFake
public void markFake() -
isFake
public boolean isFake() -
getTube
-
setChanged
protected final void setChanged() -
getWidth
public double getWidth()Get the module's width (in range 0..16 as passed toBlock.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 toBlock.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
-
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
-
hashCode
public int hashCode() -
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
Only relevant to inline modules, where the inline module may cover more of the tube than just the side it's installed on.
-