Skip to content

Commit 6b3480a

Browse files
committed
1.0.2
Added a config to disable each material individually, as well as disable darts and dart shoioters entirely, and disable gravitite tool forges.
1 parent 9fa9233 commit 6b3480a

File tree

8 files changed

+195
-109
lines changed

8 files changed

+195
-109
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
1111
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1212

1313

14-
version = "1.0.1"
14+
version = "1.0.2"
1515
group = "shnupbups.tinkersaether" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1616
archivesBaseName = "tinkersaether"
1717

src/main/java/shnupbups/tinkersaether/TinkersAether.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.minecraftforge.fml.common.registry.EntityRegistry;
1515
import org.apache.logging.log4j.LogManager;
1616
import org.apache.logging.log4j.Logger;
17+
import shnupbups.tinkersaether.config.TAConfig;
1718
import shnupbups.tinkersaether.entities.EntityDart;
1819
import shnupbups.tinkersaether.misc.MiscUtils;
1920
import shnupbups.tinkersaether.modules.ModuleBase;
@@ -25,7 +26,7 @@
2526
public class TinkersAether {
2627
public static final String modid = "tinkersaether";
2728
public static final String name = "MoreTiC";
28-
public static final String version = "1.0.1";
29+
public static final String version = "1.0.2";
2930

3031
@Mod.Instance(modid)
3132
public static TinkersAether instance;
@@ -49,11 +50,17 @@ public void preInit(FMLPreInitializationEvent event) {
4950

5051
@Mod.EventHandler
5152
public void init(FMLInitializationEvent event) {
52-
proxy.initToolGuis();
53+
logger.info(TAConfig.getConfig());
54+
55+
if(TAConfig.darts) {
56+
proxy.initToolGuis();
57+
}
5358

5459
ModuleBase.aether.init();
5560

56-
MiscUtils.displace(TinkerMaterials.wood.getIdentifier()); // Skyroot needs priority
61+
if(TAConfig.skyroot) {
62+
MiscUtils.displace(TinkerMaterials.wood.getIdentifier()); // Skyroot needs priority
63+
}
5764
}
5865

5966
@Mod.EventHandler
@@ -63,7 +70,9 @@ public void postInit(FMLPostInitializationEvent event) {
6370

6471
@SubscribeEvent
6572
public void registerEntities(RegistryEvent.Register<EntityEntry> event) {
66-
EntityRegistry.registerModEntity(new ResourceLocation(TinkersAether.modid,"dart"), EntityDart.class, "dart",13, TinkersAether.instance, 64, 1, false);
73+
if(TAConfig.darts) {
74+
EntityRegistry.registerModEntity(new ResourceLocation(TinkersAether.modid,"dart"), EntityDart.class, "dart",13, TinkersAether.instance, 64, 1, false);
75+
}
6776
TinkersAether.logger.info("Aether Tools Module - Entities Registered");
6877
}
6978

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package shnupbups.tinkersaether.config;
2+
3+
import net.minecraftforge.common.config.Config;
4+
import net.minecraftforge.common.config.ConfigManager;
5+
import net.minecraftforge.common.config.Configuration;
6+
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
7+
import net.minecraftforge.fml.common.Mod;
8+
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9+
import shnupbups.tinkersaether.TinkersAether;
10+
11+
@Config(modid = TinkersAether.modid)
12+
@Config.LangKey("tinkersaether.config.title")
13+
public class TAConfig extends Configuration {
14+
15+
@Config.Comment("Whether Skyroot is enabled or not.")
16+
@Config.RequiresMcRestart
17+
public static boolean skyroot = true;
18+
19+
@Config.Comment("Whether Holystone is enabled or not.")
20+
@Config.RequiresMcRestart
21+
public static boolean holystone = true;
22+
23+
@Config.Comment("Whether Zanite is enabled or not.")
24+
@Config.RequiresMcRestart
25+
public static boolean zanite = true;
26+
27+
@Config.Comment("Whether Gravitite is enabled or not.")
28+
@Config.RequiresMcRestart
29+
public static boolean gravitite = true;
30+
31+
@Config.Comment("Whether Darts and Dart Shooters are enabled or not.")
32+
@Config.RequiresMcRestart
33+
public static boolean darts = true;
34+
35+
@Config.Comment("Whether Gravitite can be used to make a tool forge.")
36+
@Config.RequiresMcRestart
37+
public static boolean gravititeForge = true;
38+
39+
@Mod.EventBusSubscriber(modid = TinkersAether.modid)
40+
private static class EventHandler {
41+
@SubscribeEvent
42+
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) {
43+
if (event.getModID().equals(TinkersAether.modid)) {
44+
ConfigManager.sync(TinkersAether.modid, Config.Type.INSTANCE);
45+
}
46+
}
47+
}
48+
49+
public static String getConfig() {
50+
return "Skyroot: "+skyroot+" Holystone: "+holystone+" Zanite: "+zanite+" Gravitite: "+gravitite+" Darts: "+darts+" GravititeForge: "+gravititeForge;
51+
}
52+
}

src/main/java/shnupbups/tinkersaether/modules/ModuleBase.java

Lines changed: 71 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraftforge.registries.IForgeRegistry;
88
import shnupbups.tinkersaether.Materials;
99
import shnupbups.tinkersaether.TinkersAether;
10+
import shnupbups.tinkersaether.config.TAConfig;
1011
import shnupbups.tinkersaether.fluids.FluidHelper;
1112
import shnupbups.tinkersaether.misc.MiscUtils;
1213
import shnupbups.tinkersaether.misc.OreDictAether;
@@ -37,61 +38,69 @@ public ModuleBase() {
3738
public void preInit() {
3839
TinkersAether.logger.info("Base Module - Begin PreInit");
3940

40-
TinkerRegistry.addMaterialStats(skyroot,
41-
new HeadMaterialStats(40, 2.10f, 2.00f, STONE),
42-
new HandleMaterialStats(1.10f, 30),
43-
new ExtraMaterialStats(20),
44-
new BowMaterialStats(1.05f, 1.05f, 0.05f),
45-
new ArrowShaftMaterialStats(1.05f, 0));
46-
skyroot.setCraftable(true).setCastable(false);
47-
skyroot.addItem("stickSkyroot", 1, Material.VALUE_Shard);
48-
skyroot.addItem("plankSkyroot", 1, Material.VALUE_Ingot);
49-
skyroot.addItem("logSkyroot", 1, Material.VALUE_Ingot * 4);
50-
skyroot.addTrait(Rooted.rooted, MaterialTypes.HEAD);
51-
skyroot.addTrait(ecological, MaterialTypes.HEAD);
52-
skyroot.addTrait(ecological);
53-
MaterialIntegration skyrootMi = new MaterialIntegration(skyroot).setRepresentativeItem("plankSkyroot");
54-
TinkerRegistry.integrate(skyrootMi).preInit();
55-
56-
TinkerRegistry.addMaterialStats(holystone,
57-
new HeadMaterialStats(130, 4.10f, 3.00f, IRON),
58-
new HandleMaterialStats(0.50f, -50),
59-
new ExtraMaterialStats(25),
60-
TinkersAether.plzNo);
61-
holystone.setCraftable(true).setCastable(false);
62-
holystone.addItem("holystone", 1, Material.VALUE_Ingot);
63-
holystone.addTrait(Enlightened.enlightened, MaterialTypes.HEAD);
64-
holystone.addTrait(cheapskate, MaterialTypes.HEAD);
65-
holystone.addTrait(cheap);
66-
MaterialIntegration holystoneMi = new MaterialIntegration(holystone).setRepresentativeItem("holystone");
67-
TinkerRegistry.integrate(holystoneMi).preInit();
68-
69-
TinkerRegistry.addMaterialStats(zanite,
70-
new HeadMaterialStats(210, 2.00f, 4.00f, DIAMOND),
71-
new HandleMaterialStats(0.9f, 65),
72-
new ExtraMaterialStats(50),
73-
TinkersAether.plzNo);
74-
zanite.setCraftable(true).setCastable(false);
75-
zanite.addItem("gemZanite", 1, Material.VALUE_Ingot);
76-
zanite.addItem("blockZanite", 1, Material.VALUE_Block);
77-
zanite.addTrait(Zany.zany, MaterialTypes.HEAD);
78-
zanite.addTrait(jagged, MaterialTypes.HEAD);
79-
zanite.addTrait(jagged);
80-
MaterialIntegration zaniteMi = new MaterialIntegration(zanite).setRepresentativeItem("gemZanite");
81-
TinkerRegistry.integrate(zaniteMi).preInit();
82-
83-
TinkerRegistry.addMaterialStats(gravitite,
84-
new HeadMaterialStats(950, 7.50f, 5.00f, OBSIDIAN),
85-
new HandleMaterialStats(0.9f, 90),
86-
new ExtraMaterialStats(90),
87-
TinkersAether.plzNo);
88-
gravitite.setCraftable(false).setCastable(true);
89-
gravitite.addItem("blockEnchantedGravitite", 1, Material.VALUE_Ingot);
90-
gravitite.addTrait(Antigrav.antigrav, MaterialTypes.HEAD);
91-
gravitite.addTrait(Launching.launching, MaterialTypes.HEAD);
92-
gravitite.addTrait(Launching.launching);
93-
MaterialIntegration gravititeMi = new MaterialIntegration(null, gravitite, FluidHelper.createFluid(gravitite, 900), null).setRepresentativeItem("blockEnchantedGravitite");
94-
TinkerRegistry.integrate(gravititeMi).preInit();
41+
if(TAConfig.skyroot) {
42+
TinkerRegistry.addMaterialStats(skyroot,
43+
new HeadMaterialStats(40, 2.10f, 2.00f, STONE),
44+
new HandleMaterialStats(1.10f, 30),
45+
new ExtraMaterialStats(20),
46+
new BowMaterialStats(1.05f, 1.05f, 0.05f),
47+
new ArrowShaftMaterialStats(1.05f, 0));
48+
skyroot.setCraftable(true).setCastable(false);
49+
skyroot.addItem("stickSkyroot", 1, Material.VALUE_Shard);
50+
skyroot.addItem("plankSkyroot", 1, Material.VALUE_Ingot);
51+
skyroot.addItem("logSkyroot", 1, Material.VALUE_Ingot * 4);
52+
skyroot.addTrait(Rooted.rooted, MaterialTypes.HEAD);
53+
skyroot.addTrait(ecological, MaterialTypes.HEAD);
54+
skyroot.addTrait(ecological);
55+
MaterialIntegration skyrootMi = new MaterialIntegration(skyroot).setRepresentativeItem("plankSkyroot");
56+
TinkerRegistry.integrate(skyrootMi).preInit();
57+
}
58+
59+
if(TAConfig.holystone) {
60+
TinkerRegistry.addMaterialStats(holystone,
61+
new HeadMaterialStats(130, 4.10f, 3.00f, IRON),
62+
new HandleMaterialStats(0.50f, -50),
63+
new ExtraMaterialStats(25),
64+
TinkersAether.plzNo);
65+
holystone.setCraftable(true).setCastable(false);
66+
holystone.addItem("holystone", 1, Material.VALUE_Ingot);
67+
holystone.addTrait(Enlightened.enlightened, MaterialTypes.HEAD);
68+
holystone.addTrait(cheapskate, MaterialTypes.HEAD);
69+
holystone.addTrait(cheap);
70+
MaterialIntegration holystoneMi = new MaterialIntegration(holystone).setRepresentativeItem("holystone");
71+
TinkerRegistry.integrate(holystoneMi).preInit();
72+
}
73+
74+
if(TAConfig.zanite) {
75+
TinkerRegistry.addMaterialStats(zanite,
76+
new HeadMaterialStats(210, 2.00f, 4.00f, DIAMOND),
77+
new HandleMaterialStats(0.9f, 65),
78+
new ExtraMaterialStats(50),
79+
TinkersAether.plzNo);
80+
zanite.setCraftable(true).setCastable(false);
81+
zanite.addItem("gemZanite", 1, Material.VALUE_Ingot);
82+
zanite.addItem("blockZanite", 1, Material.VALUE_Block);
83+
zanite.addTrait(Zany.zany, MaterialTypes.HEAD);
84+
zanite.addTrait(jagged, MaterialTypes.HEAD);
85+
zanite.addTrait(jagged);
86+
MaterialIntegration zaniteMi = new MaterialIntegration(zanite).setRepresentativeItem("gemZanite");
87+
TinkerRegistry.integrate(zaniteMi).preInit();
88+
}
89+
90+
if(TAConfig.gravitite) {
91+
TinkerRegistry.addMaterialStats(gravitite,
92+
new HeadMaterialStats(950, 7.50f, 5.00f, OBSIDIAN),
93+
new HandleMaterialStats(0.9f, 90),
94+
new ExtraMaterialStats(90),
95+
TinkersAether.plzNo);
96+
gravitite.setCraftable(false).setCastable(true);
97+
gravitite.addItem("blockEnchantedGravitite", 1, Material.VALUE_Ingot);
98+
gravitite.addTrait(Antigrav.antigrav, MaterialTypes.HEAD);
99+
gravitite.addTrait(Launching.launching, MaterialTypes.HEAD);
100+
gravitite.addTrait(Launching.launching);
101+
MaterialIntegration gravititeMi = new MaterialIntegration(null, gravitite, FluidHelper.createFluid(gravitite, 900), null).setRepresentativeItem("blockEnchantedGravitite");
102+
TinkerRegistry.integrate(gravititeMi).preInit();
103+
}
95104

96105
TinkersAether.logger.info("Base Module - Materials Registered");
97106

@@ -105,8 +114,10 @@ public void init() {
105114

106115
TinkersAether.logger.info("Base Module - OreDict Registered");
107116

108-
TinkerRegistry.registerMelting("blockEnchantedGravitite", gravitite.getFluid(), Material.VALUE_Ingot);
109-
TinkerRegistry.registerBasinCasting(new CastingRecipe(MiscUtils.stackFromOreDict("blockEnchantedGravitite"), gravitite.getFluid(), Material.VALUE_Ingot, 180));
117+
if(TAConfig.gravitite) {
118+
TinkerRegistry.registerMelting("blockEnchantedGravitite", gravitite.getFluid(), Material.VALUE_Ingot);
119+
TinkerRegistry.registerBasinCasting(new CastingRecipe(MiscUtils.stackFromOreDict("blockEnchantedGravitite"), gravitite.getFluid(), Material.VALUE_Ingot, 180));
120+
}
110121

111122
TinkersAether.logger.info("Base Module - Gravitite Stuffs Registered");
112123

@@ -116,7 +127,9 @@ public void init() {
116127
@SubscribeEvent
117128
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
118129
IForgeRegistry<IRecipe> registry = event.getRegistry();
119-
TinkerTools.registerToolForgeBlock(registry, "blockEnchantedGravitite");
130+
if(TAConfig.gravititeForge) {
131+
TinkerTools.registerToolForgeBlock(registry, "blockEnchantedGravitite");
132+
}
120133
TinkersAether.logger.info("Base Module - Recipes Registered");
121134
}
122135
}

src/main/java/shnupbups/tinkersaether/modules/ModuleTools.java

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.minecraftforge.fml.common.Mod;
77
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
88
import shnupbups.tinkersaether.TinkersAether;
9+
import shnupbups.tinkersaether.config.TAConfig;
910
import shnupbups.tinkersaether.tools.ToolDart;
1011
import shnupbups.tinkersaether.tools.ToolDartShooter;
1112
import slimeknights.tconstruct.library.TinkerRegistry;
@@ -39,40 +40,44 @@ public class ModuleTools {
3940
public static void initItems(RegistryEvent.Register<Item> event) {
4041
TinkersAether.logger.info("Tools Module - Begin ItemInit");
4142

42-
mouthpiece = new ToolPart(Material.VALUE_Ingot);
43-
mouthpiece.setUnlocalizedName("mouthpiece").setRegistryName("mouthpiece");
44-
event.getRegistry().register(mouthpiece);
45-
TinkerRegistry.registerToolPart(mouthpiece);
46-
TinkersAether.proxy.registerToolPartModel(mouthpiece);
47-
parts.add(mouthpiece);
48-
49-
tube = new ToolPart(Material.VALUE_Ingot*3);
50-
tube.setUnlocalizedName("tube").setRegistryName("tube");
51-
event.getRegistry().register(tube);
52-
TinkerRegistry.registerToolPart(tube);
53-
TinkersAether.proxy.registerToolPartModel(tube);
54-
parts.add(tube);
55-
56-
dartTip = new ToolPart(Material.VALUE_Ingot);
57-
dartTip.setUnlocalizedName("dart_tip").setRegistryName("dart_tip");
58-
event.getRegistry().register(dartTip);
59-
TinkerRegistry.registerToolPart(dartTip);
60-
TinkersAether.proxy.registerToolPartModel(dartTip);
61-
parts.add(dartTip);
43+
if(TAConfig.darts) {
44+
mouthpiece = new ToolPart(Material.VALUE_Ingot);
45+
mouthpiece.setUnlocalizedName("mouthpiece").setRegistryName("mouthpiece");
46+
event.getRegistry().register(mouthpiece);
47+
TinkerRegistry.registerToolPart(mouthpiece);
48+
TinkersAether.proxy.registerToolPartModel(mouthpiece);
49+
parts.add(mouthpiece);
50+
51+
tube = new ToolPart(Material.VALUE_Ingot * 3);
52+
tube.setUnlocalizedName("tube").setRegistryName("tube");
53+
event.getRegistry().register(tube);
54+
TinkerRegistry.registerToolPart(tube);
55+
TinkersAether.proxy.registerToolPartModel(tube);
56+
parts.add(tube);
57+
58+
dartTip = new ToolPart(Material.VALUE_Ingot);
59+
dartTip.setUnlocalizedName("dart_tip").setRegistryName("dart_tip");
60+
event.getRegistry().register(dartTip);
61+
TinkerRegistry.registerToolPart(dartTip);
62+
TinkersAether.proxy.registerToolPartModel(dartTip);
63+
parts.add(dartTip);
64+
}
6265

6366
TinkersAether.logger.info("Tools Module - Parts Registered");
6467

65-
dartShooter = new ToolDartShooter();
66-
event.getRegistry().register(dartShooter);
67-
TinkerRegistry.registerToolForgeCrafting(dartShooter);
68-
TinkersAether.proxy.registerToolModel(dartShooter);
69-
tools.add(dartShooter);
70-
71-
dart = new ToolDart();
72-
event.getRegistry().register(dart);
73-
TinkerRegistry.registerToolForgeCrafting(dart);
74-
TinkersAether.proxy.registerToolModel(dart);
75-
tools.add(dart);
68+
if(TAConfig.darts) {
69+
dartShooter = new ToolDartShooter();
70+
event.getRegistry().register(dartShooter);
71+
TinkerRegistry.registerToolForgeCrafting(dartShooter);
72+
TinkersAether.proxy.registerToolModel(dartShooter);
73+
tools.add(dartShooter);
74+
75+
dart = new ToolDart();
76+
event.getRegistry().register(dart);
77+
TinkerRegistry.registerToolForgeCrafting(dart);
78+
TinkersAether.proxy.registerToolModel(dart);
79+
tools.add(dart);
80+
}
7681

7782
TinkersAether.logger.info("Tools Module - Tools Registered");
7883

0 commit comments

Comments
 (0)