public abstract class MultiBlock
extends net.minecraft.block.ContainerBlock
net.minecraft.block.Block.RenderSideCacheKeynet.minecraft.block.AbstractBlock.AbstractBlockState, net.minecraft.block.AbstractBlock.IExtendedPositionPredicate<A>, net.minecraft.block.AbstractBlock.IPositionPredicate, net.minecraft.block.AbstractBlock.OffsetType, net.minecraft.block.AbstractBlock.Properties| Modifier and Type | Field and Description |
|---|---|
static net.minecraft.state.DirectionProperty |
FACING |
protected double |
height |
protected boolean |
jsonOffset
Mostly needed for large JSON models since they can't be shifted more than 1 block to the side.
|
protected int |
length |
static net.minecraft.state.EnumProperty<MultiBlockPosition> |
MULTIPOS |
protected int |
width |
BLOCK_STATE_REGISTRY, LOGGER, RANDOM, stateDefinition| Modifier | Constructor and Description |
|---|---|
protected |
MultiBlock(net.minecraft.block.AbstractBlock.Properties builder,
int width,
double height,
int length)
Initializes a multi-block.
|
protected |
MultiBlock(net.minecraft.block.AbstractBlock.Properties builder,
int width,
double height,
int length,
boolean jsonOffset)
Initializes a multi-block.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createBlockStateDefinition(net.minecraft.state.StateContainer.Builder<net.minecraft.block.Block,net.minecraft.block.BlockState> builder) |
net.minecraft.tileentity.TileEntity |
createTileEntity(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader world) |
net.minecraft.util.math.BlockPos |
findBaseBlock(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos.Mutable pos,
net.minecraft.block.BlockState state)
Finds the base of the multi-block.
|
java.util.List<net.minecraft.item.ItemStack> |
getDrops(net.minecraft.block.BlockState state,
net.minecraft.loot.LootContext.Builder context) |
double |
getHeight() |
boolean |
getJsonOffset() |
int |
getLength() |
int |
getLightValue(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos)
Blocks that are multiblocks have lighting issues if their light level is 0 so default them all to 1
|
protected net.minecraft.util.math.AxisAlignedBB |
getMultiBlockBoundingBox(net.minecraft.world.IBlockReader worldIn,
net.minecraft.util.math.BlockPos pos,
MultiBlockPosition multiPos,
net.minecraft.util.Direction facing)
Gets the bounding box for the multi-block.
|
net.minecraft.util.math.shapes.VoxelShape |
getShape(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader worldIn,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.shapes.ISelectionContext context) |
protected abstract java.util.Optional<net.minecraft.tileentity.TileEntity> |
getTileEntity(net.minecraft.world.IBlockReader world,
net.minecraft.block.BlockState state)
Gets the tile entity associated with the multi-block.
|
int |
getWidth() |
net.minecraft.tileentity.TileEntity |
newBlockEntity(net.minecraft.world.IBlockReader worldIn) |
void |
onRemove(net.minecraft.block.BlockState p_196243_1_,
net.minecraft.world.World p_196243_2_,
net.minecraft.util.math.BlockPos p_196243_3_,
net.minecraft.block.BlockState p_196243_4_,
boolean p_196243_5_) |
boolean |
removedByPlayer(net.minecraft.block.BlockState state,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player,
boolean willHarvest,
net.minecraft.fluid.FluidState fluid) |
net.minecraft.block.BlockState |
rotate(net.minecraft.block.BlockState p_185499_1_,
net.minecraft.util.Rotation p_185499_2_) |
getMenuProvider, getRenderShape, triggerEventanimateTick, appendHoverText, asBlock, asItem, box, byItem, canSupportCenter, canSupportRigidBlock, canSustainPlant, defaultBlockState, destroy, dropFromExplosion, dropResources, dropResources, dropResources, fallOn, fillItemCategory, getCloneItemStack, getDescriptionId, getDrops, getDrops, getExplosionResistance, getFriction, getHarvestLevel, getHarvestTool, getId, getJumpFactor, getName, getSoundType, getSpeedFactor, getStateDefinition, getStateForPlacement, 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, wasExplodedattack, canBeReplaced, canBeReplaced, canSurvive, defaultMaterialColor, entityInside, getAnalogOutputSignal, getBlockSupportShape, getCollisionShape, getDestroyProgress, getDirectSignal, getFluidState, getInteractionShape, getLightBlock, getLootTable, getOcclusionShape, getOffsetType, getPistonPushReaction, getSeed, getShadeBrightness, getSignal, getVisualShape, hasAnalogOutputSignal, isAir, isEntityBlock, isPathfindable, isSignalSource, mirror, neighborChanged, onPlace, onProjectileHit, randomTick, skipRendering, spawnAfterBreak, tick, updateIndirectNeighbourShapes, updateShape, use, useShapeForLightOcclusiongetRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddDestroyEffects, addHitEffects, addLandingEffects, addRunningEffects, canBeReplacedByLeaves, canBeReplacedByLogs, canConnectRedstone, canCreatureSpawn, canDropFromExplosion, canEntityDestroy, canHarvestBlock, canStickTo, catchFire, collisionExtendsVertically, getAiPathNodeType, getBeaconColorMultiplier, getBedDirection, getBedSpawnPosition, getBlock, getEnchantPowerBonus, getExpDrop, getExplosionResistance, getFireSpreadSpeed, getFlammability, getFogColor, 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, rotate, setBedOccupied, shouldCheckWeakPower, shouldDisplayFluidOverlaypublic static final net.minecraft.state.DirectionProperty FACING
public static final net.minecraft.state.EnumProperty<MultiBlockPosition> MULTIPOS
protected int width
protected int length
protected double height
protected boolean jsonOffset
protected MultiBlock(net.minecraft.block.AbstractBlock.Properties builder,
int width,
double height,
int length)
builder - The material that the multi-block is made of.width - The width of the multi-block.height - The height of the multi-block.length - The length of the multi-block.protected MultiBlock(net.minecraft.block.AbstractBlock.Properties builder,
int width,
double height,
int length,
boolean jsonOffset)
builder - The material that the multi-block is made of.width - The width of the multi-block.height - The height of the multi-block.length - The length of the multi-block.jsonOffset - Whether this block needs to be offset for a JSON model to render properlyprotected void createBlockStateDefinition(net.minecraft.state.StateContainer.Builder<net.minecraft.block.Block,net.minecraft.block.BlockState> builder)
createBlockStateDefinition in class net.minecraft.block.Blockpublic net.minecraft.util.math.shapes.VoxelShape getShape(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader worldIn,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.math.shapes.ISelectionContext context)
getShape in class net.minecraft.block.AbstractBlockpublic net.minecraft.block.BlockState rotate(net.minecraft.block.BlockState p_185499_1_,
net.minecraft.util.Rotation p_185499_2_)
rotate in class net.minecraft.block.AbstractBlockprotected net.minecraft.util.math.AxisAlignedBB getMultiBlockBoundingBox(net.minecraft.world.IBlockReader worldIn,
net.minecraft.util.math.BlockPos pos,
MultiBlockPosition multiPos,
net.minecraft.util.Direction facing)
worldIn - The world that the multi-block is in.pos - The position of the block to get a bounding box for.multiPos - The position of the block relative to the base of the multi-blockfacing - The direction that the multi-block is facing.public net.minecraft.tileentity.TileEntity newBlockEntity(net.minecraft.world.IBlockReader worldIn)
public net.minecraft.tileentity.TileEntity createTileEntity(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader world)
public void onRemove(net.minecraft.block.BlockState p_196243_1_,
net.minecraft.world.World p_196243_2_,
net.minecraft.util.math.BlockPos p_196243_3_,
net.minecraft.block.BlockState p_196243_4_,
boolean p_196243_5_)
onRemove in class net.minecraft.block.AbstractBlockprotected abstract java.util.Optional<net.minecraft.tileentity.TileEntity> getTileEntity(net.minecraft.world.IBlockReader world,
net.minecraft.block.BlockState state)
world - The world the multi-block is in.state - The multi-block to get a tile entity for.public boolean removedByPlayer(net.minecraft.block.BlockState state,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.entity.player.PlayerEntity player,
boolean willHarvest,
net.minecraft.fluid.FluidState fluid)
public java.util.List<net.minecraft.item.ItemStack> getDrops(net.minecraft.block.BlockState state,
net.minecraft.loot.LootContext.Builder context)
getDrops in class net.minecraft.block.AbstractBlockpublic net.minecraft.util.math.BlockPos findBaseBlock(net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos.Mutable pos,
net.minecraft.block.BlockState state)
world - The world the multi-block is in.pos - The position of the block to get a base from.state - The block to get a base from.public int getWidth()
public int getLength()
public double getHeight()
public boolean getJsonOffset()
public int getLightValue(net.minecraft.block.BlockState state,
net.minecraft.world.IBlockReader world,
net.minecraft.util.math.BlockPos pos)
state - world - pos -