fix tick and enable modules on world load
This commit is contained in:
parent
8fc80a75b8
commit
430ff443a6
3 changed files with 30 additions and 6 deletions
|
@ -45,11 +45,6 @@ public class Moonlight implements ModInitializer
|
||||||
for (Module m : ModuleManager.INSTANCE.modules)
|
for (Module m : ModuleManager.INSTANCE.modules)
|
||||||
{
|
{
|
||||||
m.enabled = (boolean)((Map<String, Object>)((Map<String, Object>)CONFIG.config.get("modules")).get(m.name)).get("enabled");
|
m.enabled = (boolean)((Map<String, Object>)((Map<String, Object>)CONFIG.config.get("modules")).get(m.name)).get("enabled");
|
||||||
if (m.enabled)
|
|
||||||
{
|
|
||||||
//m.onEnable();
|
|
||||||
// this doesnt work, will probably need to mixin to client server connection or something
|
|
||||||
}
|
|
||||||
for (Setting s : m.settings)
|
for (Setting s : m.settings)
|
||||||
{
|
{
|
||||||
if (s instanceof BooleanSetting)
|
if (s instanceof BooleanSetting)
|
||||||
|
|
|
@ -5,6 +5,8 @@ import me.kawaiizenbo.moonlight.module.Module;
|
||||||
import me.kawaiizenbo.moonlight.module.settings.BooleanSetting;
|
import me.kawaiizenbo.moonlight.module.settings.BooleanSetting;
|
||||||
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
|
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
|
||||||
import me.kawaiizenbo.moonlight.module.settings.StringSetting;
|
import me.kawaiizenbo.moonlight.module.settings.StringSetting;
|
||||||
|
import net.minecraft.entity.MovementType;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
public class TestModule extends Module
|
public class TestModule extends Module
|
||||||
{
|
{
|
||||||
|
@ -17,4 +19,30 @@ public class TestModule extends Module
|
||||||
super("Test Module", "Used for testing module features.", Category.WORLD);
|
super("Test Module", "Used for testing module features.", Category.WORLD);
|
||||||
addSettings(bs, ds, ss);
|
addSettings(bs, ds, ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable()
|
||||||
|
{
|
||||||
|
super.onEnable();
|
||||||
|
System.out.println("Test Module Enabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable()
|
||||||
|
{
|
||||||
|
super.onDisable();
|
||||||
|
System.out.println("Test Module Disabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMotion(MovementType type, Vec3d movement)
|
||||||
|
{
|
||||||
|
System.out.println("Test Module motion");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
System.out.println("Test Module Tick");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
"ClientConnectionMixin",
|
"ClientConnectionMixin",
|
||||||
"KeyboardMixin",
|
"KeyboardMixin",
|
||||||
"SimpleOptionMixin",
|
"SimpleOptionMixin",
|
||||||
"MinecraftClientMixin"
|
"MinecraftClientMixin",
|
||||||
|
"ClientPlayerEntityMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue