Merge branch 'master' of https://github.com/GeyserMC/Geyser into feature/1.21

This commit is contained in:
Camotoy 2024-06-13 11:12:01 -04:00
commit 842e1b4d12
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 6 additions and 4 deletions

View file

@ -64,7 +64,7 @@ public class DoubleChestInventoryTranslator extends ChestInventoryTranslator {
if (session.getLastInteractionPlayerPosition().equals(session.getPlayerEntity().getPosition())) {
BlockState state = session.getGeyser().getWorldManager().blockAt(session, session.getLastInteractionBlockPosition());
if (!BlockRegistries.CUSTOM_BLOCK_STATE_OVERRIDES.get().containsKey(state.javaId())) {
if (state.block() == Blocks.CHEST || state.block() == Blocks.TRAPPED_CHEST
if ((state.block() == Blocks.CHEST || state.block() == Blocks.TRAPPED_CHEST)
&& state.getValue(Properties.CHEST_TYPE) != ChestType.SINGLE) {
inventory.setHolderPosition(session.getLastInteractionBlockPosition());
((Container) inventory).setUsingRealBlock(true, state.block());

View file

@ -42,9 +42,11 @@ public class DoubleChestBlockEntityTranslator extends BlockEntityTranslator impl
@Override
public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) {
int x = (int) bedrockNbt.get("x");
int z = (int) bedrockNbt.get("z");
translateChestValue(bedrockNbt, blockState, x, z);
if (blockState.getValue(Properties.CHEST_TYPE) != ChestType.SINGLE) {
int x = (int) bedrockNbt.get("x");
int z = (int) bedrockNbt.get("z");
translateChestValue(bedrockNbt, blockState, x, z);
}
}
/**