Class SlabBlock
- All Implemented Interfaces:
FluidDrainable,FluidFillable,Waterloggable,ItemConvertible,ToggleableFeature
- Direct Known Subclasses:
OxidizableSlabBlock
- Mappings:
Namespace Name official cwnintermediary net/minecraft/class_2482named net/minecraft/block/SlabBlock
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.Block
Block.NeighborGroupNested classes/interfaces inherited from class net.minecraft.block.AbstractBlock
AbstractBlock.AbstractBlockState, AbstractBlock.ContextPredicate, AbstractBlock.Offsetter, AbstractBlock.OffsetType, AbstractBlock.Settings, AbstractBlock.TypedContextPredicate<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final VoxelShapeprotected static final VoxelShapestatic final EnumProperty<SlabType>static final BooleanPropertyFields inherited from class net.minecraft.block.Block
field_31022, field_31023, field_31024, field_31025, field_31035, FORCE_STATE, MOVED, NO_REDRAW, NOTIFY_ALL, NOTIFY_LISTENERS, NOTIFY_NEIGHBORS, REDRAW_ON_MAIN_THREAD, SKIP_DROPS, STATE_IDS, stateManagerFields inherited from class net.minecraft.block.AbstractBlock
collidable, DIRECTIONS, dynamicBounds, jumpVelocityMultiplier, lootTableId, randomTicks, requiredFeatures, resistance, settings, slipperiness, soundGroup, velocityMultiplierFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendProperties(StateManager.Builder<Block, BlockState> builder) Appends block state properties to this block.booleancanFillWithFluid(BlockView world, BlockPos pos, BlockState state, Fluid fluid) booleancanPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) Returns if an entity using navigation typetypecan navigate through this block.booleancanReplace(BlockState state, ItemPlacementContext context) Returns whether the item can replace the block.getFluidState(BlockState state) Returns the state's associated fluid state.getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Returns the state of the block after a neighboring block's state change.booleanhasSidedTransparency(BlockState state) Returns whether the block's transparency depends on the side of the block, like slabs.booleantryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) Methods inherited from class net.minecraft.block.Block
afterBreak, appendTooltip, asBlock, asItem, canMobSpawnInside, cannotConnect, createCuboidShape, dropExperience, dropExperienceWhenMined, dropStack, dropStack, dropStacks, dropStacks, dropStacks, getBlastResistance, getBlockFromItem, getDefaultState, getDroppedStacks, getDroppedStacks, getJumpVelocityMultiplier, getName, getPickStack, getRawIdFromState, getRegistryEntry, getShapesForStates, getSlipperiness, getSoundGroup, getStateFromRawId, getStateManager, getStateWithProperties, getTranslationKey, getVelocityMultiplier, hasDynamicBounds, hasRandomTicks, hasTopRim, isFaceFullSquare, isShapeFullCube, isTransparent, onBreak, onBroken, onDestroyedByExplosion, onEntityLand, onLandedUpon, onPlaced, onSteppedOn, postProcessState, precipitationTick, pushEntitiesUpBeforeBlockChange, randomDisplayTick, replace, replace, setDefaultState, shouldDrawSide, shouldDropItemsOnExplosion, sideCoversSmallSquare, spawnBreakParticles, toStringMethods inherited from class net.minecraft.block.AbstractBlock
calcBlockBreakingDelta, canBucketPlace, canPlaceAt, createScreenHandlerFactory, emitsRedstonePower, getAmbientOcclusionLightLevel, getCameraCollisionShape, getCollisionShape, getComparatorOutput, getCullingShape, getDefaultMapColor, getDroppedStacks, getHardness, getLootTableId, getMaxHorizontalModelOffset, getOpacity, getRaycastShape, getRenderingSeed, getRenderType, getRequiredFeatures, getSidesShape, getStrongRedstonePower, getVerticalModelOffsetMultiplier, getWeakRedstonePower, hasComparatorOutput, isCullingShapeFullCube, isShapeFullCube, isSideInvisible, mirror, neighborUpdate, onBlockAdded, onBlockBreakStart, onEntityCollision, onProjectileHit, onStacksDropped, onStateReplaced, onSyncedBlockEvent, onUse, prepare, randomTick, rotate, scheduledTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabledMethods inherited from interface net.minecraft.block.Waterloggable
getBucketFillSound, tryDrainFluid
-
Field Details
-
TYPE
- Mappings:
Namespace Name Mixin selector official aLcwn;a:Ldcw;intermediary field_11501Lnet/minecraft/class_2482;field_11501:Lnet/minecraft/class_2754;named TYPELnet/minecraft/block/SlabBlock;TYPE:Lnet/minecraft/state/property/EnumProperty;
-
WATERLOGGED
- Mappings:
Namespace Name Mixin selector official bLcwn;b:Ldcp;intermediary field_11502Lnet/minecraft/class_2482;field_11502:Lnet/minecraft/class_2746;named WATERLOGGEDLnet/minecraft/block/SlabBlock;WATERLOGGED:Lnet/minecraft/state/property/BooleanProperty;
-
BOTTOM_SHAPE
- Mappings:
Namespace Name Mixin selector official cLcwn;c:Leet;intermediary field_11500Lnet/minecraft/class_2482;field_11500:Lnet/minecraft/class_265;named BOTTOM_SHAPELnet/minecraft/block/SlabBlock;BOTTOM_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
TOP_SHAPE
- Mappings:
Namespace Name Mixin selector official dLcwn;d:Leet;intermediary field_11499Lnet/minecraft/class_2482;field_11499:Lnet/minecraft/class_265;named TOP_SHAPELnet/minecraft/block/SlabBlock;TOP_SHAPE:Lnet/minecraft/util/shape/VoxelShape;
-
-
Constructor Details
-
SlabBlock
- Mappings:
Namespace Name Mixin selector official <init>Ldbx;<init>(Ldbx$d;)Vintermediary <init>Lnet/minecraft/class_4970;<init>(Lnet/minecraft/class_4970$class_2251;)Vnamed <init>Lnet/minecraft/block/AbstractBlock;<init>(Lnet/minecraft/block/AbstractBlock$Settings;)V
-
-
Method Details
-
hasSidedTransparency
Returns whether the block's transparency depends on the side of the block, like slabs.- Overrides:
hasSidedTransparencyin classAbstractBlock- Returns:
- whether the block's transparency depends on the side of the block, like slabs
- Mappings:
Namespace Name Mixin selector official g_Ldbx;g_(Ldby;)Zintermediary method_9526Lnet/minecraft/class_4970;method_9526(Lnet/minecraft/class_2680;)Znamed hasSidedTransparencyLnet/minecraft/block/AbstractBlock;hasSidedTransparency(Lnet/minecraft/block/BlockState;)Z
-
appendProperties
Appends block state properties to this block. To use this, override and callStateManager.Builder.add(net.minecraft.state.property.Property<?>[])inside the method. SeePropertiesfor the list of pre-defined properties.- Overrides:
appendPropertiesin classBlock- Mappings:
Namespace Name Mixin selector official aLcpl;a(Ldbz$a;)Vintermediary method_9515Lnet/minecraft/class_2248;method_9515(Lnet/minecraft/class_2689$class_2690;)Vnamed appendPropertiesLnet/minecraft/block/Block;appendProperties(Lnet/minecraft/state/StateManager$Builder;)V
-
getOutlineShape
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) - Overrides:
getOutlineShapein classAbstractBlock- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lclq;Lgu;Leef;)Leet;intermediary method_9530Lnet/minecraft/class_4970;method_9530(Lnet/minecraft/class_2680;Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_3726;)Lnet/minecraft/class_265;named getOutlineShapeLnet/minecraft/block/AbstractBlock;getOutlineShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;
-
getPlacementState
- Overrides:
getPlacementStatein classBlock- Mappings:
Namespace Name Mixin selector official aLcpl;a(Lcif;)Ldby;intermediary method_9605Lnet/minecraft/class_2248;method_9605(Lnet/minecraft/class_1750;)Lnet/minecraft/class_2680;named getPlacementStateLnet/minecraft/block/Block;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
-
canReplace
Returns whether the item can replace the block.By default, this checks if the block allows replacing and whether the item differs from the block's item. Items composed of multiple blocks, such as candles, vines, or snow layers, should override this to implement additional checks.
This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient.- Overrides:
canReplacein classAbstractBlock- Returns:
- whether the item can replace the block
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lcif;)Zintermediary method_9616Lnet/minecraft/class_4970;method_9616(Lnet/minecraft/class_2680;Lnet/minecraft/class_1750;)Znamed canReplaceLnet/minecraft/block/AbstractBlock;canReplace(Lnet/minecraft/block/BlockState;Lnet/minecraft/item/ItemPlacementContext;)Z
-
getFluidState
Returns the state's associated fluid state.Waterloggable blocks must override this to return
Fluids.WATER.getStill(false)when waterlogged.- Overrides:
getFluidStatein classAbstractBlock- Returns:
- the state's associated fluid state
- See Also:
- Mappings:
Namespace Name Mixin selector official c_Ldbx;c_(Ldby;)Ldxb;intermediary method_9545Lnet/minecraft/class_4970;method_9545(Lnet/minecraft/class_2680;)Lnet/minecraft/class_3610;named getFluidStateLnet/minecraft/block/AbstractBlock;getFluidState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/fluid/FluidState;
-
tryFillWithFluid
public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) - Specified by:
tryFillWithFluidin interfaceFluidFillable- Specified by:
tryFillWithFluidin interfaceWaterloggable- Mappings:
Namespace Name Mixin selector official aLcty;a(Lcml;Lgu;Ldby;Ldxb;)Zintermediary method_10311Lnet/minecraft/class_2402;method_10311(Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3610;)Znamed tryFillWithFluidLnet/minecraft/block/FluidFillable;tryFillWithFluid(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/fluid/FluidState;)Z
-
canFillWithFluid
- Specified by:
canFillWithFluidin interfaceFluidFillable- Specified by:
canFillWithFluidin interfaceWaterloggable- Mappings:
Namespace Name Mixin selector official aLcty;a(Lclq;Lgu;Ldby;Ldxa;)Zintermediary method_10310Lnet/minecraft/class_2402;method_10310(Lnet/minecraft/class_1922;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_3611;)Znamed canFillWithFluidLnet/minecraft/block/FluidFillable;canFillWithFluid(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/fluid/Fluid;)Z
-
getStateForNeighborUpdate
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) Returns the state of the block after a neighboring block's state change.Returning
Blocks.AIRbreaks the block. This is useful to implement supporting block requirement for blocks (if used along withAbstractBlock.canPlaceAt(net.minecraft.block.BlockState, net.minecraft.world.WorldView, net.minecraft.util.math.BlockPos)).Side effects like activating a redstone component (but not scheduling a tick) should be performed in
AbstractBlock.neighborUpdate(net.minecraft.block.BlockState, net.minecraft.world.World, net.minecraft.util.math.BlockPos, net.minecraft.block.Block, net.minecraft.util.math.BlockPos, boolean)instead. If the block supports waterlogging and currently has water, this method should be overridden to tick the fluid at the block's position.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
World.isClient. This is not called ifBlock.FORCE_STATEflag is set in thesetBlockStatecall.This method can be used for multiple purposes. Here are some examples:
FenceBlockuses it to update the fence's connection when a horizontally neighboring block's state is changed.PlantBlockuses it to break the plant if the state change causes it to lose its supporting block.DoorBlockuses it to copy the state of the other half of the door.SlabBlockuses it to schedule the fluid to tick if waterlogged.SoulSandBlockuses it to schedule the water block above to tick so that it becomes a bubble column.FallingBlockuses it to schedule the block to tick so that it can fall if needed.
- Overrides:
getStateForNeighborUpdatein classAbstractBlock- Parameters:
state- the state of this blockdirection- the direction from this block to the neighborneighborState- the state of the updated neighbor blockworld- the worldpos- the position of this blockneighborPos- the position of the neighbor block- Returns:
- the state of the block after a neighboring block's state change
- See Also:
- Mappings:
Namespace Name Mixin selector official aLdbx;a(Ldby;Lha;Ldby;Lcml;Lgu;Lgu;)Ldby;intermediary method_9559Lnet/minecraft/class_4970;method_9559(Lnet/minecraft/class_2680;Lnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2680;named getStateForNeighborUpdateLnet/minecraft/block/AbstractBlock;getStateForNeighborUpdate(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Direction;Lnet/minecraft/block/BlockState;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;
-