mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Sanity check for BlockState being chest
This commit is contained in:
parent
db5a528965
commit
746be566a2
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,7 @@ package org.geysermc.geyser.translator.level.block.entity;
|
||||||
|
|
||||||
import org.cloudburstmc.nbt.NbtMap;
|
import org.cloudburstmc.nbt.NbtMap;
|
||||||
import org.cloudburstmc.nbt.NbtMapBuilder;
|
import org.cloudburstmc.nbt.NbtMapBuilder;
|
||||||
|
import org.geysermc.geyser.level.block.Blocks;
|
||||||
import org.geysermc.geyser.level.block.property.ChestType;
|
import org.geysermc.geyser.level.block.property.ChestType;
|
||||||
import org.geysermc.geyser.level.block.property.Properties;
|
import org.geysermc.geyser.level.block.property.Properties;
|
||||||
import org.geysermc.geyser.level.block.type.BlockState;
|
import org.geysermc.geyser.level.block.type.BlockState;
|
||||||
|
@ -42,6 +43,9 @@ public class DoubleChestBlockEntityTranslator extends BlockEntityTranslator impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) {
|
public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) {
|
||||||
|
if (!(blockState.is(Blocks.CHEST) || blockState.is(Blocks.TRAPPED_CHEST))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (blockState.getValue(Properties.CHEST_TYPE) != ChestType.SINGLE) {
|
if (blockState.getValue(Properties.CHEST_TYPE) != ChestType.SINGLE) {
|
||||||
int x = (int) bedrockNbt.get("x");
|
int x = (int) bedrockNbt.get("x");
|
||||||
int z = (int) bedrockNbt.get("z");
|
int z = (int) bedrockNbt.get("z");
|
||||||
|
|
Loading…
Reference in a new issue