Version push
This commit is contained in:
parent
3836a56a10
commit
b548e77eac
5 changed files with 33 additions and 27 deletions
|
@ -1,4 +1,4 @@
|
||||||
minecraft.version=1.10.2
|
minecraft.version=1.10.2
|
||||||
forge.version=1.10.2-12.18.0.2005-1.10.0
|
forge.version=1.10.2-12.18.0.2005-1.10.0
|
||||||
|
|
||||||
mod.version=2.0.0
|
mod.version=2.0.1
|
|
@ -2,8 +2,9 @@ package modtweaker;
|
||||||
|
|
||||||
public class ModProps {
|
public class ModProps {
|
||||||
|
|
||||||
public static final String NAME = "Mod Tweaker", name = NAME;
|
public static final String NAME = "Mod Tweaker", name = NAME;
|
||||||
public static final String MODID = "modtweaker", modid = MODID;
|
public static final String MODID = "modtweaker", modid = MODID;
|
||||||
public static final String VERSION = "@modVersion@", version = VERSION;
|
public static final String VERSION = "@modVersion@", version = VERSION;
|
||||||
public static final String DEPENDENCIES = "required-after:MineTweaker3;", dependencies = DEPENDENCIES;
|
public static final String DEPENDENCIES = "required-after:MineTweaker3;", dependencies = DEPENDENCIES;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,12 @@ public class ModTweaker {
|
||||||
logger.info("Starting PreInitialization for " + ModProps.modid);
|
logger.info("Starting PreInitialization for " + ModProps.modid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void init(FMLInitializationEvent event) {
|
public void init(FMLInitializationEvent event) {
|
||||||
logger.info("Starting Initialization for " + ModProps.modid);
|
logger.info("Starting Initialization for " + ModProps.modid);
|
||||||
TweakerPlugin.register("forestry", Forestry.class);
|
TweakerPlugin.register("forestry", true, Forestry.class);
|
||||||
TweakerPlugin.register("tconstruct", TConstruct.class);
|
TweakerPlugin.register("tconstruct", true, TConstruct.class);
|
||||||
TweakerPlugin.register("randomthings", RandomThings.class);
|
TweakerPlugin.register("randomthings", true, RandomThings.class);
|
||||||
|
|
||||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||||
MinecraftForge.EVENT_BUS.register(new ClientEvents());
|
MinecraftForge.EVENT_BUS.register(new ClientEvents());
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
package modtweaker.mods.forestry;
|
package modtweaker.mods.forestry;
|
||||||
|
|
||||||
import minetweaker.MineTweakerAPI;
|
import minetweaker.MineTweakerAPI;
|
||||||
import modtweaker.mods.forestry.handlers.Carpenter;
|
import modtweaker.mods.forestry.handlers.*;
|
||||||
import modtweaker.mods.forestry.handlers.Centrifuge;
|
|
||||||
import modtweaker.mods.forestry.handlers.Fermenter;
|
|
||||||
import modtweaker.mods.forestry.handlers.Moistener;
|
|
||||||
import modtweaker.mods.forestry.handlers.Squeezer;
|
|
||||||
import modtweaker.mods.forestry.handlers.Still;
|
|
||||||
import modtweaker.mods.forestry.handlers.ThermionicFabricator;
|
|
||||||
|
|
||||||
public class Forestry {
|
public class Forestry {
|
||||||
public Forestry() {
|
public Forestry() {
|
||||||
|
|
|
@ -1,29 +1,41 @@
|
||||||
package modtweaker.utils;
|
package modtweaker.utils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
|
|
||||||
public class TweakerPlugin {
|
import java.util.Map;
|
||||||
private static ArrayList<String> isLoaded = new ArrayList<String>();
|
import java.util.TreeMap;
|
||||||
|
|
||||||
public static void register(String mod, Class<?> clazz) {
|
public class TweakerPlugin {
|
||||||
|
private static Map<String, Boolean> mods = new TreeMap<String, Boolean>();
|
||||||
|
|
||||||
|
public static void register(String mod, Boolean enabled, Class<?> clazz) {
|
||||||
if (Loader.isModLoaded(mod)) {
|
if (Loader.isModLoaded(mod)) {
|
||||||
load(mod, clazz);
|
load(mod, enabled, clazz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void load(String mod, Class<?> clazz) {
|
public static void load(String mod, boolean enabled, Class<?> clazz) {
|
||||||
try {
|
try {
|
||||||
clazz.newInstance();
|
clazz.newInstance();
|
||||||
isLoaded.add(mod);
|
mods.put(mod, enabled);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
isLoaded.remove(mod);
|
mods.remove(mod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isLoaded(String string) {
|
public static boolean isLoaded(String string) {
|
||||||
return isLoaded.contains(string);
|
return mods.containsKey(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(String mod, boolean state) {
|
||||||
|
mods.put(mod, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getState(String mod) {
|
||||||
|
return mods.get(mod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, Boolean> getMods() {
|
||||||
|
return mods;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue