Package net.minecraft.world.level.block
Class TripWireHookBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.TripWireHookBlock
- All Implemented Interfaces:
FeatureElement
,ItemLike
,IBlockExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
static final BooleanProperty
static final com.mojang.serialization.MapCodec
<TripWireHookBlock> protected static final VoxelShape
static final DirectionProperty
protected static final VoxelShape
static final BooleanProperty
private static final int
protected static final VoxelShape
protected static final VoxelShape
protected static final int
protected static final int
Fields 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
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDER
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
calculateState
(Level level, BlockPos pos, BlockState hookState, boolean attaching, boolean shouldNotifyNeighbours, int searchRange, BlockState state) protected boolean
canSurvive
(BlockState state, LevelReader level, BlockPos pos) com.mojang.serialization.MapCodec
<TripWireHookBlock> codec()
protected void
private static void
emitState
(Level level, BlockPos pos, boolean attached, boolean powered, boolean wasAttached, boolean wasPowered) protected int
getDirectSignal
(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the direct signal this block emits in the given direction.protected VoxelShape
getShape
(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) protected int
getSignal
(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the signal this block emits in the given direction.getStateForPlacement
(BlockPlaceContext context) protected boolean
isSignalSource
(BlockState state) Returns whether this block is capable of emitting redstone signals.protected BlockState
mirror
(BlockState state, Mirror mirror) Returns the blockstate with the given mirror of the passed blockstate.private static void
notifyNeighbors
(Block block, Level level, BlockPos pos, Direction direction) protected void
onRemove
(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) protected BlockState
rotate
(BlockState state, Rotation rotation) Returns the blockstate with the given rotation from the passed blockstate.void
setPlacedBy
(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) Called by BlockItem after this block has been placed.protected void
tick
(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) protected BlockState
updateShape
(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state.Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getShapeForEachState, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, pushEntitiesUp, registerDefaultState, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSoundType, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isRandomlyTicking, neighborChanged, onExplosionHit, onPlace, onProjectileHit, propagatesSkylightDown, properties, propertiesCodec, randomTick, requiredFeatures, simpleCodec, skipRendering, spawnAfterBreak, triggerEvent, updateIndirectNeighbourShapes, useItemOn, useShapeForLightOcclusion, useWithoutItem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockExtension
addLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, canSustainPlant, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getBubbleColumnDirection, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasDynamicLightEmission, hidesNeighborFace, isBed, isBurning, isConduitFrame, isEmpty, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onDestroyedByPushReaction, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, shouldHideAdjacentFluidFace, supportsExternalFaceHiding
-
Field Details
-
CODEC
-
FACING
-
POWERED
-
ATTACHED
-
WIRE_DIST_MIN
protected static final int WIRE_DIST_MIN- See Also:
-
WIRE_DIST_MAX
protected static final int WIRE_DIST_MAX- See Also:
-
RECHECK_PERIOD
private static final int RECHECK_PERIOD- See Also:
-
AABB_OFFSET
protected static final int AABB_OFFSET- See Also:
-
NORTH_AABB
-
SOUTH_AABB
-
WEST_AABB
-
EAST_AABB
-
-
Constructor Details
-
TripWireHookBlock
-
-
Method Details
-
codec
-
getShape
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) - Overrides:
getShape
in classBlockBehaviour
-
canSurvive
- Overrides:
canSurvive
in classBlockBehaviour
-
updateShape
protected BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) Update the provided state given the provided neighbor direction and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific direction passed in.- Overrides:
updateShape
in classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-
setPlacedBy
public void setPlacedBy(Level level, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) Called by BlockItem after this block has been placed.- Overrides:
setPlacedBy
in classBlock
-
calculateState
public static void calculateState(Level level, BlockPos pos, BlockState hookState, boolean attaching, boolean shouldNotifyNeighbours, int searchRange, @Nullable BlockState state) -
tick
- Overrides:
tick
in classBlockBehaviour
-
emitState
-
notifyNeighbors
-
onRemove
protected void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) - Overrides:
onRemove
in classBlockBehaviour
-
getSignal
protected int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getSignal
in classBlockBehaviour
-
getDirectSignal
protected int getDirectSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) Returns the direct signal this block emits in the given direction.NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.
- Overrides:
getDirectSignal
in classBlockBehaviour
-
isSignalSource
Returns whether this block is capable of emitting redstone signals.- Overrides:
isSignalSource
in classBlockBehaviour
-
rotate
Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
rotate
in classBlockBehaviour
-
mirror
Returns the blockstate with the given mirror of the passed blockstate. If inapplicable, returns the passed blockstate.- Overrides:
mirror
in classBlockBehaviour
-
createBlockStateDefinition
- Overrides:
createBlockStateDefinition
in classBlock
-