3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-07-28 09:58:04 +02:00

Cancel 1.14 bell block action

Fixes #209
Dieser Commit ist enthalten in:
KennyTV 2020-06-08 18:01:40 +02:00
Ursprung 3bda6dd503
Commit 71d5aab1b0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 9 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -211,10 +211,12 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
public static int getNewBlockId(int id) {
if (id == 669) return -1; // Bell
int newId = BackwardsMappings.blockMappings.getNewId(id);
if (newId == -1) {
ViaBackwards.getPlatform().getLogger().warning("Missing 1.13.2 block id for 1.14 block " + id);
return id;
return -1;
}
return newId;
}

Datei anzeigen

@ -354,11 +354,13 @@ public class BlockItemPackets1_14 extends nl.matsv.viabackwards.api.rewriters.It
map(Type.UNSIGNED_BYTE); // Action id
map(Type.UNSIGNED_BYTE); // Action param
map(Type.VAR_INT); // Block id - /!\ NOT BLOCK STATE
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
wrapper.set(Type.VAR_INT, 0, Protocol1_13_2To1_14.getNewBlockId(wrapper.get(Type.VAR_INT, 0)));
handler(wrapper -> {
int mappedId = Protocol1_13_2To1_14.getNewBlockId(wrapper.get(Type.VAR_INT, 0));
if (mappedId == -1) {
wrapper.cancel();
return;
}
wrapper.set(Type.VAR_INT, 0, mappedId);
});
}
});