Skip to content

Commit

Permalink
Add Wizardry Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tier940 committed Sep 5, 2024
1 parent bd817c8 commit dcfa472
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
roots(recommended)
biomes-o-plenty(recommended)
ice-and-fire-dragons(recommended)
wizardry-mod(recommended)
files: |
build/libs/!(*-@(dev|sources|javadoc)).jar
build/libs/*-@(sources).jar
Expand Down
7 changes: 7 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,11 @@ dependencies {
if (project.debug_bop.toBoolean() || project.debug_all.toBoolean()) {
runtimeOnlyNonPublishable rfg.deobf("curse.maven:biomes-o-plenty-220318:2842510") // Biomes O' Plenty 7.0.1.2444
}

// Debug Wizardry
if (project.debug_all.toBoolean() || project.debug_wizardry.toBoolean()) {
runtimeOnlyNonPublishable rfg.deobf("curse.maven:librarianlib-252910:3041340") // LibrarianLib 4.22
runtimeOnlyNonPublishable rfg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465") // Forgelin 1.8.4
runtimeOnlyNonPublishable rfg.deobf("curse.maven:wizardry-mod-278155:5160012") // Wizardry 0.11.3
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ debug_rustic = false
debug_mworld = false
debug_roots = false
debug_bop = false
debug_wizardry = false

# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/github/gtexpert/gtwp/GTWPMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"after:" + Mods.Names.EXTRA_UTILITIES + ";" + "after:" + Mods.Names.INTERGRATED_DYNAMICS + ";" +
"after:" + Mods.Names.RANDOM_THINGS + ";" + "after:" + Mods.Names.RUSTIC + ";" +
"after:" + Mods.Names.MYSTICAL_WORLD + ";" + "after:" + Mods.Names.ROOTS + ";" +
"after:" + Mods.Names.BIOMES_O_PLENTY + ";" + "after:" + Mods.Names.ICE_AND_FIRE)
"after:" + Mods.Names.BIOMES_O_PLENTY + ";" + "after:" + Mods.Names.ICE_AND_FIRE + ";" +
"after:" + Mods.Names.WIZARDRY + ";")
@Mod.EventBusSubscriber(modid = ModValues.MODID)
public class GTWPMod {

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/github/gtexpert/gtwp/api/util/Mods.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public enum Mods {
Rustic(Names.RUSTIC),
Thaumcraft(Names.THAUMCRAFT),
ThaumicEnergistics(Names.THAUMIC_ENERGISTICS),
Wizardry(Names.WIZARDRY),
TheOneProbe(Names.THE_ONE_PROBE),
TinkersConstruct(Names.TINKERS_CONSTRUCT),
TOPAddons(Names.TOP_ADDONS),
Expand Down Expand Up @@ -210,6 +211,7 @@ public static class Names {
public static final String RUSTIC = "rustic";
public static final String THAUMCRAFT = "thaumcraft";
public static final String THAUMIC_ENERGISTICS = "haumicenergistics";
public static final String WIZARDRY = "wizardry";
public static final String THE_ONE_PROBE = "theoneprobe";
public static final String TINKERS_CONSTRUCT = "tconstruct";
public static final String TOP_ADDONS = "topaddons";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.github.gtexpert.gtwp.integration.wizardry;

import net.minecraftforge.common.config.Config;

import com.github.gtexpert.gtwp.api.ModValues;
import com.github.gtexpert.gtwp.module.Modules;

@Config.LangKey(ModValues.MODID + ".config.integration.wizardry")
@Config(modid = ModValues.MODID,
name = ModValues.MODID + "/integration/" + Modules.MODULE_WIZARDRY,
category = "Wizardry")
public class WizardryConfigHolder {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.github.gtexpert.gtwp.integration.wizardry;

import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.event.RegistryEvent;

import com.github.gtexpert.gtwp.api.ModValues;
import com.github.gtexpert.gtwp.api.modules.TModule;
import com.github.gtexpert.gtwp.api.util.Mods;
import com.github.gtexpert.gtwp.integration.GTWPIntegrationSubmodule;
import com.github.gtexpert.gtwp.integration.wizardry.recipes.WizardryWoodRecipe;
import com.github.gtexpert.gtwp.module.Modules;

@TModule(
moduleID = Modules.MODULE_WIZARDRY,
containerID = ModValues.MODID,
modDependencies = Mods.Names.WIZARDRY,
name = "GTWoodProcessing Wizardry Integration",
description = "Wizardry Integration Module")
public class WizardryModule extends GTWPIntegrationSubmodule {

@Override
public void registerRecipesLowest(RegistryEvent.Register<IRecipe> event) {
WizardryWoodRecipe.init();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.github.gtexpert.gtwp.integration.wizardry.recipes;

import java.util.Arrays;
import java.util.List;

import gregtech.loaders.WoodTypeEntry;

import com.github.gtexpert.gtwp.api.util.Mods;
import com.github.gtexpert.gtwp.loaders.GTWPWoodRecipeLoader;

public class WizardryWoodRecipe {

private static List<WoodTypeEntry> DEFAULT_ENTRIES;

private static List<WoodTypeEntry> getDefaultEntries() {
if (DEFAULT_ENTRIES == null) {
final String mcModId = Mods.Names.WIZARDRY;
return DEFAULT_ENTRIES = Arrays.asList(
new WoodTypeEntry.Builder(mcModId, "wisdom")
.log(Mods.Wizardry.getItem("wisdom_wood_log", 1)).removeCharcoalRecipe()
.planks(Mods.Wizardry.getItem("wisdom_wood_planks", 1), "wisdom_wood/planks")
.slab(Mods.Wizardry.getItem("wisdom_wood_slab", 1), "wisdom_wood/slab")
.fence(Mods.Wizardry.getItem("wisdom_wood_fence", 1), "wisdom_wood/fence")
.fenceGate(Mods.Wizardry.getItem("wisdom_wood_fence_gate", 1), "wisdom_wood/fence_gate")
.stairs(Mods.Wizardry.getItem("wisdom_wood_stairs", 1), "wisdom_wood/stairs")
.door(Mods.Wizardry.getItem("wisdom_wood_door", 1), "wisdom_wood/door")
.registerAllUnificationInfo()
.build());
}
return DEFAULT_ENTRIES;
}

public static void init() {
for (WoodTypeEntry entry : getDefaultEntries()) {
GTWPWoodRecipeLoader.removePlankRecipe(false, entry);

GTWPWoodRecipeLoader.registerWoodTypeRecipe(false, entry);
GTWPWoodRecipeLoader.addCuttingRecipe(entry);
GTWPWoodRecipeLoader.addSawmillRecipe(entry);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ public static void registerWoodTypeRecipe(boolean randomRecipeID, @NotNull WoodT

// stairs
if (!entry.stairs.isEmpty()) {
final boolean hasStairRecipe = entry.stairsRecipeName != null;
if (entry.addStairsCraftingRecipe) {
ModHandler.addShapedRecipe(hasStairRecipe ? prefix + entry.stairsRecipeName : prefix + name + "_stairs",
GTUtility.copy(4, entry.stairs),
"P ", "PP ", "PPP",
'P', entry.planks.copy());
if (entry.stairsRecipeName != null) {
ModHandler.removeRecipeByName(new ResourceLocation(entry.modid, entry.stairsRecipeName));
}
ModHandler.addShapedRecipe(prefix + name + "_stairs", GTUtility.copy(4, entry.stairs),
"P ", "PP ", "PPP",
'P', entry.planks.copy());

// plank -> stairs assembling
RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder()
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/github/gtexpert/gtwp/module/Modules.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public class Modules implements IModuleContainer {
public static final String MODULE_IDS = "ids_integration";
public static final String MODULE_MWORLD = "mworld_integration";
public static final String MODULE_BOP = "bop_integration";
public static final String MODULE_IaF = "IaF_integration";
public static final String MODULE_IaF = "iaf_integration";
public static final String MODULE_WIZARDRY = "wizardry_integration";

@Override
public String getID() {
Expand Down

0 comments on commit dcfa472

Please sign in to comment.