Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-03 14:50:19 +01:00
Fix null block entity console spam, which caused the world to be invisible
This was a rare bug that only happened on very few servers, and from what I gathered, only 1.8 servers using ViaVersion.
Dieser Commit ist enthalten in:
Ursprung
392b0b5727
Commit
c13bbcda85
@ -44,13 +44,12 @@ public abstract class BlockEntityTranslator {
|
|||||||
|
|
||||||
public abstract com.nukkitx.nbt.tag.CompoundTag getDefaultBedrockTag(String bedrockId, int x, int y, int z);
|
public abstract com.nukkitx.nbt.tag.CompoundTag getDefaultBedrockTag(String bedrockId, int x, int y, int z);
|
||||||
|
|
||||||
public com.nukkitx.nbt.tag.CompoundTag getBlockEntityTag(CompoundTag tag) {
|
public com.nukkitx.nbt.tag.CompoundTag getBlockEntityTag(String id, CompoundTag tag) {
|
||||||
int x = Integer.parseInt(String.valueOf(tag.getValue().get("x").getValue()));
|
int x = Integer.parseInt(String.valueOf(tag.getValue().get("x").getValue()));
|
||||||
int y = Integer.parseInt(String.valueOf(tag.getValue().get("y").getValue()));
|
int y = Integer.parseInt(String.valueOf(tag.getValue().get("y").getValue()));
|
||||||
int z = Integer.parseInt(String.valueOf(tag.getValue().get("z").getValue()));
|
int z = Integer.parseInt(String.valueOf(tag.getValue().get("z").getValue()));
|
||||||
|
|
||||||
CompoundTagBuilder tagBuilder = getConstantBedrockTag(BlockEntityUtils.getBedrockBlockEntityId(
|
CompoundTagBuilder tagBuilder = getConstantBedrockTag(BlockEntityUtils.getBedrockBlockEntityId(id), x, y, z).toBuilder();
|
||||||
String.valueOf(tag.get("id").getValue())), x, y, z).toBuilder();
|
|
||||||
translateTag(tag).forEach(tagBuilder::tag);
|
translateTag(tag).forEach(tagBuilder::tag);
|
||||||
return tagBuilder.buildRootTag();
|
return tagBuilder.buildRootTag();
|
||||||
}
|
}
|
||||||
|
@ -45,12 +45,12 @@ public class JavaUpdateTileEntityTranslator extends PacketTranslator<ServerUpdat
|
|||||||
if (id.equalsIgnoreCase("Sign")) {
|
if (id.equalsIgnoreCase("Sign")) {
|
||||||
// Delay so chunks can finish sending
|
// Delay so chunks can finish sending
|
||||||
session.getConnector().getGeneralThreadPool().schedule(() ->
|
session.getConnector().getGeneralThreadPool().schedule(() ->
|
||||||
BlockEntityUtils.updateBlockEntity(session, translator.getBlockEntityTag(packet.getNbt()), packet.getPosition()),
|
BlockEntityUtils.updateBlockEntity(session, translator.getBlockEntityTag("Sign", packet.getNbt()), packet.getPosition()),
|
||||||
5,
|
5,
|
||||||
TimeUnit.SECONDS
|
TimeUnit.SECONDS
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
BlockEntityUtils.updateBlockEntity(session, translator.getBlockEntityTag(packet.getNbt()), packet.getPosition());
|
BlockEntityUtils.updateBlockEntity(session, translator.getBlockEntityTag(id, packet.getNbt()), packet.getPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ public class ChunkUtils {
|
|||||||
|
|
||||||
String id = BlockEntityUtils.getBedrockBlockEntityId(tagName);
|
String id = BlockEntityUtils.getBedrockBlockEntityId(tagName);
|
||||||
BlockEntityTranslator blockEntityTranslator = BlockEntityUtils.getBlockEntityTranslator(id);
|
BlockEntityTranslator blockEntityTranslator = BlockEntityUtils.getBlockEntityTranslator(id);
|
||||||
bedrockBlockEntities[i] = blockEntityTranslator.getBlockEntityTag(tag);
|
bedrockBlockEntities[i] = blockEntityTranslator.getBlockEntityTag(tagName, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
chunkData.blockEntities = bedrockBlockEntities;
|
chunkData.blockEntities = bedrockBlockEntities;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren