3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 13:52:50 +02:00

Fix heightmap file, hotfix enchantment rewriting without mappings

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-03-05 09:32:56 +01:00
Ursprung c765f20558
Commit b3825e637e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -291,9 +291,13 @@ public abstract class ItemRewriter<C extends ClientboundPacketType, S extends Se
public void register() {
map(Type.UNSIGNED_BYTE); // Container id
handler(wrapper -> {
Mappings mappings = protocol.getMappingData().getEnchantmentMappings();
if (mappings == null) {
return;
}
short property = wrapper.passthrough(Type.SHORT);
if (property >= 4 && property <= 6) { // Enchantment id
Mappings mappings = protocol.getMappingData().getEnchantmentMappings();
short enchantmentId = (short) mappings.getNewId(wrapper.read(Type.SHORT));
wrapper.write(Type.SHORT, enchantmentId);
}