Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
Added a config to disable each material individually, as well as disable
darts and dart shoioters entirely, and disable gravitite tool forges.
  • Loading branch information
Shnupbups committed Jun 25, 2018
1 parent 9fa9233 commit 6b3480a
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 109 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
17 changes: 13 additions & 4 deletions src/main/java/shnupbups/tinkersaether/TinkersAether.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand All @@ -63,7 +70,9 @@ public void postInit(FMLPostInitializationEvent event) {

@SubscribeEvent
public void registerEntities(RegistryEvent.Register<EntityEntry> 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");
}

Expand Down
52 changes: 52 additions & 0 deletions src/main/java/shnupbups/tinkersaether/config/TAConfig.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
129 changes: 71 additions & 58 deletions src/main/java/shnupbups/tinkersaether/modules/ModuleBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand All @@ -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");

Expand All @@ -116,7 +127,9 @@ public void init() {
@SubscribeEvent
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
IForgeRegistry<IRecipe> registry = event.getRegistry();
TinkerTools.registerToolForgeBlock(registry, "blockEnchantedGravitite");
if(TAConfig.gravititeForge) {
TinkerTools.registerToolForgeBlock(registry, "blockEnchantedGravitite");
}
TinkersAether.logger.info("Base Module - Recipes Registered");
}
}
67 changes: 36 additions & 31 deletions src/main/java/shnupbups/tinkersaether/modules/ModuleTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -39,40 +40,44 @@ public class ModuleTools {
public static void initItems(RegistryEvent.Register<Item> 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");

Expand Down
Loading

0 comments on commit 6b3480a

Please sign in to comment.