3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-26 16:12:43 +01:00

Properly fix recipe book from 1.14.3

Dieser Commit ist enthalten in:
KennyTV 2019-06-25 12:34:01 +02:00
Ursprung 167b715048
Commit 21bd518f45

Datei anzeigen

@ -52,12 +52,19 @@ public class Protocol1_14_2To1_14_3 extends BackwardsProtocol {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
int size = wrapper.passthrough(Type.VAR_INT);
int deleted = 0;
for (int i = 0; i < size; i++) {
String fullType = wrapper.read(Type.STRING);
String type = fullType.replace("minecraft:", "");
String id = wrapper.read(Type.STRING); // id
if (type.equals("crafting_special_repairitem")) continue; // New type
if (type.equals("crafting_special_repairitem")) {
deleted++;
continue;
}
wrapper.write(Type.STRING, fullType);
wrapper.write(Type.STRING, id);
if (type.equals("crafting_shapeless")) {
wrapper.passthrough(Type.STRING); // Group
@ -92,11 +99,9 @@ public class Protocol1_14_2To1_14_3 extends BackwardsProtocol {
wrapper.passthrough(Type.FLOAT); // EXP
wrapper.passthrough(Type.VAR_INT); // Cooking time
}
wrapper.write(Type.STRING, fullType);
wrapper.write(Type.STRING, id);
}
wrapper.cancel();
wrapper.set(Type.VAR_INT, 0, size - deleted);
}
});
}