Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Migrate to new RecipeMap (#104)
Browse files Browse the repository at this point in the history
* 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 b6d165f commit 5f80611
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 87 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
25 changes: 5 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1699290261
//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 @@ -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 @@ -1310,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
30 changes: 15 additions & 15 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
*/

dependencies {
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.83:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev')
api("com.github.GTNewHorizons:EnderCore:0.2.18:dev")
api("com.github.GTNewHorizons:EnderIO:2.5.4:dev")
api("com.github.GTNewHorizons:EnderIO:2.5.6:dev")
api("com.github.GTNewHorizons:ForestryMC:4.7.0:dev")
api("com.github.GTNewHorizons:ModularUI:1.1.22:dev")
api("com.github.GTNewHorizons:Mobs-Info:0.1.10-GTNH:dev")
api("com.github.GTNewHorizons:ModularUI:1.1.24:dev")
api("com.github.GTNewHorizons:Mobs-Info:0.1.12-GTNH:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.7.9-GTNH:dev")
//compileOnly("curse.maven:extrautilities-225561:2264384") {
// transitive = false
//}
compileOnly("com.github.GTNewHorizons:GTplusplus:1.10.30:dev")
compileOnly("com.github.GTNewHorizons:GTplusplus:1.10.37:dev")
{
transitive = false
}
Expand All @@ -61,19 +61,19 @@ dependencies {
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:bartworks:0.8.12:dev")
compileOnly("com.github.GTNewHorizons:bartworks:0.8.19:dev")
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.38:dev")
compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.43:dev")
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.5.2-GTNH:dev")
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.5.3-GTNH:dev")
{
transitive = false
}
runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.1.16:dev")
runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.3:dev")
runtimeOnly("curse.maven:cofh-core-69162:2388751")
/*
{
Expand All @@ -83,12 +83,12 @@ dependencies {
*/

// For testing
//runtimeOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.5.2-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.10.30:dev")
//runtimeOnly("com.github.GTNewHorizons:harvestcraft:1.1.1-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.38:dev")
//runtimeOnly("com.github.GTNewHorizons:OpenBlocks:1.7.1-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:bartworks:0.8.12:dev")
//runtimeOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.5.3-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.10.37:dev")
//runtimeOnly("com.github.GTNewHorizons:harvestcraft:1.1.3-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.43:dev")
//runtimeOnly("com.github.GTNewHorizons:OpenBlocks:1.8.1-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:bartworks:0.8.19:dev")
//runtimeOnly("com.github.GTNewHorizons:CraftTweaker:3.2.13:dev")
//api("com.github.GTNewHorizons:SpecialMobs:3.4.3:dev")
//api("com.github.GTNewHorizons:twilightforest:2.5.1:dev")
Expand Down
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
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,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
70 changes: 32 additions & 38 deletions src/main/java/kubatech/loaders/DEFCRecipes.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package kubatech.loaders;

import static gregtech.api.enums.GT_Values.E;
import static gregtech.api.enums.Mods.GregTech;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sMixerRecipes;
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
import static gregtech.api.recipe.RecipeMaps.mixerRecipes;

import java.util.Arrays;
import java.util.HashSet;

import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
Expand All @@ -23,30 +20,27 @@
import gregtech.api.enums.Materials;
import gregtech.api.enums.MaterialsUEVplus;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMapBackend;
import gregtech.api.recipe.RecipeMapBuilder;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.nei.formatter.SimpleSpecialValueFormatter;
import kubatech.Tags;
import kubatech.api.LoaderReference;

public class DEFCRecipes {

public static final GT_Recipe.GT_Recipe_Map sFusionCraftingRecipes = new GT_Recipe.GT_Recipe_Map(
new HashSet<>(16),
"kubatech.defusioncrafter",
"Draconic Evolution Fusion Crafter",
null,
GregTech.getResourcePath("textures/gui/basicmachines", "FusionCrafter"),
9,
1,
1,
0,
1,
"Tier Casing: ",
1,
E,
false,
true).setSlotOverlay(false, false, UITexture.fullImage(Tags.MODID, "gui/slot/fusion_crafter"));
public static final RecipeMap<RecipeMapBackend> fusionCraftingRecipes = RecipeMapBuilder
.of("kubatech.defusioncrafter")
.maxIO(9, 1, 1, 1)
.minInputs(1, 0)
.neiSpecialInfoFormatter(new SimpleSpecialValueFormatter("kubatech.defusioncrafter.tier"))
.slotOverlays(
(index, isFluid, isOutput,
isSpecial) -> !isFluid && !isOutput ? UITexture.fullImage(Tags.MODID, "gui/slot/fusion_crafter") : null)
.build();

public static void addRecipes() {

Expand All @@ -62,7 +56,7 @@ public static void addRecipes() {
.fluidOutputs(new FluidStack(FluidRegistry.getFluid("molten.dragonblood"), 288))
.eut(1_966_080)
.duration(14_000)
.addTo(sMixerRecipes);
.addTo(mixerRecipes);
}

// Casings
Expand All @@ -75,7 +69,7 @@ public static void addRecipes() {
.itemOutputs(kubatech.api.enums.ItemList.DEFCCasingBase.get(1))
.eut(491_520)
.duration(24000)
.addTo(sAssemblerRecipes);
.addTo(assemblerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(
GT_ModHandler.getModItem("dreamcraft", "tile.BloodyIchorium", 1, 0),
Expand All @@ -84,7 +78,7 @@ public static void addRecipes() {
.itemOutputs(kubatech.api.enums.ItemList.DEFCCasingT1.get(1))
.eut(491_520)
.duration(24000)
.addTo(sAssemblerRecipes);
.addTo(assemblerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(
kubatech.api.enums.ItemList.DEFCCasingT1.get(1),
Expand All @@ -94,7 +88,7 @@ public static void addRecipes() {
.itemOutputs(kubatech.api.enums.ItemList.DEFCCasingT2.get(1))
.eut(491_520)
.duration(24000)
.addTo(sAssemblerRecipes);
.addTo(assemblerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(
kubatech.api.enums.ItemList.DEFCCasingT2.get(1),
Expand All @@ -104,7 +98,7 @@ public static void addRecipes() {
.itemOutputs(kubatech.api.enums.ItemList.DEFCCasingT3.get(1))
.eut(1_996_080)
.duration(12000)
.addTo(sAssemblerRecipes);
.addTo(assemblerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(
kubatech.api.enums.ItemList.DEFCCasingT3.get(1),
Expand All @@ -114,7 +108,7 @@ public static void addRecipes() {
.itemOutputs(kubatech.api.enums.ItemList.DEFCCasingT4.get(1))
.eut(7_864_320)
.duration(12000)
.addTo(sAssemblerRecipes);
.addTo(assemblerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(
kubatech.api.enums.ItemList.DEFCCasingT4.get(1),
Expand All @@ -124,7 +118,7 @@ public static void addRecipes() {
.itemOutputs(kubatech.api.enums.ItemList.DEFCCasingT5.get(1))
.eut(31_457_280)
.duration(12000)
.addTo(sAssemblerRecipes);
.addTo(assemblerRecipes);

fusionRecipes();
conversionRecipes();
Expand All @@ -147,7 +141,7 @@ private static void addOldHiddenRecipe(GT_Recipe recipe) {
})
.toArray(ItemStack[]::new);
recipe.mHidden = true;
sFusionCraftingRecipes.add(recipe);
fusionCraftingRecipes.add(recipe);
}

private static void conversionRecipes() {
Expand Down Expand Up @@ -179,7 +173,7 @@ private static void fusionRecipes() {
.eut(500_000)
.duration(400)
.specialValue(1)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);

GT_Values.RA.stdBuilder()
Expand All @@ -194,7 +188,7 @@ private static void fusionRecipes() {
.eut(2_000_000)
.duration(800)
.specialValue(2)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);

if (Loader.isModLoaded("supersolarpanel")) {
Expand All @@ -210,7 +204,7 @@ private static void fusionRecipes() {
.eut(8_000_000)
.duration(1600)
.specialValue(3)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);
} else {
GT_Values.RA.stdBuilder()
Expand All @@ -225,7 +219,7 @@ private static void fusionRecipes() {
.eut(8_000_000)
.duration(1600)
.specialValue(3)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);
}

Expand All @@ -241,7 +235,7 @@ private static void fusionRecipes() {
.eut(24_000_000)
.duration(3200)
.specialValue(4)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);

// ENERGY CORES
Expand All @@ -257,7 +251,7 @@ private static void fusionRecipes() {
.eut(500_000)
.duration(1000)
.specialValue(2)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);

GT_Values.RA.stdBuilder()
Expand All @@ -271,7 +265,7 @@ private static void fusionRecipes() {
.eut(2_000_000)
.duration(2000)
.specialValue(3)
.addTo(sFusionCraftingRecipes)
.addTo(fusionCraftingRecipes)
.forEach(DEFCRecipes::addOldHiddenRecipe);

// Dragon Blood
Expand All @@ -287,7 +281,7 @@ private static void fusionRecipes() {
.duration(4200)
.specialValue(3)
.noOptimize()
.addTo(sFusionCraftingRecipes);
.addTo(fusionCraftingRecipes);

GT_Values.RA.stdBuilder()
.itemInputs(
Expand All @@ -299,7 +293,7 @@ private static void fusionRecipes() {
.duration(3600)
.specialValue(3)
.noOptimize()
.addTo(sFusionCraftingRecipes);
.addTo(fusionCraftingRecipes);
}
}
}
Loading

0 comments on commit 5f80611

Please sign in to comment.