mirror of https://github.com/kami-blue/client
make antihunger compatible with elytraflight
This commit is contained in:
parent
82574ecaf7
commit
5cc3019fc9
|
@ -2,6 +2,7 @@ package me.zeroeightsix.kami.module.modules.movement;
|
|||
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
|
@ -9,6 +10,7 @@ import me.zeroeightsix.kami.setting.Settings;
|
|||
import net.minecraft.network.play.client.CPacketEntityAction;
|
||||
import net.minecraft.network.play.client.CPacketPlayer;
|
||||
|
||||
import static me.zeroeightsix.kami.KamiMod.MODULE_MANAGER;
|
||||
import static net.minecraft.network.play.client.CPacketEntityAction.Action.START_SPRINTING;
|
||||
import static net.minecraft.network.play.client.CPacketEntityAction.Action.STOP_SPRINTING;
|
||||
|
||||
|
@ -23,6 +25,10 @@ public class AntiHunger extends Module {
|
|||
|
||||
@EventHandler
|
||||
public Listener<PacketEvent.Send> packetListener = new Listener<>(event -> {
|
||||
if (MODULE_MANAGER.getModule(ElytraFlight.class).isEnabled() && cancelMovementState.getValue()) {
|
||||
Command.sendChatMessage(getChatName() + "ElytraFlight is not compatible with the 'Cancel Movement State' option, disabling");
|
||||
disable();
|
||||
}
|
||||
if (event.getPacket() instanceof CPacketEntityAction) {
|
||||
final CPacketEntityAction packet = (CPacketEntityAction) event.getPacket();
|
||||
if (cancelMovementState.getValue() && (packet.getAction() == START_SPRINTING || packet.getAction() == STOP_SPRINTING)) {
|
||||
|
|
Loading…
Reference in New Issue