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