fix particle rewrites

This commit is contained in:
Marco Neuhaus 2019-05-22 23:53:05 +02:00
parent a29e88f535
commit b466ed9eb8
2 changed files with 12 additions and 10 deletions

View File

@ -511,12 +511,14 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
@Override
public void handle(PacketWrapper wrapper) throws Exception {
int id = wrapper.get(Type.INT, 0);
id = EntityPackets1_14.getOldParticleId(id);
if (id == 3 || id == 20) {
int data = wrapper.passthrough(Type.VAR_INT);
wrapper.set(Type.VAR_INT, 0, Protocol1_14To1_13_2.getNewBlockStateId(data));
} else if (id == 27) {
handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM));
}
wrapper.set(Type.INT, 0, id);
}
});
}

View File

@ -543,20 +543,20 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
}
public static int getOldParticleId(int id) {
if (id >= 12) {
id -= 2; // new lava drips 10, 11
}
if (id >= 14) {
id -= 1; // new water drip 11 -> 13
}
if (id >= 28) {
id -= 1; // new 24 -> 27
if (id >= 45) {
id -= 1; // new 39 -> 44
}
if (id >= 30) {
id -= 1; // skip new short happy villager
}
if (id >= 45) {
id -= 1; // new 39 -> 44
if (id >= 28) {
id -= 1; // new 24 -> 27
}
if (id >= 14) {
id -= 1; // new water drip 11 -> 13
}
if (id >= 12) {
id -= 2; // new lava drips 10, 11
}
return id;
}