3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Sanity check for BlockState being chest

Dieser Commit ist enthalten in:
Camotoy 2024-06-13 13:53:20 -04:00
Ursprung db5a528965
Commit 746be566a2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -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");