Package net.minecraft.world.level.block
Class BaseRailBlock
java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BaseRailBlock
- All Implemented Interfaces:
- FeatureElement,- BucketPickup,- LiquidBlockContainer,- SimpleWaterloggedBlock,- ItemLike,- IForgeBaseRailBlock,- IForgeBlock,- IForgeBucketPickup
- Direct Known Subclasses:
- DetectorRailBlock,- PoweredRailBlock,- RailBlock
public abstract class BaseRailBlock
extends Block
implements SimpleWaterloggedBlock, IForgeBaseRailBlock
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraft.world.level.block.BlockBlock.BlockStatePairKeyNested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviourBlockBehaviour.BlockStateBase, BlockBehaviour.OffsetFunction, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final VoxelShapeprotected static final VoxelShapeprivate final booleanstatic final BooleanPropertyFields inherited from class net.minecraft.world.level.block.BlockBLOCK_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_DROPSFields inherited from class net.minecraft.world.level.block.state.BlockBehaviourdrops, dynamicShape, explosionResistance, friction, hasCollision, isRandomlyTicking, jumpFactor, properties, requiredFeatures, soundType, speedFactor, UPDATE_SHAPE_ORDERFields inherited from interface net.minecraft.world.flag.FeatureElementFILTERED_REGISTRIES
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedBaseRailBlock(boolean p_49360_, BlockBehaviour.Properties p_49361_) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanSurvive(BlockState p_49395_, LevelReader p_49396_, BlockPos p_49397_) getFluidState(BlockState p_152158_) getRailDirection(BlockState state, BlockGetter world, BlockPos pos, AbstractMinecart cart) Return the rail's direction.getShape(BlockState p_49403_, BlockGetter p_49404_, BlockPos p_49405_, CollisionContext p_49406_) Deprecated.getStateForPlacement(BlockPlaceContext p_49363_) booleanisFlexibleRail(BlockState state, BlockGetter world, BlockPos pos) Return true if the rail can make corners.static booleanisRail(BlockState p_49417_) static booleanbooleanvoidneighborChanged(BlockState p_49377_, Level p_49378_, BlockPos p_49379_, Block p_49380_, BlockPos p_49381_, boolean p_49382_) voidonPlace(BlockState p_49408_, Level p_49409_, BlockPos p_49410_, BlockState p_49411_, boolean p_49412_) voidonRemove(BlockState p_49384_, Level p_49385_, BlockPos p_49386_, BlockState p_49387_, boolean p_49388_) private static booleanshouldBeRemoved(BlockPos p_49399_, Level p_49400_, RailShape p_49401_) protected BlockStateupdateDir(Level p_49368_, BlockPos p_49369_, BlockState p_49370_, boolean p_49371_) updateShape(BlockState p_152151_, Direction p_152152_, BlockState p_152153_, LevelAccessor p_152154_, BlockPos p_152155_, BlockPos p_152156_) protected BlockStateupdateState(BlockState p_49390_, Level p_49391_, BlockPos p_49392_, boolean p_49393_) protected voidupdateState(BlockState p_49372_, Level p_49373_, BlockPos p_49374_, Block p_49375_) Methods inherited from class net.minecraft.world.level.block.BlockanimateTick, appendHoverText, asBlock, asItem, box, builtInRegistryHolder, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, createBlockStateDefinition, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, tryDropExperience, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOfMethods inherited from class net.minecraft.world.level.block.state.BlockBehaviourattack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMapColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getRenderShape, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isOcclusionShapeFullBlock, isPathfindable, isSignalSource, mirror, onProjectileHit, randomTick, requiredFeatures, rotate, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, use, useShapeForLightOcclusionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElementisEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeBaseRailBlockcanMakeSlopes, getRailMaxSpeed, isValidRailShape, onMinecartPassMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockaddLandingEffects, addRunningEffects, canBeHydrated, canConnectRedstone, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, collisionExtendsVertically, getAdjacentBlockPathType, getAppearance, getBeaconColorMultiplier, getBedDirection, getBlockPathType, getCloneItemStack, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getMapColor, getPistonPushReaction, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, hidesNeighborFace, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, isValidSpawn, makesOpenTrapdoorAboveClimbable, onBlockExploded, onBlockStateChange, onCaughtFire, onDestroyedByPlayer, onNeighborChange, onTreeGrow, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay, supportsExternalFaceHidingMethods inherited from interface net.minecraftforge.common.extensions.IForgeBucketPickupgetPickupSoundMethods inherited from interface net.minecraft.world.level.block.SimpleWaterloggedBlockcanPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
- 
Field Details- 
FLAT_AABB
- 
HALF_BLOCK_AABB
- 
WATERLOGGED
- 
isStraightprivate final boolean isStraight
 
