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 VoxelShapeFLAT_AABBprotected static VoxelShapeHALF_BLOCK_AABBprivate booleanisStraight-
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 protectedAbstractRailBlock(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 booleancanSurvive(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_)PushReactiongetPistonPushReaction(BlockState p_149656_1_)RailShapegetRailDirection(BlockState state, IBlockReader world, BlockPos pos, AbstractMinecartEntity cart)Return the rail's direction.VoxelShapegetShape(BlockState p_220053_1_, IBlockReader p_220053_2_, BlockPos p_220053_3_, ISelectionContext p_220053_4_)abstract Property<RailShape>getShapeProperty()Deprecated.BlockStategetStateForPlacement(BlockItemUseContext p_196258_1_)booleanisFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)Return true if the rail can make corners.static booleanisRail(BlockState p_208487_0_)static booleanisRail(World p_208488_0_, BlockPos p_208488_1_)booleanisStraight()voidneighborChanged(BlockState p_220069_1_, World p_220069_2_, BlockPos p_220069_3_, Block p_220069_4_, BlockPos p_220069_5_, boolean p_220069_6_)voidonPlace(BlockState p_220082_1_, World p_220082_2_, BlockPos p_220082_3_, BlockState p_220082_4_, boolean p_220082_5_)voidonRemove(BlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, BlockState p_196243_4_, boolean p_196243_5_)private static booleanshouldBeRemoved(BlockPos p_235328_0_, World p_235328_1_, RailShape p_235328_2_)protected BlockStateupdateDir(World p_208489_1_, BlockPos p_208489_2_, BlockState p_208489_3_, boolean p_208489_4_)protected BlockStateupdateState(BlockState p_235327_1_, World p_235327_2_, BlockPos p_235327_3_, boolean p_235327_4_)protected voidupdateState(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:
getShapein classAbstractBlock
-
canSurvive
public boolean canSurvive(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_)
- Overrides:
canSurvivein 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:
onPlacein 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:
neighborChangedin 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:
getPistonPushReactionin 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:
onRemovein classAbstractBlock
-
getStateForPlacement
public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_)
- Overrides:
getStateForPlacementin classBlock
-
isFlexibleRail
public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
Description copied from interface:IAbstractRailBlockReturn true if the rail can make corners. Used by placement logic.- Specified by:
isFlexibleRailin interfaceIAbstractRailBlockworld- 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:IAbstractRailBlockReturn 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:
getRailDirectionin 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.
-
-