public class FenceBlock extends HorizontalConnectingBlock
Block.NeighborGroup
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A>
Modifier and Type | Field and Description |
---|---|
private VoxelShape[] |
cullingShapes |
boundingShapes, collisionShapes, EAST, FACING_PROPERTIES, NORTH, SOUTH, WATERLOGGED, WEST
LOGGER, STATE_IDS, stateManager
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier
Constructor and Description |
---|
FenceBlock(AbstractBlock.Settings settings) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendProperties(StateManager.Builder<Block,BlockState> builder) |
boolean |
canConnect(BlockState state,
boolean neighborIsFullSquare,
Direction dir) |
boolean |
canPathfindThrough(BlockState state,
BlockView world,
BlockPos pos,
NavigationType type) |
VoxelShape |
getCullingShape(BlockState state,
BlockView world,
BlockPos pos) |
BlockState |
getPlacementState(ItemPlacementContext ctx) |
BlockState |
getStateForNeighborUpdate(BlockState state,
Direction direction,
BlockState newState,
WorldAccess world,
BlockPos pos,
BlockPos posFrom) |
VoxelShape |
getVisualShape(BlockState state,
BlockView world,
BlockPos pos,
ShapeContext context) |
private boolean |
isFence(Block block) |
ActionResult |
onUse(BlockState state,
World world,
BlockPos pos,
PlayerEntity player,
Hand hand,
BlockHitResult hit)
Called when this block is used by a player.
|
createShapes, getCollisionShape, getFluidState, getOutlineShape, getShapeIndex, isTranslucent, mirror, rotate
addStacksForDisplay, afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, is, isFaceFullSquare, isIn, isShapeFullCube, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toString
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getComparatorOutput, getDefaultMaterialColor, getDroppedStacks, getLootTableId, getOffsetType, getOpacity, getPistonBehavior, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStrongRedstonePower, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, prepare, randomTick, scheduledTick
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canFillWithFluid, tryDrainFluid, tryFillWithFluid
private final VoxelShape[] cullingShapes
public FenceBlock(AbstractBlock.Settings settings)
public VoxelShape getCullingShape(BlockState state, BlockView world, BlockPos pos)
getCullingShape
in class AbstractBlock
public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)
getVisualShape
in class AbstractBlock
public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type)
canPathfindThrough
in class HorizontalConnectingBlock
public boolean canConnect(BlockState state, boolean neighborIsFullSquare, Direction dir)
private boolean isFence(Block block)
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit)
This method is called on both the logical client and logical server, so take caution when overriding this method.
The logical side can be checked using world.isClient()
.
If the action result is successful on a logical client, then the action will be sent to the logical server for processing.
onUse
in class AbstractBlock
public BlockState getPlacementState(ItemPlacementContext ctx)
getPlacementState
in class Block
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom)
getStateForNeighborUpdate
in class AbstractBlock
protected void appendProperties(StateManager.Builder<Block,BlockState> builder)
appendProperties
in class Block