forked from RepoMirrors/kami-blue
autooffhand > autototem
This commit is contained in:
parent
2ea309c4fc
commit
12a84d23d8
|
@ -15,11 +15,11 @@ import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getItems;
|
|||
* Created by 086 on 22/01/2018.
|
||||
* Updated by S-B99 on 25/03/20
|
||||
*/
|
||||
@Module.Info(name = "AutoOffhand", category = Module.Category.COMBAT, description = "Refills your offhand with totems or other items")
|
||||
public class AutoOffhand extends Module {
|
||||
@Module.Info(name = "AutoTotem", category = Module.Category.COMBAT, description = "Refills your offhand with totems or other items")
|
||||
public class AutoTotem extends Module {
|
||||
private Setting<Mode> modeSetting = register(Settings.e("Mode", Mode.REPLACE_OFFHAND));
|
||||
private Setting<Boolean> smartOffhand = register(Settings.booleanBuilder("Custom Item").withValue(false).withVisibility(v -> modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)));
|
||||
private Setting<Double> healthSetting = register(Settings.doubleBuilder("Custom Item Health").withValue(14.0).withVisibility(v -> smartOffhand.getValue() && modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)));
|
||||
private Setting<Boolean> smartOffhand = register(Settings.booleanBuilder("Custom Item").withValue(false).withVisibility(v -> modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)).build());
|
||||
private Setting<Double> healthSetting = register(Settings.doubleBuilder("Custom Item Health").withValue(14.0).withVisibility(v -> smartOffhand.getValue() && modeSetting.getValue().equals(Mode.REPLACE_OFFHAND)).build());
|
||||
private Setting<CustomItem> smartItemSetting = register(Settings.enumBuilder(CustomItem.class).withName("Item").withValue(CustomItem.GAPPLE).withVisibility(v -> smartOffhand.getValue()).build());
|
||||
|
||||
private enum Mode { NEITHER, REPLACE_OFFHAND, INVENTORY;}
|
|
@ -18,9 +18,6 @@ import java.util.Objects;
|
|||
|
||||
import static me.zeroeightsix.kami.module.modules.gui.InfoOverlay.getItems;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author polymer (main listener switch function xd)
|
||||
* @author S-B99 (made epic and smooth and cleaned up code <3) (why did i rewrite this 4 times)
|
||||
|
@ -55,9 +52,9 @@ public class OffhandGap extends Module {
|
|||
return;
|
||||
}
|
||||
if (mc.player.getHeldItemMainhand().getItem() instanceof ItemSword || mc.player.getHeldItemMainhand().getItem() instanceof ItemAxe || passItemCheck()) {
|
||||
if (KamiMod.MODULE_MANAGER.isModuleEnabled(AutoOffhand.class)) {
|
||||
if (KamiMod.MODULE_MANAGER.isModuleEnabled(AutoTotem.class)) {
|
||||
autoTotemWasEnabled = true;
|
||||
KamiMod.MODULE_MANAGER.getModule(AutoOffhand.class).disable();
|
||||
KamiMod.MODULE_MANAGER.getModule(AutoTotem.class).disable();
|
||||
}
|
||||
if (!eatWhileAttacking.getValue()) { /* Save item for later when using preventDesync */
|
||||
usedItem = mc.player.getHeldItemMainhand().getItem();
|
||||
|
@ -138,9 +135,9 @@ public class OffhandGap extends Module {
|
|||
}
|
||||
|
||||
private void disableGaps() {
|
||||
if (autoTotemWasEnabled != KamiMod.MODULE_MANAGER.isModuleEnabled(AutoOffhand.class)) {
|
||||
if (autoTotemWasEnabled != KamiMod.MODULE_MANAGER.isModuleEnabled(AutoTotem.class)) {
|
||||
moveGapsToInventory(gaps);
|
||||
KamiMod.MODULE_MANAGER.getModule(AutoOffhand.class).enable();
|
||||
KamiMod.MODULE_MANAGER.getModule(AutoTotem.class).enable();
|
||||
autoTotemWasEnabled = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue