Interface CamouflageableBlockEntity
- All Known Implementing Classes:
AdvancedPressureTubeBlockEntity,ChargingStationBlockEntity,ElevatorBaseBlockEntity,ElevatorCallerBlockEntity,HeatPipeBlockEntity,PneumaticDoorBaseBlockEntity,PressureTubeBlockEntity,ReinforcedPressureTubeBlockEntity
public interface CamouflageableBlockEntity
Implement this interface in tile entities which should store a camouflaged state. The corresponding block should
be a subclass of
AbstractCamouflageBlock-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.BlockStateGet the camouflage state; the blockstate which will be used to render this block entity's block.static net.minecraft.world.item.ItemStackgetStackForState(net.minecraft.world.level.block.state.BlockState state) Convenience method: get the itemstack for the given block state.static net.minecraft.world.level.block.state.BlockStatereadCamo(net.minecraft.nbt.CompoundTag tag) voidsetCamouflage(net.minecraft.world.level.block.state.BlockState state) Set the camouflage for the block entity.static voidConvenience method: sync camo state to clientstatic voidwriteCamo(net.minecraft.nbt.CompoundTag tag, net.minecraft.world.level.block.state.BlockState state)
-
Method Details
-
getCamouflage
net.minecraft.world.level.block.state.BlockState getCamouflage()Get the camouflage state; the blockstate which will be used to render this block entity's block.- Returns:
- the camouflage state, or null if the block should not be camouflaged
-
setCamouflage
void setCamouflage(net.minecraft.world.level.block.state.BlockState state) Set the camouflage for the block entity. The block entity should sync this state to the client, and do any necessary re-rendering of the block when the synced state changes.- Parameters:
state- the camo block state
-
getStackForState
static net.minecraft.world.item.ItemStack getStackForState(net.minecraft.world.level.block.state.BlockState state) Convenience method: get the itemstack for the given block state.- Parameters:
state- the block state- Returns:
- an item for that block state
-
syncToClient
Convenience method: sync camo state to client- Parameters:
te- the block entity
-
readCamo
static net.minecraft.world.level.block.state.BlockState readCamo(net.minecraft.nbt.CompoundTag tag) -
writeCamo
static void writeCamo(net.minecraft.nbt.CompoundTag tag, net.minecraft.world.level.block.state.BlockState state)
-