fix: proper namespacing of settings commands
ugly botch because I forgot about this, TODO!
This commit is contained in:
parent
5b14b18d62
commit
acf78a429a
12 changed files with 33 additions and 33 deletions
|
@ -22,25 +22,25 @@ public abstract class HudModule extends Module {
|
||||||
.name("x")
|
.name("x")
|
||||||
.comment("horizontal offset")
|
.comment("horizontal offset")
|
||||||
.fallback(0)
|
.fallback(0)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.y = Setting.Number.builder()
|
this.y = Setting.Number.builder()
|
||||||
.name("y")
|
.name("y")
|
||||||
.comment("vertical offset")
|
.comment("vertical offset")
|
||||||
.fallback(0)
|
.fallback(0)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.scale = Setting.Decimal.builder()
|
this.scale = Setting.Decimal.builder()
|
||||||
.name("scale")
|
.name("scale")
|
||||||
.comment("scale of element")
|
.comment("scale of element")
|
||||||
.fallback(1.0)
|
.fallback(1.0)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.anchor = Setting.Switch.builder(Anchor.class)
|
this.anchor = Setting.Switch.builder(Anchor.class)
|
||||||
.name("anchor")
|
.name("anchor")
|
||||||
.comment("origin point for coordinates")
|
.comment("origin point for coordinates")
|
||||||
.fallback(Anchor.TOPLEFT)
|
.fallback(Anchor.TOPLEFT)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean shouldHide() {
|
protected boolean shouldHide() {
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class Aura extends QuickModule implements ICommons {
|
||||||
.fallback(5.)
|
.fallback(5.)
|
||||||
.name("reach")
|
.name("reach")
|
||||||
.comment("aura attack reach")
|
.comment("aura attack reach")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.strenght = Setting.Decimal.builder()
|
this.strenght = Setting.Decimal.builder()
|
||||||
.min(0.)
|
.min(0.)
|
||||||
|
@ -35,7 +35,7 @@ public class Aura extends QuickModule implements ICommons {
|
||||||
.name("strenght")
|
.name("strenght")
|
||||||
.comment("minimum strenght required for attack")
|
.comment("minimum strenght required for attack")
|
||||||
.fallback(1.)
|
.fallback(1.)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class EntityList extends HudModule implements ICommons {
|
||||||
.name("search")
|
.name("search")
|
||||||
.comment("highlight names containing this text")
|
.comment("highlight names containing this text")
|
||||||
.fallback("")
|
.fallback("")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -51,25 +51,25 @@ public class InfoDisplay extends HudModule implements ICommons {
|
||||||
.name("logo")
|
.name("logo")
|
||||||
.comment("show logo at top of list")
|
.comment("show logo at top of list")
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.speed = Setting.Bool.builder()
|
this.speed = Setting.Bool.builder()
|
||||||
.name("speed")
|
.name("speed")
|
||||||
.comment("show speed meter")
|
.comment("show speed meter")
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.time = Setting.Bool.builder()
|
this.time = Setting.Bool.builder()
|
||||||
.name("time")
|
.name("time")
|
||||||
.comment("show world time")
|
.comment("show world time")
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.hide_effects = Setting.Bool.builder()
|
this.hide_effects = Setting.Bool.builder()
|
||||||
.name("hide-effects")
|
.name("hide-effects")
|
||||||
.comment("hide effect icons on top right corner")
|
.comment("hide effect icons on top right corner")
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -33,38 +33,38 @@ public class BoatFly extends Module implements ICommons {
|
||||||
.fallback(1.)
|
.fallback(1.)
|
||||||
.name("speed")
|
.name("speed")
|
||||||
.comment("magnitude of boat movement")
|
.comment("magnitude of boat movement")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.rise = Setting.Decimal.builder()
|
this.rise = Setting.Decimal.builder()
|
||||||
.min(0.)
|
.min(0.)
|
||||||
.fallback(0.5)
|
.fallback(0.5)
|
||||||
.name("rise")
|
.name("rise")
|
||||||
.comment("vertical speed")
|
.comment("vertical speed")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.gravity = Setting.Bool.builder()
|
this.gravity = Setting.Bool.builder()
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.name("gravity")
|
.name("gravity")
|
||||||
.comment("toggle boat gravity")
|
.comment("toggle boat gravity")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.rotation = Setting.Bool.builder()
|
this.rotation = Setting.Bool.builder()
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.name("rotation")
|
.name("rotation")
|
||||||
.comment("rotate boat with player")
|
.comment("rotate boat with player")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.sprint = Setting.Bool.builder()
|
this.sprint = Setting.Bool.builder()
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.name("sprint")
|
.name("sprint")
|
||||||
.comment("halve boat speed while not sprinting")
|
.comment("halve boat speed while not sprinting")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.drift = Setting.Bool.builder()
|
this.drift = Setting.Bool.builder()
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.name("drift")
|
.name("drift")
|
||||||
.comment("allow boat drifting")
|
.comment("allow boat drifting")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -32,27 +32,27 @@ public class VanillaFlight extends QuickModule implements ICommons {
|
||||||
.name("force")
|
.name("force")
|
||||||
.comment("force enable flight on user")
|
.comment("force enable flight on user")
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.speed = Setting.Decimal.builder()
|
this.speed = Setting.Decimal.builder()
|
||||||
.min(0.)
|
.min(0.)
|
||||||
.fallback(0.05)
|
.fallback(0.05)
|
||||||
.name("speed")
|
.name("speed")
|
||||||
.comment("flight speed to set")
|
.comment("flight speed to set")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.antikick = Setting.Bool.builder()
|
this.antikick = Setting.Bool.builder()
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.name("antikick")
|
.name("antikick")
|
||||||
.comment("prevent vanilla flight kick by descending")
|
.comment("prevent vanilla flight kick by descending")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.antikick_magnitude = Setting.Decimal.builder()
|
this.antikick_magnitude = Setting.Decimal.builder()
|
||||||
.min(0.)
|
.min(0.)
|
||||||
.fallback(1.)
|
.fallback(1.)
|
||||||
.name("magnitude")
|
.name("magnitude")
|
||||||
.comment("magnitude of antikick push")
|
.comment("magnitude of antikick push")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.antikick_cycle = Setting.Number.builder()
|
this.antikick_cycle = Setting.Number.builder()
|
||||||
.min(0)
|
.min(0)
|
||||||
|
@ -60,7 +60,7 @@ public class VanillaFlight extends QuickModule implements ICommons {
|
||||||
.fallback(0)
|
.fallback(0)
|
||||||
.name("cycle")
|
.name("cycle")
|
||||||
.comment("how often to run antikick routine")
|
.comment("how often to run antikick routine")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean couldFlyBefore = false;
|
private boolean couldFlyBefore = false;
|
||||||
|
|
|
@ -25,13 +25,13 @@ public class AntiHunger extends Module implements ICommons {
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.name("sprint")
|
.name("sprint")
|
||||||
.comment("mask sprint toggle packets")
|
.comment("mask sprint toggle packets")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.hover = Setting.Bool.builder()
|
this.hover = Setting.Bool.builder()
|
||||||
.name("hover")
|
.name("hover")
|
||||||
.comment("mark as not on-ground while walking")
|
.comment("mark as not on-ground while walking")
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class AutoDisconnect extends Module implements ICommons {
|
||||||
.fallback(10.)
|
.fallback(10.)
|
||||||
.name("threshold")
|
.name("threshold")
|
||||||
.comment("hp below which connection should be closed")
|
.comment("hp below which connection should be closed")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -27,13 +27,13 @@ public class AutoFish extends Module implements ICommons {
|
||||||
.name("recast")
|
.name("recast")
|
||||||
.comment("automatically recast hook after fishing")
|
.comment("automatically recast hook after fishing")
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.delay = Setting.Number.builder()
|
this.delay = Setting.Number.builder()
|
||||||
.fallback(2500)
|
.fallback(2500)
|
||||||
.name("delay")
|
.name("delay")
|
||||||
.comment("how long in ms to wait before recasting hook")
|
.comment("how long in ms to wait before recasting hook")
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class AutoTool extends Module implements ICommons {
|
||||||
.name("limit")
|
.name("limit")
|
||||||
.comment("durability limit for tools, set to 0 to destroy them")
|
.comment("durability limit for tools, set to 0 to destroy them")
|
||||||
.fallback(1)
|
.fallback(1)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean itemIsTooDamaged(ItemStack item) {
|
private boolean itemIsTooDamaged(ItemStack item) {
|
||||||
|
|
|
@ -36,19 +36,19 @@ public class Freecam extends QuickModule implements ICommons {
|
||||||
.name("log")
|
.name("log")
|
||||||
.comment("log canceled packets")
|
.comment("log canceled packets")
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.speed = Setting.Decimal.builder()
|
this.speed = Setting.Decimal.builder()
|
||||||
.name("speed")
|
.name("speed")
|
||||||
.comment("flight speed in freecam")
|
.comment("flight speed in freecam")
|
||||||
.fallback(0.05)
|
.fallback(0.05)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
|
|
||||||
this.drift = Setting.Bool.builder()
|
this.drift = Setting.Bool.builder()
|
||||||
.name("drift")
|
.name("drift")
|
||||||
.comment("allow inertia drift in freecam")
|
.comment("allow inertia drift in freecam")
|
||||||
.fallback(true)
|
.fallback(true)
|
||||||
.build(builder, dispatcher);
|
.build(this.name, builder, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -50,11 +50,11 @@ public abstract class Setting<T> {
|
||||||
|
|
||||||
abstract Class<T> clazz();
|
abstract Class<T> clazz();
|
||||||
|
|
||||||
public ForgeConfigSpec.ConfigValue<T> build(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) {
|
public ForgeConfigSpec.ConfigValue<T> build(String scope, ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) {
|
||||||
ForgeConfigSpec.ConfigValue<T> conf = this.value(builder);
|
ForgeConfigSpec.ConfigValue<T> conf = this.value(builder);
|
||||||
|
|
||||||
dispatcher.register(
|
dispatcher.register(
|
||||||
Commands.literal(this.name.get().toLowerCase())
|
Commands.literal(scope.toLowerCase())
|
||||||
.then(
|
.then(
|
||||||
Commands.literal(this.name.get())
|
Commands.literal(this.name.get())
|
||||||
.then(
|
.then(
|
||||||
|
|
Loading…
Reference in a new issue