Skip to content

Commit 66e8f08

Browse files
committed
Add Roots Integration
1 parent 607b5ba commit 66e8f08

6 files changed

Lines changed: 83 additions & 1 deletion

File tree

src/main/java/com/github/gtexpert/gtwp/GTWPMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"after:" + Mods.Names.PROJECT_VIBRANT_JOURNEYS + ";" + "after:" + Mods.Names.PLANTS + ";" +
3939
"after:" + Mods.Names.EXTRA_UTILITIES + ";" + "after:" + Mods.Names.INTERGRATED_DYNAMICS + ";" +
4040
"after:" + Mods.Names.RANDOM_THINGS + ";" + "after:" + Mods.Names.RUSTIC + ";" +
41-
"after:" + Mods.Names.MYSTICAL_WORLD + ";")
41+
"after:" + Mods.Names.MYSTICAL_WORLD + ";" + "after:" + Mods.Names.ROOTS)
4242
@Mod.EventBusSubscriber(modid = ModValues.MODID)
4343
public class GTWPMod {
4444

src/main/java/com/github/gtexpert/gtwp/api/util/Mods.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public enum Mods {
9595
ProjectRedIllumination(Names.PROJECT_RED_ILLUMINATION),
9696
Railcraft(Names.RAILCRAFT),
9797
RandomThings(Names.RANDOM_THINGS),
98+
Roots(Names.ROOTS),
9899
Plants(Names.PLANTS),
99100
RefinedStorage(Names.REFINED_STORAGE),
100101
ProjectVibrantJourneys(Names.PROJECT_VIBRANT_JOURNEYS),
@@ -198,6 +199,7 @@ public static class Names {
198199
public static final String PROJECT_RED_ILLUMINATION = "projectred-illumination";
199200
public static final String RAILCRAFT = "railcraft";
200201
public static final String RANDOM_THINGS = "randomthings";
202+
public static final String ROOTS = "roots";
201203
public static final String PLANTS = "plants2";
202204
public static final String REFINED_STORAGE = "refinedstorage";
203205
public static final String PROJECT_VIBRANT_JOURNEYS = "pvj";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.github.gtexpert.gtwp.integration.roots;
2+
3+
import net.minecraftforge.common.config.Config;
4+
5+
import com.github.gtexpert.gtwp.api.ModValues;
6+
import com.github.gtexpert.gtwp.module.Modules;
7+
8+
@Config.LangKey(ModValues.MODID + ".config.integration.roots")
9+
@Config(modid = ModValues.MODID,
10+
name = ModValues.MODID + "/integration/" + Modules.MODULE_ROOTS,
11+
category = "Roots")
12+
public class RootsConfigHolder {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.github.gtexpert.gtwp.integration.roots;
2+
3+
import net.minecraft.item.crafting.IRecipe;
4+
import net.minecraftforge.event.RegistryEvent;
5+
6+
import com.github.gtexpert.gtwp.api.ModValues;
7+
import com.github.gtexpert.gtwp.api.modules.TModule;
8+
import com.github.gtexpert.gtwp.api.util.Mods;
9+
import com.github.gtexpert.gtwp.integration.GTWPIntegrationSubmodule;
10+
import com.github.gtexpert.gtwp.integration.roots.recipes.RootsWoodRecipe;
11+
import com.github.gtexpert.gtwp.module.Modules;
12+
13+
@TModule(
14+
moduleID = Modules.MODULE_ROOTS,
15+
containerID = ModValues.MODID,
16+
modDependencies = { Mods.Names.MYSTICAL_WORLD, Mods.Names.ROOTS },
17+
name = "GTWoodProcessing Roots Integration",
18+
description = "Roots Things Integration Module")
19+
public class RootsModule extends GTWPIntegrationSubmodule {
20+
21+
@Override
22+
public void registerRecipesLowest(RegistryEvent.Register<IRecipe> event) {
23+
RootsWoodRecipe.init();
24+
}
25+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.github.gtexpert.gtwp.integration.roots.recipes;
2+
3+
import java.util.Arrays;
4+
import java.util.List;
5+
6+
import gregtech.loaders.WoodTypeEntry;
7+
8+
import com.github.gtexpert.gtwp.api.util.Mods;
9+
import com.github.gtexpert.gtwp.loaders.GTWPWoodRecipeLoader;
10+
11+
public class RootsWoodRecipe {
12+
13+
private static List<WoodTypeEntry> DEFAULT_ENTRIES;
14+
15+
private static List<WoodTypeEntry> getDefaultEntries() {
16+
if (DEFAULT_ENTRIES == null) {
17+
final String mcModId = Mods.Names.ROOTS;
18+
return DEFAULT_ENTRIES = Arrays.asList(
19+
new WoodTypeEntry.Builder(mcModId, "wildwood")
20+
.log(Mods.Roots.getItem("wildwood_log", 1)).removeCharcoalRecipe()
21+
.planks(Mods.Roots.getItem("wildwood_planks", 1), null)
22+
.door(Mods.Roots.getItem("wildwood_door", 1), "wildwood_door")
23+
.slab(Mods.Roots.getItem("wildwood_slab", 1), "wildwood_slab")
24+
.fence(Mods.Roots.getItem("wildwood_fence", 1), "wildwood_fence")
25+
.fenceGate(Mods.Roots.getItem("wildwood_fence_gate", 1), "wildwood_fence_gate")
26+
.stairs(Mods.Roots.getItem("wildwood_stairs", 1), "wildwood_stairs")
27+
.registerAllOres()
28+
.build());
29+
}
30+
return DEFAULT_ENTRIES;
31+
}
32+
33+
public static void init() {
34+
for (WoodTypeEntry entry : getDefaultEntries()) {
35+
GTWPWoodRecipeLoader.removePlankRecipe(false, entry, Mods.Names.ROOTS);
36+
37+
GTWPWoodRecipeLoader.registerWoodTypeRecipe(false, entry);
38+
GTWPWoodRecipeLoader.addCuttingRecipe(entry);
39+
GTWPWoodRecipeLoader.addSawmillRecipe(entry);
40+
}
41+
}
42+
}

src/main/java/com/github/gtexpert/gtwp/module/Modules.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class Modules implements IModuleContainer {
3737
public static final String MODULE_PLANTS = "plants_integration";
3838
public static final String MODULE_RTHINGS = "rthings_integration";
3939
public static final String MODULE_RUSTIC = "rustic_integration";
40+
public static final String MODULE_ROOTS = "roots";
4041
public static final String MODULE_IDS = "ids_integration";
4142
public static final String MODULE_MWORLD = "mworld_integration";
4243

0 commit comments

Comments
 (0)