Package net.minecraft.block
Class AbstractRailBlock
java.lang.Object
net.minecraft.block.AbstractBlock
net.minecraft.block.Block
net.minecraft.block.AbstractRailBlock
- All Implemented Interfaces:
ItemConvertible
- Direct Known Subclasses:
DetectorRailBlock,PoweredRailBlock,RailBlock
public abstract class AbstractRailBlock extends Block
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
Fields Modifier and Type Field Description private booleanallowCurvesprotected static VoxelShapeASCENDING_SHAPEprotected static VoxelShapeSTRAIGHT_SHAPEFields inherited from class net.minecraft.block.Block
LOGGER, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, dynamicBounds, FACINGS, jumpVelocityMultiplier, lootTableId, material, randomTicks, resistance, settings, slipperiness, soundGroup, velocityMultiplier -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRailBlock(boolean allowCurves, AbstractBlock.Settings settings) -
Method Summary
Modifier and Type Method Description booleancanMakeCurves()booleancanPlaceAt(BlockState state, WorldView world, BlockPos pos)VoxelShapegetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)PistonBehaviorgetPistonBehavior(BlockState state)BlockStategetPlacementState(ItemPlacementContext ctx)abstract Property<RailShape>getShapeProperty()static booleanisRail(BlockState state)static booleanisRail(World world, BlockPos pos)voidneighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)voidonBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)voidonStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate.private static booleanshouldDropRail(BlockPos pos, World world, RailShape shape)Checks if this rail should be dropped.protected voidupdateBlockState(BlockState state, World world, BlockPos pos, Block neighbor)protected BlockStateupdateBlockState(World world, BlockPos pos, BlockState state, boolean forceUpdate)protected BlockStateupdateCurves(BlockState state, World world, BlockPos pos, boolean notify)Methods inherited from class net.minecraft.block.Block
addStacksForDisplay, afterBreak, appendProperties, 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, isTranslucent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, pushEntitiesUpBeforeBlockChange, rainTick, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPathfindThrough, canReplace, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMaterialColor, getDroppedStacks, getFluidState, getLootTableId, getOffsetType, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getSidesShape, getStateForNeighborUpdate, getStrongRedstonePower, getVisualShape, getWeakRedstonePower, hasBlockEntity, hasComparatorOutput, hasSidedTransparency, isSideInvisible, mirror, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onSyncedBlockEvent, onUse, prepare, randomTick, rotate, scheduledTick
-
Field Details
-
STRAIGHT_SHAPE
-
ASCENDING_SHAPE
-
allowCurves
private final boolean allowCurves
-
-
Constructor Details
-
AbstractRailBlock
-
-
Method Details
-
isRail
-
isRail
-
canMakeCurves
public boolean canMakeCurves() -
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context)- Overrides:
getOutlineShapein classAbstractBlock
-
canPlaceAt
- Overrides:
canPlaceAtin classAbstractBlock
-
onBlockAdded
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify)- Overrides:
onBlockAddedin classAbstractBlock
-
updateCurves
-
neighborUpdate
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify)- Overrides:
neighborUpdatein classAbstractBlock
-
shouldDropRail
Checks if this rail should be dropped.This method will return true if:
- The rail block is ascending.
- The block in the direction of ascent does not have a top rim.
-
updateBlockState
-
updateBlockState
protected BlockState updateBlockState(World world, BlockPos pos, BlockState state, boolean forceUpdate) -
getPistonBehavior
- Overrides:
getPistonBehaviorin classAbstractBlock
-
onStateReplaced
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved)Called inWorldChunk.setBlockState(BlockPos, BlockState, boolean)ifnewStateis different fromstate. Vanilla blocks perform removal cleanups here.- Overrides:
onStateReplacedin classAbstractBlock
-
getPlacementState
- Overrides:
getPlacementStatein classBlock
-
getShapeProperty
-