Class PressureTubeBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
me.desht.pneumaticcraft.common.block.AbstractPneumaticCraftBlock
me.desht.pneumaticcraft.common.block.AbstractCamouflageBlock
me.desht.pneumaticcraft.common.block.PressureTubeBlock
- All Implemented Interfaces:
IPneumaticWrenchable,ITubeNetworkConnector,IPneumaticCraftProbeable,PneumaticCraftEntityBlock,net.minecraft.world.flag.FeatureElement,net.minecraft.world.level.block.BucketPickup,net.minecraft.world.level.block.EntityBlock,net.minecraft.world.level.block.LiquidBlockContainer,net.minecraft.world.level.block.SimpleWaterloggedBlock,net.minecraft.world.level.ItemLike,net.minecraftforge.common.extensions.IForgeBlock,net.minecraftforge.common.extensions.IForgeBucketPickup
public class PressureTubeBlock
extends AbstractCamouflageBlock
implements net.minecraft.world.level.block.SimpleWaterloggedBlock, PneumaticCraftEntityBlock, ITubeNetworkConnector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordStores information about the subpart of a pressure tube that is being looked at or interacted with.Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
net.minecraft.world.level.block.Block.BlockStatePairKeyNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.state.BlockBehaviour.BlockStateBase, net.minecraft.world.level.block.state.BlockBehaviour.OffsetType, net.minecraft.world.level.block.state.BlockBehaviour.Properties, net.minecraft.world.level.block.state.BlockBehaviour.StateArgumentPredicate<A extends Object>, net.minecraft.world.level.block.state.BlockBehaviour.StatePredicate -
Field Summary
FieldsFields inherited from class me.desht.pneumaticcraft.common.block.AbstractCamouflageBlock
BLOCK_ACCESS, BLOCK_POS, CAMO_STATEFields inherited from class me.desht.pneumaticcraft.common.block.AbstractPneumaticCraftBlock
CONNECTION_PROPERTIES, DOWN, EAST, NORTH, SOUTH, UP, WESTFields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, stateDefinition, UPDATE_ALL, UPDATE_ALL_IMMEDIATE, UPDATE_CLIENTS, UPDATE_IMMEDIATE, UPDATE_INVISIBLE, UPDATE_KNOWN_SHAPE, UPDATE_LIMIT, UPDATE_MOVE_BY_PISTON, UPDATE_NEIGHBORS, UPDATE_NONE, UPDATE_SUPPRESS_DROPS, UPDATE_SUPPRESS_LIGHTFields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionPressureTubeBlock(BiFunction<net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, ? extends PressureTubeBlockEntity> teFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConnectToNetwork(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction dir, net.minecraft.world.level.block.state.BlockState state) Called when a network is being scanned.protected voidcreateBlockStateDefinition(net.minecraft.world.level.block.state.StateDefinition.Builder<net.minecraft.world.level.block.Block, net.minecraft.world.level.block.state.BlockState> builder) net.minecraft.world.item.ItemStackgetCloneItemStack(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.HitResult target, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) static AbstractTubeModulegetFocusedModule(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) Get the tube module being looked at by the player, if any.intgetSignal(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter par1IBlockAccess, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) net.minecraft.world.level.block.state.BlockStategetStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext ctx) net.minecraft.world.phys.shapes.VoxelShapegetUncamouflagedShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter reader, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext ctx) The equivalent ofBlockBehaviour.getShape(BlockState, BlockGetter, BlockPos, CollisionContext), but for uncamouflaged camo blocks.booleanisSignalSource(net.minecraft.world.level.block.state.BlockState state) protected booleannet.minecraft.world.level.block.state.BlockStatemirror(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Mirror mirrorIn) net.minecraft.world.level.block.entity.BlockEntitynewBlockEntity(net.minecraft.core.BlockPos pPos, net.minecraft.world.level.block.state.BlockState pState) voidonRemove(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState newState, boolean isMoving) booleanonWrenched(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand) static net.minecraft.world.level.block.state.BlockStaterecalculateState(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.world.level.block.state.BlockState stateIn) net.minecraft.world.level.block.state.BlockStaterotate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Rotation rotation) voidsetPlacedBy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack) booleantryPlaceModule(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand, boolean simulate) net.minecraft.world.level.block.state.BlockStateupdateShape(net.minecraft.world.level.block.state.BlockState stateIn, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState facingState, net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.core.BlockPos facingPos) net.minecraft.world.InteractionResultuse(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult brtr) Methods inherited from class me.desht.pneumaticcraft.common.block.AbstractCamouflageBlock
getCollisionShape, getInteractionShape, getLightBlock, getOcclusionShape, getShape, getUncamouflagedCollisionShape, getUncamouflagedRaytraceShape, getUncamouflagedRenderShape, hasDynamicShape, onDestroyedByPlayerMethods inherited from class me.desht.pneumaticcraft.common.block.AbstractPneumaticCraftBlock
addExtraInformation, appendHoverText, canPlaceLiquid, canRotateToTopOrBottom, connectionProperty, doOpenGui, getAnalogOutputSignal, getFluidState, getRenderShape, getRotation, getRotation, hasAnalogOutputSignal, isPathfindable, isRotatable, neighborChanged, onNeighborChange, pickupBlock, placeLiquid, playerDestroy, reversePlacementRotation, rotateCustom, rotateForgeWay, setRotationMethods inherited from class net.minecraft.world.level.block.Block
animateTick, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, canSurvive, defaultDestroyTime, defaultMaterialColor, entityInside, getBlockSupportShape, getDestroyProgress, getDirectSignal, getDrops, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getPistonPushReaction, getSeed, getShadeBrightness, getVisualShape, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, onPlace, onProjectileHit, randomTick, requiredFeatures, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, useShapeForLightOcclusionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.block.EntityBlock
getListenerMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHidingMethods inherited from interface net.minecraftforge.common.extensions.IForgeBucketPickup
getPickupSoundMethods inherited from interface me.desht.pneumaticcraft.common.block.PneumaticCraftEntityBlock
getTickerMethods inherited from interface net.minecraft.world.level.block.SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
CORE_MIN
public static final int CORE_MIN- See Also:
-
CORE_MAX
public static final int CORE_MAX- See Also:
-
-
Constructor Details
-
PressureTubeBlock
public PressureTubeBlock(BiFunction<net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, ? extends PressureTubeBlockEntity> teFactory)
-
-
Method Details
-
isWaterloggable
protected boolean isWaterloggable()- Overrides:
isWaterloggablein classAbstractPneumaticCraftBlock
-
newBlockEntity
@Nullable public net.minecraft.world.level.block.entity.BlockEntity newBlockEntity(net.minecraft.core.BlockPos pPos, net.minecraft.world.level.block.state.BlockState pState) - Specified by:
newBlockEntityin interfacenet.minecraft.world.level.block.EntityBlock
-
createBlockStateDefinition
protected void createBlockStateDefinition(net.minecraft.world.level.block.state.StateDefinition.Builder<net.minecraft.world.level.block.Block, net.minecraft.world.level.block.state.BlockState> builder) - Overrides:
createBlockStateDefinitionin classAbstractPneumaticCraftBlock
-
getStateForPlacement
@Nullable public net.minecraft.world.level.block.state.BlockState getStateForPlacement(net.minecraft.world.item.context.BlockPlaceContext ctx) - Overrides:
getStateForPlacementin classAbstractPneumaticCraftBlock
-
updateShape
public net.minecraft.world.level.block.state.BlockState updateShape(net.minecraft.world.level.block.state.BlockState stateIn, net.minecraft.core.Direction facing, net.minecraft.world.level.block.state.BlockState facingState, net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.core.BlockPos facingPos) - Overrides:
updateShapein classAbstractPneumaticCraftBlock
-
recalculateState
public static net.minecraft.world.level.block.state.BlockState recalculateState(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos currentPos, net.minecraft.world.level.block.state.BlockState stateIn) -
getUncamouflagedShape
public net.minecraft.world.phys.shapes.VoxelShape getUncamouflagedShape(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter reader, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.shapes.CollisionContext ctx) Description copied from class:AbstractCamouflageBlockThe equivalent ofBlockBehaviour.getShape(BlockState, BlockGetter, BlockPos, CollisionContext), but for uncamouflaged camo blocks.- Specified by:
getUncamouflagedShapein classAbstractCamouflageBlock- Parameters:
state- the blockstatereader- the worldpos- the block posctx- the selection context- Returns:
- the block's actual shape, when it isn't camouflaged
-
use
public net.minecraft.world.InteractionResult use(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult brtr) - Overrides:
usein classAbstractPneumaticCraftBlock
-
setPlacedBy
public void setPlacedBy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack) - Overrides:
setPlacedByin classAbstractPneumaticCraftBlock
-
tryPlaceModule
public boolean tryPlaceModule(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand, boolean simulate) -
getFocusedModule
public static AbstractTubeModule getFocusedModule(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) Get the tube module being looked at by the player, if any.- Parameters:
world- the worldpos- the blockposplayer- the player- Returns:
- a tube module, or null if no module is focused
-
getCloneItemStack
public net.minecraft.world.item.ItemStack getCloneItemStack(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.HitResult target, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) - Specified by:
getCloneItemStackin interfacenet.minecraftforge.common.extensions.IForgeBlock
-
onWrenched
public boolean onWrenched(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, net.minecraft.world.InteractionHand hand) - Specified by:
onWrenchedin interfaceIPneumaticWrenchable- Overrides:
onWrenchedin classAbstractPneumaticCraftBlock
-
onRemove
public void onRemove(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState newState, boolean isMoving) - Overrides:
onRemovein classAbstractPneumaticCraftBlock
-
getSignal
public int getSignal(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.BlockGetter par1IBlockAccess, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) - Overrides:
getSignalin classnet.minecraft.world.level.block.state.BlockBehaviour
-
isSignalSource
public boolean isSignalSource(net.minecraft.world.level.block.state.BlockState state) - Overrides:
isSignalSourcein classnet.minecraft.world.level.block.state.BlockBehaviour
-
rotate
public net.minecraft.world.level.block.state.BlockState rotate(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Rotation rotation) - Overrides:
rotatein classAbstractPneumaticCraftBlock
-
mirror
public net.minecraft.world.level.block.state.BlockState mirror(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.Mirror mirrorIn) - Overrides:
mirrorin classAbstractPneumaticCraftBlock
-
canConnectToNetwork
public boolean canConnectToNetwork(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction dir, net.minecraft.world.level.block.state.BlockState state) Description copied from interface:ITubeNetworkConnectorCalled when a network is being scanned. Check if the block at the given position can connect to a tube module network in the given direction. This may be as simple as just checking a blockstate property; the blockstate at the position is passed for convenience. If that is not sufficient, the level and position are available in case of the need for a block entity query.- Specified by:
canConnectToNetworkin interfaceITubeNetworkConnector- Parameters:
level- the worldpos- block position in questiondir- the direction to be connected tostate- the blockstate at the given position- Returns:
- true if this block should form part of the module network, false otherwise
-