This commit is contained in:
parent
77f6aa2778
commit
81eea75d3a
1 changed files with 11 additions and 6 deletions
|
@ -77,16 +77,21 @@ public class NoFall extends Feature {
|
|||
}
|
||||
}
|
||||
|
||||
private static final DataParameter<Byte> FLAGS;
|
||||
|
||||
static {
|
||||
try {
|
||||
FLAGS = (DataParameter<Byte>) FieldFinder.findUnmarked(Entity.class, DataParameter.class, 0).get(null);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void onReceive(PacketEvent.Receive event) {
|
||||
if(event.getPacket() instanceof SPacketEntityMetadata) {
|
||||
SPacketEntityMetadata packet = (SPacketEntityMetadata) event.getPacket();
|
||||
if(mode == Mode.Elytra && cancelElytraNT != 0 && packet.getEntityId() == mc.player.getEntityId()) {
|
||||
try {
|
||||
DataParameter<Byte> FLAGS = (DataParameter<Byte>) FieldFinder.findUnmarked(Entity.class, DataParameter.class, 0).get(null);
|
||||
packet.getDataManagerEntries().removeIf(x -> x.getKey().equals(FLAGS)); // remove FallFlying tag
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
packet.getDataManagerEntries().removeIf(x -> x.getKey().equals(FLAGS)); // remove FallFlying tag to stop elytra from starting clientside
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue