3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-17 13:30:14 +01:00

Fix double register

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-08-10 17:06:49 +10:00
Ursprung 406733b13a
Commit f4cc9d4730

Datei anzeigen

@ -43,15 +43,6 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter<Clientbound
registerMetadataRewriter(ClientboundPackets1_20_2.ENTITY_METADATA, Types1_20_2.METADATA_LIST, Types1_20.METADATA_LIST);
registerRemoveEntities(ClientboundPackets1_20_2.REMOVE_ENTITIES);
protocol.registerClientbound(ClientboundPackets1_20_2.REMOVE_ENTITY_EFFECT, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Entity id
wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id
});
protocol.registerClientbound(ClientboundPackets1_20_2.ENTITY_EFFECT, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Entity id
wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id
});
protocol.registerClientbound(ClientboundPackets1_20_2.JOIN_GAME, new PacketHandlers() {
@Override
public void register() {
@ -123,7 +114,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter<Clientbound
protocol.registerClientbound(ClientboundPackets1_20_2.ENTITY_EFFECT, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Entity id
wrapper.passthrough(Type.VAR_INT); // Effect id
wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id
wrapper.passthrough(Type.BYTE); // Amplifier
wrapper.passthrough(Type.VAR_INT); // Duration
wrapper.passthrough(Type.BYTE); // Flags
@ -131,6 +122,11 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter<Clientbound
wrapper.write(Type.NBT, wrapper.read(Type.NAMELESS_NBT)); // Factor data
}
});
protocol.registerClientbound(ClientboundPackets1_20_2.REMOVE_ENTITY_EFFECT, wrapper -> {
wrapper.passthrough(Type.VAR_INT); // Entity id
wrapper.write(Type.VAR_INT, wrapper.read(Type.VAR_INT) + 1); // Effect id
});
}
@Override