mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-23 12:25:24 +01:00
parent
3bda6dd503
commit
71d5aab1b0
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user