mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-02 09:09:55 +01:00
Remove 1.12 flyingspeed attribute
This commit is contained in:
parent
e809c117c4
commit
4680c0f3d2
@ -61,7 +61,6 @@ public class ChangedPacketIds1_12 extends Rewriter<Protocol1_11_1To1_12> {
|
|||||||
|
|
||||||
protocol.cancelOutgoing(State.PLAY, 0x4C); // Advancements
|
protocol.cancelOutgoing(State.PLAY, 0x4C); // Advancements
|
||||||
|
|
||||||
protocol.registerOutgoing(State.PLAY, 0x4D, 0x4A); // Entity Properties
|
|
||||||
protocol.registerOutgoing(State.PLAY, 0x4E, 0x4B); // Entity Effect
|
protocol.registerOutgoing(State.PLAY, 0x4E, 0x4B); // Entity Effect
|
||||||
|
|
||||||
// New incoming packet 0x01 - Prepare Crafting Grid
|
// New incoming packet 0x01 - Prepare Crafting Grid
|
||||||
|
@ -202,6 +202,46 @@ public class EntityPackets1_12 extends EntityRewriter<Protocol1_11_1To1_12> {
|
|||||||
|
|
||||||
// Metadata packet
|
// Metadata packet
|
||||||
registerMetadataRewriter(0x3B, 0x39, Types1_12.METADATA_LIST);
|
registerMetadataRewriter(0x3B, 0x39, Types1_12.METADATA_LIST);
|
||||||
|
|
||||||
|
// Entity Properties
|
||||||
|
protocol.registerOutgoing(State.PLAY, 0x4D, 0x4A, new PacketRemapper() {
|
||||||
|
@Override
|
||||||
|
public void registerMap() {
|
||||||
|
map(Type.VAR_INT);
|
||||||
|
map(Type.INT);
|
||||||
|
handler(wrapper -> {
|
||||||
|
int size = wrapper.get(Type.INT, 0);
|
||||||
|
int newSize = size;
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
String key = wrapper.read(Type.STRING);
|
||||||
|
// Remove new attribute
|
||||||
|
if (key.equals("generic.flyingSpeed")) {
|
||||||
|
newSize--;
|
||||||
|
wrapper.read(Type.DOUBLE);
|
||||||
|
int modSize = wrapper.read(Type.VAR_INT);
|
||||||
|
for (int j = 0; j < modSize; j++) {
|
||||||
|
wrapper.read(Type.UUID);
|
||||||
|
wrapper.read(Type.DOUBLE);
|
||||||
|
wrapper.read(Type.BYTE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wrapper.write(Type.STRING, key);
|
||||||
|
wrapper.passthrough(Type.DOUBLE);
|
||||||
|
int modSize = wrapper.passthrough(Type.VAR_INT);
|
||||||
|
for (int j = 0; j < modSize; j++) {
|
||||||
|
wrapper.passthrough(Type.UUID);
|
||||||
|
wrapper.passthrough(Type.DOUBLE);
|
||||||
|
wrapper.passthrough(Type.BYTE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newSize != size) {
|
||||||
|
wrapper.set(Type.INT, 0, newSize);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -234,10 +234,11 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
|
|||||||
if (entityType != Entity1_15Types.EntityType.BEE) return;
|
if (entityType != Entity1_15Types.EntityType.BEE) return;
|
||||||
|
|
||||||
int size = wrapper.get(Type.INT, 0);
|
int size = wrapper.get(Type.INT, 0);
|
||||||
|
int newSize = size;
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
String key = wrapper.read(Type.STRING);
|
String key = wrapper.read(Type.STRING);
|
||||||
if (key.equals("generic.flyingSpeed")) {
|
if (key.equals("generic.flyingSpeed")) {
|
||||||
size--;
|
newSize--;
|
||||||
wrapper.read(Type.DOUBLE);
|
wrapper.read(Type.DOUBLE);
|
||||||
int modSize = wrapper.read(Type.VAR_INT);
|
int modSize = wrapper.read(Type.VAR_INT);
|
||||||
for (int j = 0; j < modSize; j++) {
|
for (int j = 0; j < modSize; j++) {
|
||||||
@ -256,7 +257,10 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wrapper.set(Type.INT, 0, size);
|
|
||||||
|
if (newSize != size) {
|
||||||
|
wrapper.set(Type.INT, 0, newSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user