package bscv.module; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.DoubleArgumentType; import com.mojang.brigadier.arguments.IntegerArgumentType; import bscv.tools.Anchor; import net.minecraft.command.CommandSource; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.server.command.EnumArgument; public abstract class HudModule extends Module { public final ForgeConfigSpec.ConfigValue x; public final ForgeConfigSpec.ConfigValue y; public final ForgeConfigSpec.ConfigValue scale; public final ForgeConfigSpec.EnumValue anchor; protected HudModule(String name, ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { super(name, Group.HUD, builder, dispatcher); this.x = this.option( "x", "horizontal offset", 0, IntegerArgumentType.integer(0), Integer.class, builder, dispatcher ); this.y = this.option( "y", "vertical offset", 0, IntegerArgumentType.integer(0), Integer.class, builder, dispatcher ); this.scale = this.option( "scale", "scale of element", 1.0, DoubleArgumentType.doubleArg(0.0), Double.class, builder, dispatcher ); this.anchor = this.optionEnum( "anchor", "origin point for coordinates", Anchor.TOPLEFT, EnumArgument.enumArgument(Anchor.class), Anchor.class, builder, dispatcher ); } }