Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-27 08:30:10 +01:00
Ursprung
3bda6dd503
Commit
71d5aab1b0
@ -211,10 +211,12 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
|
|||||||
|
|
||||||
|
|
||||||
public static int getNewBlockId(int id) {
|
public static int getNewBlockId(int id) {
|
||||||
|
if (id == 669) return -1; // Bell
|
||||||
|
|
||||||
int newId = BackwardsMappings.blockMappings.getNewId(id);
|
int newId = BackwardsMappings.blockMappings.getNewId(id);
|
||||||
if (newId == -1) {
|
if (newId == -1) {
|
||||||
ViaBackwards.getPlatform().getLogger().warning("Missing 1.13.2 block id for 1.14 block " + id);
|
ViaBackwards.getPlatform().getLogger().warning("Missing 1.13.2 block id for 1.14 block " + id);
|
||||||
return id;
|
return -1;
|
||||||
}
|
}
|
||||||
return newId;
|
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 id
|
||||||
map(Type.UNSIGNED_BYTE); // Action param
|
map(Type.UNSIGNED_BYTE); // Action param
|
||||||
map(Type.VAR_INT); // Block id - /!\ NOT BLOCK STATE
|
map(Type.VAR_INT); // Block id - /!\ NOT BLOCK STATE
|
||||||
handler(new PacketHandler() {
|
handler(wrapper -> {
|
||||||
@Override
|
int mappedId = Protocol1_13_2To1_14.getNewBlockId(wrapper.get(Type.VAR_INT, 0));
|
||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
if (mappedId == -1) {
|
||||||
wrapper.set(Type.VAR_INT, 0, Protocol1_13_2To1_14.getNewBlockId(wrapper.get(Type.VAR_INT, 0)));
|
wrapper.cancel();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
wrapper.set(Type.VAR_INT, 0, mappedId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren