Class DoubleChestBlockEntityTranslator
java.lang.Object
org.geysermc.geyser.translator.level.block.entity.BlockEntityTranslator
org.geysermc.geyser.translator.level.block.entity.DoubleChestBlockEntityTranslator
- All Implemented Interfaces:
BedrockOnlyBlockEntity,RequiresBlockState
public class DoubleChestBlockEntityTranslator
extends BlockEntityTranslator
implements BedrockOnlyBlockEntity
Chests have more block entity properties in Bedrock, which is solved by implementing the BedrockOnlyBlockEntity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisBlock(int blockState)Determines if block is part of classstatic voidtranslateChestValue(com.nukkitx.nbt.NbtMapBuilder builder, DoubleChestValue chestValues, int x, int z)Add Bedrock block entity tags to a NbtMap based on Java propertiesvoidtranslateTag(com.nukkitx.nbt.NbtMapBuilder builder, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, int blockState)voidupdateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)Update the block on Bedrock Edition.Methods inherited from class org.geysermc.geyser.translator.level.block.entity.BlockEntityTranslator
getBlockEntityTag, getConstantBedrockTag, getOrDefault
-
Constructor Details
-
DoubleChestBlockEntityTranslator
public DoubleChestBlockEntityTranslator()
-
-
Method Details
-
isBlock
public boolean isBlock(int blockState)Description copied from interface:BedrockOnlyBlockEntityDetermines if block is part of class- Specified by:
isBlockin interfaceBedrockOnlyBlockEntity- Parameters:
blockState- BlockState to be compared- Returns:
- true if part of the class
-
updateBlock
public void updateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)Description copied from interface:BedrockOnlyBlockEntityUpdate the block on Bedrock Edition.- Specified by:
updateBlockin interfaceBedrockOnlyBlockEntity- Parameters:
session- GeyserConnection.blockState- The Java block state.position- The Bedrock block position.
-
translateTag
public void translateTag(com.nukkitx.nbt.NbtMapBuilder builder, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, int blockState)- Specified by:
translateTagin classBlockEntityTranslator
-
translateChestValue
public static void translateChestValue(com.nukkitx.nbt.NbtMapBuilder builder, DoubleChestValue chestValues, int x, int z)Add Bedrock block entity tags to a NbtMap based on Java properties- Parameters:
builder- the NbtMapBuilder to apply properties tochestValues- the position properties of this double chestx- the x position of this chest pairz- the z position of this chest pair
-