Package net.minecraft.world.level.block
Class BaseRailBlock
java.lang.Object
net.minecraftforge.registries.ForgeRegistryEntry<Block>
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.minecraft.world.level.block.BaseRailBlock
- All Implemented Interfaces:
BucketPickup
,LiquidBlockContainer
,SimpleWaterloggedBlock
,ItemLike
,IForgeBaseRailBlock
,IForgeBlock
,IForgeRegistryEntry<Block>
- Direct Known Subclasses:
DetectorRailBlock
,PoweredRailBlock
,RailBlock
public abstract class BaseRailBlock
extends Block
implements SimpleWaterloggedBlock, IForgeBaseRailBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.Block
Block.BlockStatePairKey
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.BlockBehaviour
BlockBehaviour.BlockStateBase, BlockBehaviour.OffsetType, BlockBehaviour.Properties, BlockBehaviour.StateArgumentPredicate<A>, BlockBehaviour.StatePredicate
Nested classes/interfaces inherited from class net.minecraftforge.registries.ForgeRegistryEntry
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static VoxelShape
protected static VoxelShape
private boolean
static BooleanProperty
Fields inherited from class net.minecraft.world.level.block.Block
BLOCK_STATE_REGISTRY, INDESTRUCTIBLE, INSTANT, LOGGER, RANDOM, 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_DROPS, UPDATE_SUPPRESS_LIGHT
Fields inherited from class net.minecraft.world.level.block.state.BlockBehaviour
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
ModifierConstructorDescriptionprotected
BaseRailBlock(boolean p_49360_, BlockBehaviour.Properties p_49361_)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canSurvive(BlockState p_49395_, LevelReader p_49396_, BlockPos p_49397_)
getFluidState(BlockState p_152158_)
getPistonPushReaction(BlockState p_49415_)
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_)
boolean
isFlexibleRail(BlockState state, BlockGetter world, BlockPos pos)
Return true if the rail can make corners.static boolean
isRail(BlockState p_49417_)
static boolean
boolean
void
neighborChanged(BlockState p_49377_, Level p_49378_, BlockPos p_49379_, Block p_49380_, BlockPos p_49381_, boolean p_49382_)
void
onPlace(BlockState p_49408_, Level p_49409_, BlockPos p_49410_, BlockState p_49411_, boolean p_49412_)
void
onRemove(BlockState p_49384_, Level p_49385_, BlockPos p_49386_, BlockState p_49387_, boolean p_49388_)
private static boolean
shouldBeRemoved(BlockPos p_49399_, Level p_49400_, RailShape p_49401_)
protected BlockState
updateDir(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 BlockState
updateState(BlockState p_49390_, Level p_49391_, BlockPos p_49392_, boolean p_49393_)
protected void
updateState(BlockState p_49372_, Level p_49373_, BlockPos p_49374_, Block p_49375_)
Methods inherited from class net.minecraft.world.level.block.Block
animateTick, appendHoverText, asBlock, asItem, box, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, createBlockStateDefinition, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, dropResources, fallOn, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getId, getJumpFactor, getName, getRenderPropertiesInternal, getShapeForEachState, getSoundType, getSpeedFactor, getStateDefinition, getTags, handlePrecipitation, hasDynamicShape, initializeClient, isExceptionForConnection, isFaceFull, isPossibleToRespawnInThis, isRandomlyTicking, isShapeFullBlock, playerDestroy, playerWillDestroy, popExperience, popResource, popResourceFromFace, propagatesSkylightDown, pushEntitiesUp, registerDefaultState, setPlacedBy, shouldRenderFace, spawnDestroyParticles, stateById, stepOn, toString, updateEntityAfterFallOn, updateFromNeighbourShapes, updateOrDestroy, updateOrDestroy, wasExploded, withPropertiesOf
Methods inherited from class net.minecraft.world.level.block.state.BlockBehaviour
attack, canBeReplaced, canBeReplaced, defaultDestroyTime, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getDrops, getInteractionShape, getLightBlock, getLootTable, getMaxHorizontalOffset, getMaxVerticalOffset, getMenuProvider, getOcclusionShape, getOffsetType, getRenderShape, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isCollisionShapeFullBlock, isPathfindable, isSignalSource, mirror, onProjectileHit, randomTick, rotate, skipRendering, spawnAfterBreak, tick, triggerEvent, updateIndirectNeighbourShapes, 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.IForgeBaseRailBlock
canMakeSlopes, getRailMaxSpeed, onMinecartPass
Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlock
addLandingEffects, addRunningEffects, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFriction, getLightEmission, getPickBlock, getRespawnPosition, getSoundType, getStateAtViewpoint, getToolModifiedState, getWeakChanges, isBed, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isLadder, isPortalFrame, isScaffolding, isSlimeBlock, isStickyBlock, makesOpenTrapdoorAboveClimbable, onBlockExploded, onNeighborChange, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
Methods inherited from interface net.minecraft.world.level.block.SimpleWaterloggedBlock
canPlaceLiquid, getPickupSound, pickupBlock, placeLiquid
-
Field Details
-
FLAT_AABB
-
HALF_BLOCK_AABB
-
WATERLOGGED
-
isStraight
private final boolean isStraight
-
-
Constructor Details
-
BaseRailBlock
-
-
Method Details
-
isRail
-
isRail
-
isStraight
public boolean isStraight() -
getShape
public VoxelShape getShape(BlockState p_49403_, BlockGetter p_49404_, BlockPos p_49405_, CollisionContext p_49406_)- Overrides:
getShape
in classBlockBehaviour
-
canSurvive
- Overrides:
canSurvive
in classBlockBehaviour
-
onPlace
public void onPlace(BlockState p_49408_, Level p_49409_, BlockPos p_49410_, BlockState p_49411_, boolean p_49412_)- Overrides:
onPlace
in classBlockBehaviour
-
updateState
protected BlockState updateState(BlockState p_49390_, Level p_49391_, BlockPos p_49392_, boolean p_49393_) -
neighborChanged
public void neighborChanged(BlockState p_49377_, Level p_49378_, BlockPos p_49379_, Block p_49380_, BlockPos p_49381_, boolean p_49382_)- Overrides:
neighborChanged
in classBlockBehaviour
-
shouldBeRemoved
-
updateState
-
updateDir
protected BlockState updateDir(Level p_49368_, BlockPos p_49369_, BlockState p_49370_, boolean p_49371_) -
getPistonPushReaction
- Overrides:
getPistonPushReaction
in classBlockBehaviour
-
onRemove
public void onRemove(BlockState p_49384_, Level p_49385_, BlockPos p_49386_, BlockState p_49387_, boolean p_49388_)- Overrides:
onRemove
in classBlockBehaviour
-
getStateForPlacement
- Overrides:
getStateForPlacement
in classBlock
-
getShapeProperty
Deprecated. -
updateShape
public BlockState updateShape(BlockState p_152151_, Direction p_152152_, BlockState p_152153_, LevelAccessor p_152154_, BlockPos p_152155_, BlockPos p_152156_)- Overrides:
updateShape
in classBlockBehaviour
-
getFluidState
- Overrides:
getFluidState
in classBlockBehaviour
-
isFlexibleRail
Description copied from interface:IForgeBaseRailBlock
Return true if the rail can make corners. Used by placement logic.- Specified by:
isFlexibleRail
in interfaceIForgeBaseRailBlock
world
- The world.pos
- Block's position in world- Returns:
- True if the rail can make corners.
-
getRailDirection
public RailShape getRailDirection(BlockState state, BlockGetter world, BlockPos pos, @Nullable AbstractMinecart cart)Description copied from interface:IForgeBaseRailBlock
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 interfaceIForgeBaseRailBlock
- 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.
-