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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isBlock(int blockState)
Determines if block is part of classstatic void
translateChestValue(com.nukkitx.nbt.NbtMapBuilder builder, DoubleChestValue chestValues, int x, int z)
Add Bedrock block entity tags to a NbtMap based on Java propertiesvoid
translateTag(com.nukkitx.nbt.NbtMapBuilder builder, com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, int blockState)
void
updateBlock(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:BedrockOnlyBlockEntity
Determines if block is part of class- Specified by:
isBlock
in 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:BedrockOnlyBlockEntity
Update the block on Bedrock Edition.- Specified by:
updateBlock
in 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:
translateTag
in 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
-