Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-24 15:20:19 +01:00
Ursprung
dc9fe10779
Commit
c2ae3df1db
@ -91,21 +91,20 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
|
|||||||
protocol.registerClientbound(ClientboundPackets1_13.COOLDOWN, new PacketRemapper() {
|
protocol.registerClientbound(ClientboundPackets1_13.COOLDOWN, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
handler(new PacketHandler() {
|
handler(wrapper -> {
|
||||||
@Override
|
int itemId = wrapper.read(Type.VAR_INT);
|
||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
int oldId = protocol.getMappingData().getItemMappings().get(itemId);
|
||||||
int itemId = wrapper.read(Type.VAR_INT);
|
if (oldId == -1) {
|
||||||
int oldId = protocol.getMappingData().getItemMappings().get(itemId);
|
wrapper.cancel();
|
||||||
if (oldId != -1) {
|
return;
|
||||||
Optional<String> eggEntityId = SpawnEggRewriter.getEntityId(oldId);
|
|
||||||
if (eggEntityId.isPresent()) {
|
|
||||||
itemId = 383 << 16;
|
|
||||||
} else {
|
|
||||||
itemId = (oldId >> 4) << 16 | oldId & 0xF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wrapper.write(Type.VAR_INT, itemId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SpawnEggRewriter.getEntityId(oldId).isPresent()) {
|
||||||
|
wrapper.write(Type.VAR_INT, 383 << 4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.write(Type.VAR_INT, oldId >> 4);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren