autooffhand > autototem

This commit is contained in:
Bella 2020-03-30 20:07:37 -04:00
parent 2ea309c4fc
commit 12a84d23d8
No known key found for this signature in database
GPG Key ID: 815562EA23BFE344
2 changed files with 8 additions and 11 deletions

View File

@ -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;}

View File

@ -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;
}
}