Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-09-07 21:32:52 +02:00
Remove 1.12 flyingspeed attribute
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren