Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Fix heightmap file, hotfix enchantment rewriting without mappings
Dieser Commit ist enthalten in:
Ursprung
c765f20558
Commit
b3825e637e
@ -291,9 +291,13 @@ public abstract class ItemRewriter<C extends ClientboundPacketType, S extends Se
|
|||||||
public void register() {
|
public void register() {
|
||||||
map(Type.UNSIGNED_BYTE); // Container id
|
map(Type.UNSIGNED_BYTE); // Container id
|
||||||
handler(wrapper -> {
|
handler(wrapper -> {
|
||||||
|
Mappings mappings = protocol.getMappingData().getEnchantmentMappings();
|
||||||
|
if (mappings == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
short property = wrapper.passthrough(Type.SHORT);
|
short property = wrapper.passthrough(Type.SHORT);
|
||||||
if (property >= 4 && property <= 6) { // Enchantment id
|
if (property >= 4 && property <= 6) { // Enchantment id
|
||||||
Mappings mappings = protocol.getMappingData().getEnchantmentMappings();
|
|
||||||
short enchantmentId = (short) mappings.getNewId(wrapper.read(Type.SHORT));
|
short enchantmentId = (short) mappings.getNewId(wrapper.read(Type.SHORT));
|
||||||
wrapper.write(Type.SHORT, enchantmentId);
|
wrapper.write(Type.SHORT, enchantmentId);
|
||||||
}
|
}
|
||||||
|
Binäre Datei nicht angezeigt.
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren