diff --git a/build.gradle b/build.gradle index c1fc330..73f5799 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. -version = "1.0.1" +version = "1.0.2" group = "shnupbups.tinkersaether" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "tinkersaether" diff --git a/src/main/java/shnupbups/tinkersaether/TinkersAether.java b/src/main/java/shnupbups/tinkersaether/TinkersAether.java index 78915b9..4d72bac 100644 --- a/src/main/java/shnupbups/tinkersaether/TinkersAether.java +++ b/src/main/java/shnupbups/tinkersaether/TinkersAether.java @@ -14,6 +14,7 @@ import net.minecraftforge.fml.common.registry.EntityRegistry; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import shnupbups.tinkersaether.config.TAConfig; import shnupbups.tinkersaether.entities.EntityDart; import shnupbups.tinkersaether.misc.MiscUtils; import shnupbups.tinkersaether.modules.ModuleBase; @@ -25,7 +26,7 @@ public class TinkersAether { public static final String modid = "tinkersaether"; public static final String name = "MoreTiC"; - public static final String version = "1.0.1"; + public static final String version = "1.0.2"; @Mod.Instance(modid) public static TinkersAether instance; @@ -49,11 +50,17 @@ public void preInit(FMLPreInitializationEvent event) { @Mod.EventHandler public void init(FMLInitializationEvent event) { - proxy.initToolGuis(); + logger.info(TAConfig.getConfig()); + + if(TAConfig.darts) { + proxy.initToolGuis(); + } ModuleBase.aether.init(); - MiscUtils.displace(TinkerMaterials.wood.getIdentifier()); // Skyroot needs priority + if(TAConfig.skyroot) { + MiscUtils.displace(TinkerMaterials.wood.getIdentifier()); // Skyroot needs priority + } } @Mod.EventHandler @@ -63,7 +70,9 @@ public void postInit(FMLPostInitializationEvent event) { @SubscribeEvent public void registerEntities(RegistryEvent.Register event) { - EntityRegistry.registerModEntity(new ResourceLocation(TinkersAether.modid,"dart"), EntityDart.class, "dart",13, TinkersAether.instance, 64, 1, false); + if(TAConfig.darts) { + EntityRegistry.registerModEntity(new ResourceLocation(TinkersAether.modid,"dart"), EntityDart.class, "dart",13, TinkersAether.instance, 64, 1, false); + } TinkersAether.logger.info("Aether Tools Module - Entities Registered"); } diff --git a/src/main/java/shnupbups/tinkersaether/config/TAConfig.java b/src/main/java/shnupbups/tinkersaether/config/TAConfig.java new file mode 100644 index 0000000..1626877 --- /dev/null +++ b/src/main/java/shnupbups/tinkersaether/config/TAConfig.java @@ -0,0 +1,52 @@ +package shnupbups.tinkersaether.config; + +import net.minecraftforge.common.config.Config; +import net.minecraftforge.common.config.ConfigManager; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.client.event.ConfigChangedEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import shnupbups.tinkersaether.TinkersAether; + +@Config(modid = TinkersAether.modid) +@Config.LangKey("tinkersaether.config.title") +public class TAConfig extends Configuration { + + @Config.Comment("Whether Skyroot is enabled or not.") + @Config.RequiresMcRestart + public static boolean skyroot = true; + + @Config.Comment("Whether Holystone is enabled or not.") + @Config.RequiresMcRestart + public static boolean holystone = true; + + @Config.Comment("Whether Zanite is enabled or not.") + @Config.RequiresMcRestart + public static boolean zanite = true; + + @Config.Comment("Whether Gravitite is enabled or not.") + @Config.RequiresMcRestart + public static boolean gravitite = true; + + @Config.Comment("Whether Darts and Dart Shooters are enabled or not.") + @Config.RequiresMcRestart + public static boolean darts = true; + + @Config.Comment("Whether Gravitite can be used to make a tool forge.") + @Config.RequiresMcRestart + public static boolean gravititeForge = true; + + @Mod.EventBusSubscriber(modid = TinkersAether.modid) + private static class EventHandler { + @SubscribeEvent + public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) { + if (event.getModID().equals(TinkersAether.modid)) { + ConfigManager.sync(TinkersAether.modid, Config.Type.INSTANCE); + } + } + } + + public static String getConfig() { + return "Skyroot: "+skyroot+" Holystone: "+holystone+" Zanite: "+zanite+" Gravitite: "+gravitite+" Darts: "+darts+" GravititeForge: "+gravititeForge; + } +} diff --git a/src/main/java/shnupbups/tinkersaether/modules/ModuleBase.java b/src/main/java/shnupbups/tinkersaether/modules/ModuleBase.java index 32107e9..886ea39 100644 --- a/src/main/java/shnupbups/tinkersaether/modules/ModuleBase.java +++ b/src/main/java/shnupbups/tinkersaether/modules/ModuleBase.java @@ -7,6 +7,7 @@ import net.minecraftforge.registries.IForgeRegistry; import shnupbups.tinkersaether.Materials; import shnupbups.tinkersaether.TinkersAether; +import shnupbups.tinkersaether.config.TAConfig; import shnupbups.tinkersaether.fluids.FluidHelper; import shnupbups.tinkersaether.misc.MiscUtils; import shnupbups.tinkersaether.misc.OreDictAether; @@ -37,61 +38,69 @@ public ModuleBase() { public void preInit() { TinkersAether.logger.info("Base Module - Begin PreInit"); - TinkerRegistry.addMaterialStats(skyroot, - new HeadMaterialStats(40, 2.10f, 2.00f, STONE), - new HandleMaterialStats(1.10f, 30), - new ExtraMaterialStats(20), - new BowMaterialStats(1.05f, 1.05f, 0.05f), - new ArrowShaftMaterialStats(1.05f, 0)); - skyroot.setCraftable(true).setCastable(false); - skyroot.addItem("stickSkyroot", 1, Material.VALUE_Shard); - skyroot.addItem("plankSkyroot", 1, Material.VALUE_Ingot); - skyroot.addItem("logSkyroot", 1, Material.VALUE_Ingot * 4); - skyroot.addTrait(Rooted.rooted, MaterialTypes.HEAD); - skyroot.addTrait(ecological, MaterialTypes.HEAD); - skyroot.addTrait(ecological); - MaterialIntegration skyrootMi = new MaterialIntegration(skyroot).setRepresentativeItem("plankSkyroot"); - TinkerRegistry.integrate(skyrootMi).preInit(); - - TinkerRegistry.addMaterialStats(holystone, - new HeadMaterialStats(130, 4.10f, 3.00f, IRON), - new HandleMaterialStats(0.50f, -50), - new ExtraMaterialStats(25), - TinkersAether.plzNo); - holystone.setCraftable(true).setCastable(false); - holystone.addItem("holystone", 1, Material.VALUE_Ingot); - holystone.addTrait(Enlightened.enlightened, MaterialTypes.HEAD); - holystone.addTrait(cheapskate, MaterialTypes.HEAD); - holystone.addTrait(cheap); - MaterialIntegration holystoneMi = new MaterialIntegration(holystone).setRepresentativeItem("holystone"); - TinkerRegistry.integrate(holystoneMi).preInit(); - - TinkerRegistry.addMaterialStats(zanite, - new HeadMaterialStats(210, 2.00f, 4.00f, DIAMOND), - new HandleMaterialStats(0.9f, 65), - new ExtraMaterialStats(50), - TinkersAether.plzNo); - zanite.setCraftable(true).setCastable(false); - zanite.addItem("gemZanite", 1, Material.VALUE_Ingot); - zanite.addItem("blockZanite", 1, Material.VALUE_Block); - zanite.addTrait(Zany.zany, MaterialTypes.HEAD); - zanite.addTrait(jagged, MaterialTypes.HEAD); - zanite.addTrait(jagged); - MaterialIntegration zaniteMi = new MaterialIntegration(zanite).setRepresentativeItem("gemZanite"); - TinkerRegistry.integrate(zaniteMi).preInit(); - - TinkerRegistry.addMaterialStats(gravitite, - new HeadMaterialStats(950, 7.50f, 5.00f, OBSIDIAN), - new HandleMaterialStats(0.9f, 90), - new ExtraMaterialStats(90), - TinkersAether.plzNo); - gravitite.setCraftable(false).setCastable(true); - gravitite.addItem("blockEnchantedGravitite", 1, Material.VALUE_Ingot); - gravitite.addTrait(Antigrav.antigrav, MaterialTypes.HEAD); - gravitite.addTrait(Launching.launching, MaterialTypes.HEAD); - gravitite.addTrait(Launching.launching); - MaterialIntegration gravititeMi = new MaterialIntegration(null, gravitite, FluidHelper.createFluid(gravitite, 900), null).setRepresentativeItem("blockEnchantedGravitite"); - TinkerRegistry.integrate(gravititeMi).preInit(); + if(TAConfig.skyroot) { + TinkerRegistry.addMaterialStats(skyroot, + new HeadMaterialStats(40, 2.10f, 2.00f, STONE), + new HandleMaterialStats(1.10f, 30), + new ExtraMaterialStats(20), + new BowMaterialStats(1.05f, 1.05f, 0.05f), + new ArrowShaftMaterialStats(1.05f, 0)); + skyroot.setCraftable(true).setCastable(false); + skyroot.addItem("stickSkyroot", 1, Material.VALUE_Shard); + skyroot.addItem("plankSkyroot", 1, Material.VALUE_Ingot); + skyroot.addItem("logSkyroot", 1, Material.VALUE_Ingot * 4); + skyroot.addTrait(Rooted.rooted, MaterialTypes.HEAD); + skyroot.addTrait(ecological, MaterialTypes.HEAD); + skyroot.addTrait(ecological); + MaterialIntegration skyrootMi = new MaterialIntegration(skyroot).setRepresentativeItem("plankSkyroot"); + TinkerRegistry.integrate(skyrootMi).preInit(); + } + + if(TAConfig.holystone) { + TinkerRegistry.addMaterialStats(holystone, + new HeadMaterialStats(130, 4.10f, 3.00f, IRON), + new HandleMaterialStats(0.50f, -50), + new ExtraMaterialStats(25), + TinkersAether.plzNo); + holystone.setCraftable(true).setCastable(false); + holystone.addItem("holystone", 1, Material.VALUE_Ingot); + holystone.addTrait(Enlightened.enlightened, MaterialTypes.HEAD); + holystone.addTrait(cheapskate, MaterialTypes.HEAD); + holystone.addTrait(cheap); + MaterialIntegration holystoneMi = new MaterialIntegration(holystone).setRepresentativeItem("holystone"); + TinkerRegistry.integrate(holystoneMi).preInit(); + } + + if(TAConfig.zanite) { + TinkerRegistry.addMaterialStats(zanite, + new HeadMaterialStats(210, 2.00f, 4.00f, DIAMOND), + new HandleMaterialStats(0.9f, 65), + new ExtraMaterialStats(50), + TinkersAether.plzNo); + zanite.setCraftable(true).setCastable(false); + zanite.addItem("gemZanite", 1, Material.VALUE_Ingot); + zanite.addItem("blockZanite", 1, Material.VALUE_Block); + zanite.addTrait(Zany.zany, MaterialTypes.HEAD); + zanite.addTrait(jagged, MaterialTypes.HEAD); + zanite.addTrait(jagged); + MaterialIntegration zaniteMi = new MaterialIntegration(zanite).setRepresentativeItem("gemZanite"); + TinkerRegistry.integrate(zaniteMi).preInit(); + } + + if(TAConfig.gravitite) { + TinkerRegistry.addMaterialStats(gravitite, + new HeadMaterialStats(950, 7.50f, 5.00f, OBSIDIAN), + new HandleMaterialStats(0.9f, 90), + new ExtraMaterialStats(90), + TinkersAether.plzNo); + gravitite.setCraftable(false).setCastable(true); + gravitite.addItem("blockEnchantedGravitite", 1, Material.VALUE_Ingot); + gravitite.addTrait(Antigrav.antigrav, MaterialTypes.HEAD); + gravitite.addTrait(Launching.launching, MaterialTypes.HEAD); + gravitite.addTrait(Launching.launching); + MaterialIntegration gravititeMi = new MaterialIntegration(null, gravitite, FluidHelper.createFluid(gravitite, 900), null).setRepresentativeItem("blockEnchantedGravitite"); + TinkerRegistry.integrate(gravititeMi).preInit(); + } TinkersAether.logger.info("Base Module - Materials Registered"); @@ -105,8 +114,10 @@ public void init() { TinkersAether.logger.info("Base Module - OreDict Registered"); - TinkerRegistry.registerMelting("blockEnchantedGravitite", gravitite.getFluid(), Material.VALUE_Ingot); - TinkerRegistry.registerBasinCasting(new CastingRecipe(MiscUtils.stackFromOreDict("blockEnchantedGravitite"), gravitite.getFluid(), Material.VALUE_Ingot, 180)); + if(TAConfig.gravitite) { + TinkerRegistry.registerMelting("blockEnchantedGravitite", gravitite.getFluid(), Material.VALUE_Ingot); + TinkerRegistry.registerBasinCasting(new CastingRecipe(MiscUtils.stackFromOreDict("blockEnchantedGravitite"), gravitite.getFluid(), Material.VALUE_Ingot, 180)); + } TinkersAether.logger.info("Base Module - Gravitite Stuffs Registered"); @@ -116,7 +127,9 @@ public void init() { @SubscribeEvent public void registerRecipes(RegistryEvent.Register event) { IForgeRegistry registry = event.getRegistry(); - TinkerTools.registerToolForgeBlock(registry, "blockEnchantedGravitite"); + if(TAConfig.gravititeForge) { + TinkerTools.registerToolForgeBlock(registry, "blockEnchantedGravitite"); + } TinkersAether.logger.info("Base Module - Recipes Registered"); } } diff --git a/src/main/java/shnupbups/tinkersaether/modules/ModuleTools.java b/src/main/java/shnupbups/tinkersaether/modules/ModuleTools.java index cce264d..42b6e19 100644 --- a/src/main/java/shnupbups/tinkersaether/modules/ModuleTools.java +++ b/src/main/java/shnupbups/tinkersaether/modules/ModuleTools.java @@ -6,6 +6,7 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import shnupbups.tinkersaether.TinkersAether; +import shnupbups.tinkersaether.config.TAConfig; import shnupbups.tinkersaether.tools.ToolDart; import shnupbups.tinkersaether.tools.ToolDartShooter; import slimeknights.tconstruct.library.TinkerRegistry; @@ -39,40 +40,44 @@ public class ModuleTools { public static void initItems(RegistryEvent.Register event) { TinkersAether.logger.info("Tools Module - Begin ItemInit"); - mouthpiece = new ToolPart(Material.VALUE_Ingot); - mouthpiece.setUnlocalizedName("mouthpiece").setRegistryName("mouthpiece"); - event.getRegistry().register(mouthpiece); - TinkerRegistry.registerToolPart(mouthpiece); - TinkersAether.proxy.registerToolPartModel(mouthpiece); - parts.add(mouthpiece); - - tube = new ToolPart(Material.VALUE_Ingot*3); - tube.setUnlocalizedName("tube").setRegistryName("tube"); - event.getRegistry().register(tube); - TinkerRegistry.registerToolPart(tube); - TinkersAether.proxy.registerToolPartModel(tube); - parts.add(tube); - - dartTip = new ToolPart(Material.VALUE_Ingot); - dartTip.setUnlocalizedName("dart_tip").setRegistryName("dart_tip"); - event.getRegistry().register(dartTip); - TinkerRegistry.registerToolPart(dartTip); - TinkersAether.proxy.registerToolPartModel(dartTip); - parts.add(dartTip); + if(TAConfig.darts) { + mouthpiece = new ToolPart(Material.VALUE_Ingot); + mouthpiece.setUnlocalizedName("mouthpiece").setRegistryName("mouthpiece"); + event.getRegistry().register(mouthpiece); + TinkerRegistry.registerToolPart(mouthpiece); + TinkersAether.proxy.registerToolPartModel(mouthpiece); + parts.add(mouthpiece); + + tube = new ToolPart(Material.VALUE_Ingot * 3); + tube.setUnlocalizedName("tube").setRegistryName("tube"); + event.getRegistry().register(tube); + TinkerRegistry.registerToolPart(tube); + TinkersAether.proxy.registerToolPartModel(tube); + parts.add(tube); + + dartTip = new ToolPart(Material.VALUE_Ingot); + dartTip.setUnlocalizedName("dart_tip").setRegistryName("dart_tip"); + event.getRegistry().register(dartTip); + TinkerRegistry.registerToolPart(dartTip); + TinkersAether.proxy.registerToolPartModel(dartTip); + parts.add(dartTip); + } TinkersAether.logger.info("Tools Module - Parts Registered"); - dartShooter = new ToolDartShooter(); - event.getRegistry().register(dartShooter); - TinkerRegistry.registerToolForgeCrafting(dartShooter); - TinkersAether.proxy.registerToolModel(dartShooter); - tools.add(dartShooter); - - dart = new ToolDart(); - event.getRegistry().register(dart); - TinkerRegistry.registerToolForgeCrafting(dart); - TinkersAether.proxy.registerToolModel(dart); - tools.add(dart); + if(TAConfig.darts) { + dartShooter = new ToolDartShooter(); + event.getRegistry().register(dartShooter); + TinkerRegistry.registerToolForgeCrafting(dartShooter); + TinkersAether.proxy.registerToolModel(dartShooter); + tools.add(dartShooter); + + dart = new ToolDart(); + event.getRegistry().register(dart); + TinkerRegistry.registerToolForgeCrafting(dart); + TinkersAether.proxy.registerToolModel(dart); + tools.add(dart); + } TinkersAether.logger.info("Tools Module - Tools Registered"); diff --git a/src/main/java/shnupbups/tinkersaether/proxy/ClientProxy.java b/src/main/java/shnupbups/tinkersaether/proxy/ClientProxy.java index 1a144d2..bcfbce9 100644 --- a/src/main/java/shnupbups/tinkersaether/proxy/ClientProxy.java +++ b/src/main/java/shnupbups/tinkersaether/proxy/ClientProxy.java @@ -13,6 +13,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fml.client.registry.RenderingRegistry; import shnupbups.tinkersaether.TinkersAether; +import shnupbups.tinkersaether.config.TAConfig; import shnupbups.tinkersaether.entities.EntityDart; import shnupbups.tinkersaether.modules.ModuleTools; import shnupbups.tinkersaether.render.RenderDart; @@ -64,7 +65,9 @@ public void registerModels() { super.registerModels(); // entities - RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, RenderDart::new); + if(TAConfig.darts) { + RenderingRegistry.registerEntityRenderingHandler(EntityDart.class, RenderDart::new); + } TinkersAether.logger.info("Aether Tools Module - Models Registered"); } @@ -85,18 +88,20 @@ public void registerToolPartModel(T part) { @Override public void initToolGuis() { - if (ModuleTools.dartShooter != null) { - ToolBuildGuiInfo dartShooterInfo = new ToolBuildGuiInfo(ModuleTools.dartShooter); - dartShooterInfo.addSlotPosition(32 - 9, 41 - 9); - dartShooterInfo.addSlotPosition(32 + 9, 41 + 9); - TinkerRegistryClient.addToolBuilding(dartShooterInfo); - } - if (ModuleTools.dart != null) { - ToolBuildGuiInfo dartInfo = new ToolBuildGuiInfo(ModuleTools.dart); - dartInfo.addSlotPosition(32, 41); - dartInfo.addSlotPosition(32 - 18, 41 - 18); - dartInfo.addSlotPosition(32 + 18, 41 + 18); - TinkerRegistryClient.addToolBuilding(dartInfo); + if(TAConfig.darts) { + if (ModuleTools.dartShooter != null) { + ToolBuildGuiInfo dartShooterInfo = new ToolBuildGuiInfo(ModuleTools.dartShooter); + dartShooterInfo.addSlotPosition(32 - 9, 41 - 9); + dartShooterInfo.addSlotPosition(32 + 9, 41 + 9); + TinkerRegistryClient.addToolBuilding(dartShooterInfo); + } + if (ModuleTools.dart != null) { + ToolBuildGuiInfo dartInfo = new ToolBuildGuiInfo(ModuleTools.dart); + dartInfo.addSlotPosition(32, 41); + dartInfo.addSlotPosition(32 - 18, 41 - 18); + dartInfo.addSlotPosition(32 + 18, 41 + 18); + TinkerRegistryClient.addToolBuilding(dartInfo); + } } } diff --git a/src/main/resources/assets/tinkersaether/lang/en_us.lang b/src/main/resources/assets/tinkersaether/lang/en_us.lang index 345b033..33f1d96 100644 --- a/src/main/resources/assets/tinkersaether/lang/en_us.lang +++ b/src/main/resources/assets/tinkersaether/lang/en_us.lang @@ -24,4 +24,6 @@ modifier.rooted.name=Rooted modifier.rooted.desc=§oFirst ones double.§r\nExtra drops from naturally generated Aether blocks. modifier.zany.name=Zany modifier.zany.desc=§oEntropy powered speed.§r\nThe tool mines considerably faster as it wears out. -modifier.zany.extra=Zany Speed: x%s \ No newline at end of file +modifier.zany.extra=Zany Speed: x%s + +tinkersaether.config.title=Tinker's Aether Configuration \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 5e7f982..4e0a0ec 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "tinkersaether", "name": "Tinker's Aether", "description": "Adds Aether materials and stuff to Tinker's Construct.", - "version": "1.0.1", + "version": "1.0.2", "mcversion": "${mcversion}", "url": "", "updateUrl": "",