mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2025-01-04 19:08:43 +01:00
Fix double register
This commit is contained in:
parent
406733b13a
commit
f4cc9d4730
@ -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);
|
registerMetadataRewriter(ClientboundPackets1_20_2.ENTITY_METADATA, Types1_20_2.METADATA_LIST, Types1_20.METADATA_LIST);
|
||||||
registerRemoveEntities(ClientboundPackets1_20_2.REMOVE_ENTITIES);
|
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() {
|
protocol.registerClientbound(ClientboundPackets1_20_2.JOIN_GAME, new PacketHandlers() {
|
||||||
@Override
|
@Override
|
||||||
public void register() {
|
public void register() {
|
||||||
@ -123,7 +114,7 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter<Clientbound
|
|||||||
|
|
||||||
protocol.registerClientbound(ClientboundPackets1_20_2.ENTITY_EFFECT, wrapper -> {
|
protocol.registerClientbound(ClientboundPackets1_20_2.ENTITY_EFFECT, wrapper -> {
|
||||||
wrapper.passthrough(Type.VAR_INT); // Entity id
|
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.BYTE); // Amplifier
|
||||||
wrapper.passthrough(Type.VAR_INT); // Duration
|
wrapper.passthrough(Type.VAR_INT); // Duration
|
||||||
wrapper.passthrough(Type.BYTE); // Flags
|
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
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user