forked from RepoMirrors/kami-blue
make offhandgap way safer
This commit is contained in:
parent
3daf3dcb56
commit
a344f516a8
|
@ -34,14 +34,14 @@ public class OffhandGap extends Module {
|
|||
|
||||
int gaps = -1;
|
||||
boolean autoTotemWasEnabled = false;
|
||||
boolean notCancelled = false;
|
||||
boolean cancelled = false;
|
||||
Item usedItem;
|
||||
Item toUseItem;
|
||||
|
||||
@EventHandler
|
||||
private Listener<PacketEvent.Send> sendListener = new Listener<>(e ->{
|
||||
if (e.getPacket() instanceof CPacketPlayerTryUseItem) {
|
||||
if (mc.player.getHealth() + mc.player.getAbsorptionAmount() <= disableHealth.getValue()) {
|
||||
if (cancelled) {
|
||||
disableGaps();
|
||||
return;
|
||||
}
|
||||
|
@ -77,9 +77,14 @@ public class OffhandGap extends Module {
|
|||
public void onUpdate() {
|
||||
if (mc.player == null) return;
|
||||
/* If your health doesn't meet the cutoff then set it to true */
|
||||
notCancelled = mc.player.getHealth() + mc.player.getAbsorptionAmount() <= disableHealth.getValue();
|
||||
cancelled = mc.player.getHealth() + mc.player.getAbsorptionAmount() <= disableHealth.getValue();
|
||||
toUseItem = Items.GOLDEN_APPLE;
|
||||
|
||||
if (cancelled) {
|
||||
disableGaps();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mc.player.getHeldItemOffhand().getItem() != Items.GOLDEN_APPLE) {
|
||||
for (int i = 0; i < 45; i++) {
|
||||
if (mc.player.inventory.getStackInSlot(i).getItem() == Items.GOLDEN_APPLE) {
|
||||
|
|
Loading…
Reference in New Issue