Package net.minecraft.block
Class AbstractRailBlock
- java.lang.Object
-
- net.minecraftforge.registries.ForgeRegistryEntry<Block>
-
- net.minecraft.block.AbstractBlock
-
- net.minecraft.block.Block
-
- net.minecraft.block.AbstractRailBlock
-
- All Implemented Interfaces:
IItemProvider
,IAbstractRailBlock
,IForgeBlock
,IForgeRegistryEntry<Block>
- Direct Known Subclasses:
DetectorRailBlock
,PoweredRailBlock
,RailBlock
public abstract class AbstractRailBlock extends Block implements IAbstractRailBlock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.RenderSideCacheKey
-
Nested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.IExtendedPositionPredicate<A>, AbstractBlock.IPositionPredicate, AbstractBlock.OffsetType, AbstractBlock.Properties
-
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
-
Field Summary
Fields Modifier and Type Field Description protected static VoxelShape
FLAT_AABB
protected static VoxelShape
HALF_BLOCK_AABB
private boolean
isStraight
-
Fields inherited from class net.minecraft.block.Block
BLOCK_STATE_REGISTRY, LOGGER, RANDOM, stateDefinition
-
Fields inherited from class net.minecraft.block.AbstractBlock
drops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, material, properties, soundType, speedFactor, UPDATE_SHAPE_ORDER
-
Fields inherited from class net.minecraftforge.registries.ForgeRegistryEntry
delegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRailBlock(boolean p_i48444_1_, AbstractBlock.Properties p_i48444_2_)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canSurvive(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_)
PushReaction
getPistonPushReaction(BlockState p_149656_1_)
RailShape
getRailDirection(BlockState state, IBlockReader world, BlockPos pos, AbstractMinecartEntity cart)
Return the rail's direction.VoxelShape
getShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)
abstract Property<RailShape>
getShapeProperty()
Deprecated.BlockState
getStateForPlacement(BlockItemUseContext p_196258_1_)
boolean
isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
Return true if the rail can make corners.static boolean
isRail(BlockState p_208487_0_)
static boolean
isRail(World p_208488_0_, BlockPos p_208488_1_)
boolean
isStraight()
void
neighborChanged(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_)
void
onPlace(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_)
void
onRemove(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_)
private static boolean
shouldBeRemoved(BlockPos p_235328_0_, World p_235328_1_, RailShape p_235328_2_)
protected BlockState
updateDir(World p_208489_1_, BlockPos p_208489_2_, BlockState p_208489_3_, boolean p_208489_4_)
protected BlockState
updateState(BlockState p_235327_1_, World p_235327_2_, BlockPos p_235327_3_, boolean p_235327_4_)
protected void
updateState(BlockState p_189541_1_, World p_189541_2_, BlockPos p_189541_3_, Block p_189541_4_)
-
Methods inherited from class net.minecraft.block.Block
animateTick, appendHoverText, asBlock, asItem, box, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, createBlockStateDefinition, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getHarvestLevel, getHarvestTool, getId, getJumpFactor, getName, getSoundType, getSpeedFactor, getStateDefinition, getTags, handleRain, hasDynamicShape, is, is, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, stateById, stepOn, toString, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded
-
Methods inherited from class net.minecraft.block.AbstractBlock
attack, canBeReplaced, canBeReplaced, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getFluidState, getInteractionShape, getLightBlock, getLootTable, getMenuProvider, getOcclusionShape, getOffsetType, getRenderShape, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isEntityBlock, isPathfindable, isSignalSource, mirror, onProjectileHit, randomTick, rotate, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, updateShape, use, useShapeForLightOcclusion
-
Methods inherited from class net.minecraftforge.registries.ForgeRegistryEntry
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.extensions.IAbstractRailBlock
canMakeSlopes, getAbstractBlock, getRailMaxSpeed, onMinecartPass
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, createTileEntity, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getRespawnPosition, getSlipperiness, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hasTileEntity, isAir, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isToolEffective, makesOpenTrapdoorAboveClimbable, observedNeighborChange, onBlockExploded, onNeighborChange, onPlantGrow, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
-
-
-
-
Field Detail
-
FLAT_AABB
protected static final VoxelShape FLAT_AABB
-
HALF_BLOCK_AABB
protected static final VoxelShape HALF_BLOCK_AABB
-
isStraight
private final boolean isStraight
-
-
Constructor Detail
-
AbstractRailBlock
protected AbstractRailBlock(boolean p_i48444_1_, AbstractBlock.Properties p_i48444_2_)
-
-
Method Detail
-
isRail
public static boolean isRail(BlockState p_208487_0_)
-
isStraight
public boolean isStraight()
-
getShape
public VoxelShape getShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)
- Overrides:
getShape
in classAbstractBlock
-
canSurvive
public boolean canSurvive(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_)
- Overrides:
canSurvive
in classAbstractBlock
-
onPlace
public void onPlace(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_)
- Overrides:
onPlace
in classAbstractBlock
-
updateState
protected BlockState updateState(BlockState p_235327_1_, World p_235327_2_, BlockPos p_235327_3_, boolean p_235327_4_)
-
neighborChanged
public void neighborChanged(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_)
- Overrides:
neighborChanged
in classAbstractBlock
-
shouldBeRemoved
private static boolean shouldBeRemoved(BlockPos p_235328_0_, World p_235328_1_, RailShape p_235328_2_)
-
updateState
protected void updateState(BlockState p_189541_1_, World p_189541_2_, BlockPos p_189541_3_, Block p_189541_4_)
-
updateDir
protected BlockState updateDir(World p_208489_1_, BlockPos p_208489_2_, BlockState p_208489_3_, boolean p_208489_4_)
-
getPistonPushReaction
public PushReaction getPistonPushReaction(BlockState p_149656_1_)
- Overrides:
getPistonPushReaction
in classAbstractBlock
-
onRemove
public void onRemove(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_)
- Overrides:
onRemove
in classAbstractBlock
-
getStateForPlacement
public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_)
- Overrides:
getStateForPlacement
in classBlock
-
isFlexibleRail
public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
Description copied from interface:IAbstractRailBlock
Return true if the rail can make corners. Used by placement logic.- Specified by:
isFlexibleRail
in interfaceIAbstractRailBlock
world
- The world.pos
- Block's position in world- Returns:
- True if the rail can make corners.
-
getRailDirection
public RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @Nullable AbstractMinecartEntity cart)
Description copied from interface:IAbstractRailBlock
Return the rail's direction. Can be used to make the cart think the rail is a different shape, for example when making diamond junctions or switches. The cart parameter will often be null unless it it called from EntityMinecart.- Specified by:
getRailDirection
in interfaceIAbstractRailBlock
- Parameters:
state
- The BlockStateworld
- The world.pos
- Block's position in worldcart
- The cart asking for the metadata, null if it is not called by EntityMinecart.- Returns:
- The direction.
-
-