transfer baritonewalk specific settings to Baritone module

This commit is contained in:
Dewy REDACTED 2020-04-22 14:05:05 +01:00
parent a6fcf61a35
commit 673e9b7dae
No known key found for this signature in database
GPG Key ID: 0CAA84A783228505
2 changed files with 2 additions and 21 deletions

View File

@ -16,6 +16,8 @@ public class Baritone extends Module {
public Setting<Boolean> allowSprint = register(Settings.b("Allow Sprint", true));
public Setting<Boolean> allowPlace = register(Settings.b("Allow Place", true));
public Setting<Boolean> allowInventory = register(Settings.b("Allow Inventory", true));
public Setting<Boolean> freeLook = register(Settings.b("Free Look", true));
public Setting<Boolean> allowDownwardTunneling = register(Settings.b("Downward Tunneling", true));
public Setting<Boolean> allowParkour = register(Settings.b("Allow Parkour", true));
public Setting<Boolean> allowParkourPlace = register(Settings.b("Allow Parkour Place", true));

View File

@ -17,11 +17,6 @@ import static me.zeroeightsix.kami.util.MathsUtils.normalizeAngle;
*/
@Module.Info(name = "BaritoneWalk", description = "AutoWalk with Baritone pathfinding.", category = Module.Category.MOVEMENT)
public class BaritoneWalk extends Module {
private Setting<Boolean> sprint = register(Settings.booleanBuilder("Allow Sprinting").withValue(true).build());
private Setting<Boolean> parkour = register(Settings.booleanBuilder("Allow Parkour").withValue(true).withVisibility(v -> sprint.getValue().equals(true)).build());
private Setting<Boolean> lockView = register(Settings.booleanBuilder("Lock View").withValue(false).build());
private Setting<Boolean> tunnelingDownwards = register(Settings.booleanBuilder("Tunneling Downwards").withValue(false).build());
private String direction;
// Very shittily done, but this check is not that taxing on performance cos it is NOT performed every tick.
@ -62,17 +57,6 @@ public class BaritoneWalk extends Module {
}
}
@Override
public void onUpdate() {
BaritoneAPI.getSettings().allowSprint.value = sprint.getValue();
BaritoneAPI.getSettings().freeLook.value = !lockView.getValue();
BaritoneAPI.getSettings().allowDownward.value = tunnelingDownwards.getValue();
if (sprint.getValue()) {
BaritoneAPI.getSettings().allowParkour.value = parkour.getValue();
}
}
@Override
public String getHudInfo() {
return direction;
@ -81,11 +65,6 @@ public class BaritoneWalk extends Module {
@Override
protected void onDisable() {
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything();
BaritoneAPI.getSettings().freeLook.reset();
BaritoneAPI.getSettings().allowParkour.reset();
BaritoneAPI.getSettings().allowSprint.reset();
BaritoneAPI.getSettings().allowDownward.reset();
}
@EventHandler