mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-23 02:25:19 +01:00
Fix use-new-effect-indicator option for 1.13+ clients (#3127)
This commit is contained in:
parent
10efba31cf
commit
955b76f599
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.protocols.protocol1_13to1_12_2.packets;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_13Types;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
|
||||
@ -146,6 +147,25 @@ public class EntityPackets {
|
||||
}
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_12_1.ENTITY_EFFECT, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // Entity id
|
||||
map(Type.BYTE); // Effect id
|
||||
map(Type.BYTE); // Amplifier
|
||||
map(Type.VAR_INT); // Duration
|
||||
|
||||
handler(packetWrapper -> {
|
||||
byte flags = packetWrapper.read(Type.BYTE); // Input Flags
|
||||
|
||||
if (Via.getConfig().isNewEffectIndicator())
|
||||
flags |= 0x04;
|
||||
|
||||
packetWrapper.write(Type.BYTE, flags);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
metadataRewriter.registerRemoveEntities(ClientboundPackets1_12_1.DESTROY_ENTITIES);
|
||||
metadataRewriter.registerMetadataRewriter(ClientboundPackets1_12_1.ENTITY_METADATA, Types1_12.METADATA_LIST, Types1_13.METADATA_LIST);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user