- 
- 
Constructor Details- 
BaseRailBlock
 
- 
- 
Method Details- 
isRail
- 
isRail
- 
isStraightpublic boolean isStraight()
- 
getShapepublic VoxelShape getShape(BlockState p_49403_, BlockGetter p_49404_, BlockPos p_49405_, CollisionContext p_49406_) - Overrides:
- getShapein class- BlockBehaviour
 
- 
canSurvive- Overrides:
- canSurvivein class- BlockBehaviour
 
- 
onPlacepublic void onPlace(BlockState p_49408_, Level p_49409_, BlockPos p_49410_, BlockState p_49411_, boolean p_49412_) - Overrides:
- onPlacein class- BlockBehaviour
 
- 
updateStateprotected BlockState updateState(BlockState p_49390_, Level p_49391_, BlockPos p_49392_, boolean p_49393_) 
- 
neighborChangedpublic void neighborChanged(BlockState p_49377_, Level p_49378_, BlockPos p_49379_, Block p_49380_, BlockPos p_49381_, boolean p_49382_) - Overrides:
- neighborChangedin class- BlockBehaviour
 
- 
shouldBeRemoved
- 
updateState
- 
updateDirprotected BlockState updateDir(Level p_49368_, BlockPos p_49369_, BlockState p_49370_, boolean p_49371_) 
- 
onRemovepublic void onRemove(BlockState p_49384_, Level p_49385_, BlockPos p_49386_, BlockState p_49387_, boolean p_49388_) - Overrides:
- onRemovein class- BlockBehaviour
 
- 
getStateForPlacement- Overrides:
- getStateForPlacementin class- Block
 
- 
getShapePropertyDeprecated.Forge: UsegetRailDirection(BlockState, BlockGetter, BlockPos, net.minecraft.world.entity.vehicle.AbstractMinecart)for enhanced ability If you do change this property be aware that other functions in this/subclasses may break as they can make assumptions about this property
- 
updateShapepublic BlockState updateShape(BlockState p_152151_, Direction p_152152_, BlockState p_152153_, LevelAccessor p_152154_, BlockPos p_152155_, BlockPos p_152156_) - Overrides:
- updateShapein class- BlockBehaviour
 
- 
getFluidState- Overrides:
- getFluidStatein class- BlockBehaviour
 
- 
isFlexibleRailDescription copied from interface:IForgeBaseRailBlockReturn true if the rail can make corners. Used by placement logic.- Specified by:
- isFlexibleRailin interface- IForgeBaseRailBlock
- world- The level.
- pos- Block's position in level
- Returns:
- True if the rail can make corners.
 
- 
getRailDirectionpublic RailShape getRailDirection(BlockState state, BlockGetter world, BlockPos pos, @Nullable AbstractMinecart cart) Description copied from interface:IForgeBaseRailBlockReturn 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 interface- IForgeBaseRailBlock
- Parameters:
- state- The BlockState
- world- The level.
- pos- Block's position in level
- cart- The cart asking for the metadata, null if it is not called by EntityMinecart.
- Returns:
- The direction.
 
 
- 
getRailDirection(BlockState, BlockGetter, BlockPos, net.minecraft.world.entity.vehicle.AbstractMinecart)for enhanced ability If you do change this property be aware that other functions in this/subclasses may break as they can make assumptions about this property