chore: delegated default group and name to AbstractModule
This commit is contained in:
parent
e3af53002f
commit
e82f1cc5e6
17 changed files with 11 additions and 141 deletions
|
@ -25,6 +25,17 @@ public abstract class AbstractModule implements IModule<AbstractModule.Group> {
|
|||
|
||||
protected ForgeConfigSpec.ConfigValue<Boolean> enabled;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
String[] pkg = this.getClass().getPackage().getName().split("\\.");
|
||||
return Group.valueOf(pkg[pkg.length - 1].toUpperCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeConfigSpec.Builder getConfigBuilder() {
|
||||
return BoSCoVicino.modManager.getCfgBuilder();
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package ftbsc.bscv.modules.defense;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import ftbsc.bscv.ICommons;
|
||||
import ftbsc.bscv.modules.QuickModule;
|
||||
import ftbsc.bscv.tools.Setting;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
|
@ -15,16 +12,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class Aura extends QuickModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Aura";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.DEFENSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultKey() {
|
||||
return UNBOUND;
|
||||
|
|
|
@ -11,12 +11,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
import static ftbsc.bscv.tools.Text.TextBuilder;
|
||||
|
||||
public class ActiveModules extends HudModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "ActiveModules";
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderOverlay(RenderGameOverlayEvent event) {
|
||||
if (event.getType() == ElementType.TEXT) {
|
||||
|
|
|
@ -14,12 +14,6 @@ import ftbsc.bscv.ICommons;
|
|||
import ftbsc.bscv.modules.HudModule;
|
||||
|
||||
public class Coordinates extends HudModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Coordinates";
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderOverlay(RenderGameOverlayEvent event) {
|
||||
if (event.getType() == ElementType.TEXT && MC.player != null) {
|
||||
|
|
|
@ -24,11 +24,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class EntityList extends HudModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "EntityList";
|
||||
}
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<String> search;
|
||||
|
||||
public EntityList() {
|
||||
|
|
|
@ -23,11 +23,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class InfoDisplay extends HudModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "InfoDisplay";
|
||||
}
|
||||
|
||||
private Vector3d last_position = new Vector3d(0.0, 0.0, 0.0);
|
||||
private double instant_speed = 0.0;
|
||||
private double average_speed = 0.0;
|
||||
|
|
|
@ -15,10 +15,6 @@ import net.minecraftforge.common.ForgeConfigSpec;
|
|||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
public class PlayerList extends HudModule implements ICommons {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "PlayerList";
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderOverlay(RenderGameOverlayEvent event) {
|
||||
|
|
|
@ -16,16 +16,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class BoatFly extends AbstractModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "BoatFly";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.MOTION;
|
||||
}
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<Double> speed;
|
||||
public final ForgeConfigSpec.ConfigValue<Double> rise;
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> gravity;
|
||||
|
|
|
@ -16,15 +16,6 @@ import net.minecraftforge.event.TickEvent.Phase;
|
|||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
public class VanillaFlight extends QuickModule implements ICommons {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "VanillaFlight";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.MOTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultKey() {
|
||||
|
|
|
@ -11,15 +11,6 @@ import net.minecraftforge.common.ForgeConfigSpec;
|
|||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
public class AntiHunger extends AbstractModule implements ICommons {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AntiHunger";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.SELF;
|
||||
}
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> sprint;
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> hover;
|
||||
|
|
|
@ -15,16 +15,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class AutoDisconnect extends AbstractModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AutoDisconnect";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.SELF;
|
||||
}
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<Double> threshold;
|
||||
|
||||
public AutoDisconnect() {
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
package ftbsc.bscv.modules.self;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import ftbsc.bscv.ICommons;
|
||||
import ftbsc.bscv.events.PacketEvent;
|
||||
import ftbsc.bscv.modules.AbstractModule;
|
||||
import ftbsc.bscv.tools.Setting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.network.play.server.SPlaySoundEffectPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
|
@ -16,16 +13,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class AutoFish extends AbstractModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AutoFish";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.SELF;
|
||||
}
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> recast;
|
||||
public final ForgeConfigSpec.ConfigValue<Integer> delay;
|
||||
// public final ForgeConfigSpec.ConfigValue<Long> reaction;
|
||||
|
|
|
@ -16,16 +16,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class AutoTool extends AbstractModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AutoTool";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractModule.Group getGroup() {
|
||||
return AbstractModule.Group.SELF;
|
||||
}
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<Integer> limit;
|
||||
|
||||
public AutoTool() {
|
||||
|
|
|
@ -15,16 +15,6 @@ import ftbsc.bscv.modules.QuickModule;
|
|||
import ftbsc.bscv.ICommons;
|
||||
|
||||
public class FastInteract extends QuickModule implements ICommons {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "FastInteract";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.SELF;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultKey() {
|
||||
return UNBOUND;
|
||||
|
|
|
@ -29,16 +29,6 @@ public class Freecam extends QuickModule implements ICommons {
|
|||
private GameType prev_gamemode = GameType.SURVIVAL;
|
||||
private MockPlayer mock_player;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Freecam";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.SELF;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultKey() {
|
||||
return UNBOUND;
|
||||
|
|
|
@ -7,16 +7,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
|
||||
public class PortalGui extends AbstractModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "PortalGui";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.SELF;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(TickEvent.ClientTickEvent event) {
|
||||
if (MC.player == null) return;
|
||||
|
|
|
@ -10,17 +10,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
import java.awt.event.KeyEvent;
|
||||
|
||||
public class Fullbright extends QuickModule implements ICommons {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Fullbright";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getGroup() {
|
||||
return Group.VISION;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultKey() {
|
||||
return KeyEvent.VK_V;
|
||||
|
|
Loading…
Reference in a new issue