public abstract class AbstractRailBlock extends Block
Block.OffsetType, Block.Properties, Block.RenderSideCacheKey
Modifier and Type | Field and Description |
---|---|
protected static VoxelShape |
ASCENDING_AABB |
private boolean |
disableCorners |
protected static VoxelShape |
FLAT_AABB |
BLOCK_STATE_IDS, blockHardness, blockResistance, blocksMovement, lightValue, LOGGER, material, materialColor, RANDOM, soundType, stateContainer, ticksRandomly
delegate
Modifier | Constructor and Description |
---|---|
protected |
AbstractRailBlock(boolean p_i48444_1_,
Block.Properties p_i48444_2_) |
Modifier and Type | Method and Description |
---|---|
boolean |
areCornersDisabled() |
boolean |
canMakeSlopes(BlockState state,
IBlockReader world,
BlockPos pos)
Returns true if the rail can make up and down slopes.
|
PushReaction |
getPushReaction(BlockState state) |
RailShape |
getRailDirection(BlockState state,
IBlockReader world,
BlockPos pos,
AbstractMinecartEntity cart)
Return the rail's direction.
|
float |
getRailMaxSpeed(BlockState state,
World world,
BlockPos pos,
AbstractMinecartEntity cart)
Returns the max speed of the rail at the specified position.
|
VoxelShape |
getShape(BlockState state,
IBlockReader worldIn,
BlockPos pos,
ISelectionContext context) |
abstract IProperty<RailShape> |
getShapeProperty() |
BlockState |
getStateForPlacement(BlockItemUseContext context) |
protected BlockState |
getUpdatedState(World worldIn,
BlockPos pos,
BlockState state,
boolean placing) |
boolean |
isFlexibleRail(BlockState state,
IBlockReader world,
BlockPos pos)
Return true if the rail can make corners.
|
static boolean |
isRail(BlockState state) |
static boolean |
isRail(World worldIn,
BlockPos pos) |
boolean |
isValidPosition(BlockState state,
IWorldReader worldIn,
BlockPos pos) |
void |
neighborChanged(BlockState state,
World worldIn,
BlockPos pos,
Block blockIn,
BlockPos fromPos,
boolean isMoving) |
void |
onBlockAdded(BlockState state,
World worldIn,
BlockPos pos,
BlockState oldState,
boolean isMoving) |
void |
onMinecartPass(BlockState state,
World world,
BlockPos pos,
AbstractMinecartEntity cart)
This function is called by any minecart that passes over this rail.
|
void |
onReplaced(BlockState state,
World worldIn,
BlockPos pos,
BlockState newState,
boolean isMoving) |
protected void |
updateState(BlockState state,
World worldIn,
BlockPos pos,
Block blockIn) |
addInformation, allowsMovement, animateTick, asItem, canDropFromExplosion, canEntitySpawn, cannotAttach, canProvidePower, canSpawnInBlock, canSustainPlant, causesSuffocation, doesSideFillSquare, dropXpOnBlockBreak, eventReceived, fillItemGroup, fillStateContainer, fillWithRain, getAmbientOcclusionLightValue, getBlockFromItem, getBlockHardness, getCollisionShape, getComparatorInputOverride, getContainer, getDefaultState, getDrops, getDrops, getDrops, getExplosionResistance, getFluidState, getHarvestLevel, getHarvestTool, getItem, getJumpFactor, getLightValue, getLootTable, getMaterial, getMaterialColor, getNameTextComponent, getOffset, getOffsetType, getOpacity, getPlayerRelativeBlockHardness, getPositionRandom, getRaytraceShape, getRenderShape, getRenderType, getSlipperiness, getSlipperiness, getSoundType, getSpeedFactor, getStateById, getStateContainer, getStateId, getStrongPower, getTags, getTranslationKey, getValidBlockForPosition, getWeakPower, harvestBlock, hasComparatorInputOverride, hasEnoughSolidSide, hasSolidSide, hasSolidSideOnTop, hasTileEntity, isAir, isEmissiveRendering, isIn, isNormalCube, isOpaque, isOpaqueCube, isReplaceable, isReplaceable, isSideInvisible, isSolid, isTransparent, isVariableOpacity, isViewBlocking, makeCuboidShape, mirror, needsPostProcessing, nudgeEntitiesWithNewState, onBlockActivated, onBlockClicked, onBlockHarvested, onBlockPlacedBy, onEntityCollision, onEntityWalk, onExplosionDestroy, onFallenUpon, onLanded, onPlayerDestroy, onProjectileCollision, propagatesSkylightDown, randomTick, replaceBlock, rotate, setDefaultState, shouldSideBeRendered, spawnAdditionalDrops, spawnAsEntity, spawnDrops, spawnDrops, spawnDrops, tick, tickRate, ticksRandomly, toString, updateDiagonalNeighbors, updateNeighbors, updatePostPlacement
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, beginLeaveDecay, canBeConnectedTo, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, createTileEntity, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getExtendedState, getFireSpreadSpeed, getFlammability, getFogColor, getLightValue, getPickBlock, getRayTraceResult, getSoundType, getStateAtViewpoint, getStateForPlacement, getValidRotations, getWeakChanges, hasTileEntity, isAir, isBeaconBase, isBed, isBedFoot, isBurning, isConduitFrame, isFertile, isFireSource, isFlammable, isFoliage, isLadder, isPortalFrame, isReplaceableOreGen, isSlimeBlock, isStickyBlock, isToolEffective, observedNeighborChange, onBlockExploded, onNeighborChange, onPlantGrow, recolorBlock, removedByPlayer, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlay
protected static final VoxelShape FLAT_AABB
protected static final VoxelShape ASCENDING_AABB
private final boolean disableCorners
protected AbstractRailBlock(boolean p_i48444_1_, Block.Properties p_i48444_2_)
public static boolean isRail(BlockState state)
public boolean areCornersDisabled()
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
public boolean isValidPosition(BlockState state, IWorldReader worldIn, BlockPos pos)
isValidPosition
in class Block
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving)
onBlockAdded
in class Block
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving)
neighborChanged
in class Block
protected void updateState(BlockState state, World worldIn, BlockPos pos, Block blockIn)
protected BlockState getUpdatedState(World worldIn, BlockPos pos, BlockState state, boolean placing)
public PushReaction getPushReaction(BlockState state)
getPushReaction
in class Block
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving)
onReplaced
in class Block
public BlockState getStateForPlacement(BlockItemUseContext context)
getStateForPlacement
in class Block
public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos)
world
- The world.pos
- Block's position in worldpublic boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos)
world
- The world.pos
- Block's position in worldpublic RailShape getRailDirection(BlockState state, IBlockReader world, BlockPos pos, @Nullable AbstractMinecartEntity cart)
world
- The world.pos
- Block's position in worldstate
- The BlockStatecart
- The cart asking for the metadata, null if it is not called by EntityMinecart.public float getRailMaxSpeed(BlockState state, World world, BlockPos pos, AbstractMinecartEntity cart)
world
- The world.cart
- The cart on the rail, may be null.pos
- Block's position in worldpublic void onMinecartPass(BlockState state, World world, BlockPos pos, AbstractMinecartEntity cart)
world
- The world.cart
- The cart on the rail.pos
- Block's position in world