Skip to content

Commit

Permalink
Migrate to new RecipeMap (#26)
Browse files Browse the repository at this point in the history
* Cleanup dependencies

* Migrate to new RecipeMap

* update gradle+bs+deps

---------

Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
miozune and Dream-Master authored Dec 3, 2023
1 parent 8d95b2c commit fdf4e18
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 89 deletions.
33 changes: 0 additions & 33 deletions .github/scripts/test-no-error-reports.sh

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
src/main/resources/mixins.*([!.]).json
*.bat
*.DS_Store
!gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
30 changes: 7 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1697697256
//version: 1701530445
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit

buildscript {
repositories {
mavenCentral()

maven {
name 'forge'
url 'https://maven.minecraftforge.net'
}
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}

mavenLocal()
}
}
Expand Down Expand Up @@ -302,7 +287,7 @@ if (apiPackage) {
}

if (accessTransformersFile) {
for (atFile in accessTransformersFile.split(",")) {
for (atFile in accessTransformersFile.split(" ")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
Expand Down Expand Up @@ -646,7 +631,7 @@ repositories {

def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.7.1"
def mixinProviderVersion = "0.1.13"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
Expand Down Expand Up @@ -793,12 +778,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}

dependencies {
def lwjgl3ifyVersion = '1.5.1'
def lwjgl3ifyVersion = '1.5.7'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
}

java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
Expand Down Expand Up @@ -1187,9 +1172,8 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
}
}

repositories {
if (usesMavenPublishing.toBoolean()) {
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
maven {
url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
Expand Down Expand Up @@ -1311,7 +1295,7 @@ def addCurseForgeRelation(String type, String name) {

// Updating

def buildscriptGradleVersion = "8.2.1"
def buildscriptGradleVersion = "8.5"

tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
Expand Down
15 changes: 6 additions & 9 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Add your dependencies here

dependencies {
compile('com.github.GTNewHorizons:Botania:1.10.2-GTNH:dev')
compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.72:dev')
api('com.github.GTNewHorizons:Botania:1.10.3-GTNH:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
api("com.github.GTNewHorizons:Avaritia:1.46:dev")

compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly("com.github.GTNewHorizons:Chisel:2.12.3-GTNH:dev") {transitive = false}

runtimeOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') {transitive=false}
runtimeOnly('com.github.GTNewHorizons:TinkersConstruct:1.10.9-GTNH:dev') {transitive=false}
runtimeOnly('com.github.GTNewHorizons:Mantle:0.3.7:dev') {transitive=false}

compile("com.github.GTNewHorizons:Chisel:2.11.4-GTNH:dev") {transitive = false}
compile("com.github.GTNewHorizons:Avaritia:1.46:dev") {transitive = false}
runtimeOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev')
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.fuzzycraft.botanichorizons.mod;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
Expand All @@ -19,12 +18,15 @@
import net.fuzzycraft.botanichorizons.patches.ThaumcraftAspects;
import net.fuzzycraft.botanichorizons.patches.ThaumcraftPatches;

import static gregtech.api.enums.Mods.Avaritia;
import static gregtech.api.enums.Mods.Chisel;

@Mod(modid = ForgeMod.MOD_ID, name = ForgeMod.MOD_NAME, version = ForgeMod.VERSION, dependencies = ForgeMod.DEPENDENCIES)
public class ForgeMod {
public static final String MOD_ID = "botanichorizons";
public static final String MOD_NAME = MOD_ID;
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String DEPENDENCIES = "required-after:Baubles;required-after:Thaumcraft;required-after:Botania;required-after:gregtech;after:witchery;after:BiomesOPlenty;after:dreamcraft;required-after:TConstruct;required-after:Avaritia;after:chisel";
public static final String DEPENDENCIES = "required-after:Baubles;required-after:Thaumcraft;required-after:Botania;required-after:gregtech;after:witchery;after:BiomesOPlenty;after:dreamcraft;required-after:Avaritia;after:chisel";

@Mod.Instance(MOD_ID)
public static ForgeMod instance;
Expand All @@ -51,7 +53,7 @@ public void preInit(FMLPreInitializationEvent event) {
public void postInit(FMLPostInitializationEvent event) {
ThaumcraftAspects.registerAspects();
ThaumcraftPatches.applyPatches();
if (Loader.isModLoaded("chisel")) {
if (Chisel.isModLoaded()) {
ChiselPatches.applyPatches();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.fuzzycraft.botanichorizons.patches;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.ToolDictNames;
Expand Down Expand Up @@ -30,6 +29,8 @@
import java.util.Arrays;
import java.util.List;

import static gregtech.api.enums.Mods.NewHorizonsCoreMod;

public class CraftingPatches {
public static void applyPatches() {

Expand Down Expand Up @@ -297,7 +298,7 @@ public static void applyPatches() {
addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 6), new ItemStack(ModItems.lens), "blockObsidian", "compressedCobblestone1x");
ModCraftingRecipes.recipeLensGravity = BotaniaAPI.getLatestAddedRecipe();

if(Loader.isModLoaded("dreamcraft")) {
if(NewHorizonsCoreMod.isModLoaded()) {
addOreDictRecipe(new ItemStack(ModItems.lens, 1, 7),
" P ", "ALA", " R ",
'P', Item.itemRegistry.getObject("dreamcraft:item.DiamondDrillTip"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.ToolDictNames;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.fuzzycraft.botanichorizons.util.Constants;
import net.minecraft.block.Block;
Expand Down Expand Up @@ -152,15 +152,15 @@ public static void applyPatches() {
GT_ModHandler.addExtractionRecipe(new ItemStack(ModBlocks.prismarine), new ItemStack(ModItems.manaResource, 9, Constants.MANARESOURCE_META_PRISMARINE));

GT_ModHandler.addExtractionRecipe(new ItemStack(ModBlocks.reedBlock), new ItemStack(Items.reeds, 8));
GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true,
RecipeMaps.assemblerRecipes.addRecipe(true,
new ItemStack[]{new ItemStack(Items.reeds, 8), GT_Utility.getIntegratedCircuit(16)},
new ItemStack[]{new ItemStack(ModBlocks.reedBlock)},
null, null, null,
80, 24, 0
);

// Livingwood and Crystal Bows
GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true,
RecipeMaps.assemblerRecipes.addRecipe(true,
new ItemStack[]{
new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_TWIG_WOOD),
new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_STRING),
Expand All @@ -170,7 +170,7 @@ public static void applyPatches() {
null, null, null,
80, 24, 0
);
GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true,
RecipeMaps.assemblerRecipes.addRecipe(true,
new ItemStack[]{
new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_TWIG_DREAM),
new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_STRING),
Expand All @@ -191,7 +191,7 @@ public static void applyPatches() {
'P', new ItemStack(choice, 1, i % 16),
'S', LibOreDict.MANAWEAVE_CLOTH
);
GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true,
RecipeMaps.assemblerRecipes.addRecipe(true,
new ItemStack[]{fabric, new ItemStack(choice, 2, i % 16), GT_Utility.getIntegratedCircuit(4)},
new ItemStack[]{output},
null, null, null,
Expand All @@ -209,7 +209,7 @@ public static void applyPatches() {
}

private static void addMixerRecipe(ItemStack output, int volt, int ticks, ItemStack... input) {
GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(
RecipeMaps.mixerRecipes.addRecipe(
true,
input,
new ItemStack[]{output},
Expand All @@ -228,7 +228,7 @@ private static IRecipe addSlabRecipe(ItemStack output, ItemStack input, int circ
ItemStack circuitStack = GT_Utility.getIntegratedCircuit(circuit);
inputs = new ItemStack[]{input, circuitStack};
}
GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(
RecipeMaps.cutterRecipes.addRecipe(
true,
inputs,
new ItemStack[]{output},
Expand All @@ -237,7 +237,7 @@ private static IRecipe addSlabRecipe(ItemStack output, ItemStack input, int circ
null,
ticks, volt, 0
);
GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(
RecipeMaps.cutterRecipes.addRecipe(
true,
inputs,
new ItemStack[]{output},
Expand All @@ -246,7 +246,7 @@ private static IRecipe addSlabRecipe(ItemStack output, ItemStack input, int circ
null,
ticks, volt, 0
);
GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(
RecipeMaps.cutterRecipes.addRecipe(
true,
inputs,
new ItemStack[]{output},
Expand Down Expand Up @@ -276,7 +276,7 @@ private static IRecipe addSlabRecipe(ItemStack output, ItemStack input, int circ
}

public static IRecipe addHammerRecipe(ItemStack output, ItemStack input) {
GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(
RecipeMaps.hammerRecipes.addRecipe(
true,
new ItemStack[]{input},
new ItemStack[]{output},
Expand Down Expand Up @@ -339,7 +339,7 @@ public static IRecipe addQuartzRecipes(int quartzMeta, @Nullable Object ingredie
}

public static void addGlassPane(Block paneBlock, Block inputBlock) {
GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(
RecipeMaps.cutterRecipes.addRecipe(
true,
new ItemStack[]{new ItemStack(inputBlock, 3)},
new ItemStack[]{new ItemStack(paneBlock, 8)},
Expand All @@ -348,7 +348,7 @@ public static void addGlassPane(Block paneBlock, Block inputBlock) {
null,
100, 7, 0
);
GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(
RecipeMaps.cutterRecipes.addRecipe(
true,
new ItemStack[]{new ItemStack(inputBlock, 3)},
new ItemStack[]{new ItemStack(paneBlock, 8)},
Expand All @@ -357,7 +357,7 @@ public static void addGlassPane(Block paneBlock, Block inputBlock) {
null,
100, 7, 0
);
GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(
RecipeMaps.cutterRecipes.addRecipe(
true,
new ItemStack[]{new ItemStack(inputBlock, 3)},
new ItemStack[]{new ItemStack(paneBlock, 8)},
Expand Down

0 comments on commit fdf4e18

Please sign in to comment.