Skip to content

Commit

Permalink
Update GS, GT, GCYM, Remove GS Mixin, Fix Recycling Helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Feb 20, 2024
1 parent e424e25 commit 069a849
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 83 deletions.
28 changes: 16 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1707604215
//version: 1707682661
/*
* DO NOT CHANGE THIS FILE!
* Also, you may replace this file at any time if there is an update available.
Expand All @@ -24,9 +24,9 @@ plugins {
id 'eclipse'
id 'maven-publish'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.28'
id 'net.darkhax.curseforgegradle' version '1.1.17' apply false
id 'com.modrinth.minotaur' version '2.8.6' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.33'
id 'net.darkhax.curseforgegradle' version '1.1.18' apply false
id 'com.modrinth.minotaur' version '2.8.7' apply false
id 'com.diffplug.spotless' version '6.13.0' apply false
id 'com.palantir.git-version' version '3.0.0' apply false
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
Expand Down Expand Up @@ -495,7 +495,7 @@ configurations {
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
}

String mixinProviderSpec = 'zone.rong:mixinbooter:8.9'
String mixinProviderSpec = 'zone.rong:mixinbooter:9.1'
dependencies {
if (usesMixins.toBoolean()) {
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
Expand Down Expand Up @@ -523,8 +523,8 @@ dependencies {
}

if (enableModernJavaSyntax.toBoolean()) {
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.1'
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.1') {
transitive = false
}
// workaround for https://github.com/bsideup/jabel/issues/174
Expand All @@ -533,8 +533,8 @@ dependencies {
patchedMinecraft 'me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0'

// allow Jabel to work in tests
testAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:1.0.0"
testCompileOnly("com.github.bsideup.jabel:jabel-javac-plugin:1.0.0") {
testAnnotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:1.0.1"
testCompileOnly("com.github.bsideup.jabel:jabel-javac-plugin:1.0.1") {
transitive = false // We only care about the 1 annotation class
}
testCompileOnly "me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0"
Expand All @@ -547,9 +547,13 @@ dependencies {
}

if (includeCommonDevEnvMods.toBoolean()) {
implementation 'mezz.jei:jei_1.12.2:4.16.1.302'
//noinspection DependencyNotationArgument
implementation rfg.deobf('curse.maven:top-245211:2667280') // TOP 1.4.28
if (!(modId.equals('jei'))) {
implementation 'mezz.jei:jei_1.12.2:4.16.1.302'
}
if (!(modId.equals('theoneprobe'))) {
//noinspection DependencyNotationArgument
implementation rfg.deobf('curse.maven:top-245211:2667280') // TOP 1.4.28
}
}
}

Expand Down
59 changes: 39 additions & 20 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,65 @@
//file:noinspection DependencyNotationArgument
// TODO remove when fixed in RFG ^
/*
* Add your dependencies here. Common configurations:
* - implementation("group:name:version:classifier"): if you need this for internal implementation details of the mod.
* Available at compiletime and runtime for your environment.
*
* - compileOnlyApi("g:n:v:c"): if you need this for internal implementation details of the mod.
* Available at compiletime but not runtime for your environment.
*
* Add your dependencies here. Supported configurations:
* - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod
* Available at runtime and compiletime for mods depending on this mod
* - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API
* Available at runtime but not compiletime for mods depending on this mod
* - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods
* Not available at all for mods depending on this mod, only visible at compiletime for this mod
* - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod
* Available at compiletime but not runtime for mods depending on this mod
* - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency
* Not available at all for mods depending on this mod, only visible at runtime for this mod
* - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime,
* but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing
* - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime
* Available at runtime for mods depending on this mod
* - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry
* - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main
*
* - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name
* Requires you to enable usesShadowedDependencies in gradle.properties
* For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md
*
* - testCONFIG("g:n:v:c"): replace CONFIG by one of the above, same as above but for the test sources instead of main
* You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed,
* but use this sparingly as it can break using your mod as another mod's dependency if you're not careful.
*
* You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed.
* To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven,
* or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file.
*
* To add a mod with CurseMaven, replace '("g:n:v:c")' in the above with 'rfg.deobf("curse.maven:project_slug-project_id:file_id")'
* Example: implementation rfg.deobf("curse.maven:gregtech-ce-unofficial-557242:4527757")
* Example: devOnlyNonPublishable(rfg.deobf("curse.maven:top-245211:2667280"))
*
* To shadow a dependency, use 'shadowImplementation'. For more info, see https://github.com/GregTechCEu/Buildscripts/blob/master/docs/shadow.md
* Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not.
* The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published.
*
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
* For more details, see https://docs.gradle.org/8.4/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
/* -------------------------------- Hard Deps -------------------------------- */

// CCL, CT dep for GT (from CurseForge)
// CCL, CT dep for GT (from GTCEu Maven)
// Included to allow compiling of certain Draconic Evolution Mixin Classes, and as transitive deps
implementation rfg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848") // Version 3.2.3.358
implementation ("codechicken:codechickenlib:3.2.3.358") // Version 3.2.3.358

// GT and GCYM, pretty much the 'core' of this coremod (from Modrinth)
// GT and GCYM, pretty much the 'core' of this coremod (from GTCEu Maven)
// GT Has Mixins! CHECK MIXINS FOR COMPAT AFTER UPDATING!
implementation rfg.deobf("maven.modrinth:gregtech-ce-unofficial:VpJ9gePM") // Version 2.8.5
implementation rfg.deobf("maven.modrinth:gregicality-multiblocks:4BnBEiBw") // Version 1.2.7
implementation ("gregtech:gregtech:2.8.7-beta") {
transitive = false
} // Version 2.8.7
implementation ("gregicality:GregicalityMultiblocks:1.2.8") {
transitive = false
} // Version 1.2.8

// Pack Mode (from CurseForge)
implementation rfg.deobf("curse.maven:packmode-278398:2567799") // Version 1.2.0

// GroovyScript (from Cleanroom Maven)
// IF THIS IS UPDATED, THE GROOVYSCRIPT MIXIN MAY NEED TO BE REMOVED!!!
implementation ("com.cleanroommc:groovyscript:0.7.3") {
implementation ("com.cleanroommc:groovyscript:0.8.0") {
transitive = false
} // Version 0.7.3, transitive false is needed otherwise groovy pulls in extra JEI
} // Version 0.8.0


/* -------------------------------- Compile Time Only Deps -------------------------------- */
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public class LabsLateMixin implements ILateMixinLoader {
new AbstractMap.SimpleImmutableEntry<>(LabsValues.GREGTECH_MODID, true),
new AbstractMap.SimpleImmutableEntry<>(LabsValues.JEI_MODID, true),
new AbstractMap.SimpleImmutableEntry<>(LabsValues.ROCKETRY_MODID,
LabsConfig.modIntegration.enableAdvancedRocketryIntegration),
new AbstractMap.SimpleImmutableEntry<>(LabsValues.GROOVY_MODID, true))
LabsConfig.modIntegration.enableAdvancedRocketryIntegration))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import com.cleanroommc.groovyscript.api.GroovyBlacklist;
import com.cleanroommc.groovyscript.registry.VirtualizedRegistry;
import com.nomiceu.nomilabs.integration.jei.JEIPlugin;
import com.nomiceu.nomilabs.util.ItemMeta;
import com.nomiceu.nomilabs.util.ItemTagMeta;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.stack.ItemMaterialInfo;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.tuple.Pair;

Expand Down Expand Up @@ -41,13 +43,13 @@ public void changeMaterialDecomp(CompositionSpecification spec) {
}
}

public static class ReplaceRecyclingManager extends VirtualizedRegistry<Pair<ItemStack, ItemMaterialInfo>> {
public final Map<ItemStack, ItemMaterialInfo> needReloading = new HashMap<>();
public static class ReplaceRecyclingManager extends VirtualizedRegistry<Pair<ItemMeta, ItemMaterialInfo>> {
public final Map<ItemMeta, ItemMaterialInfo> needReloading = new Object2ObjectOpenHashMap<>();

@Override
public void onReload() {
restoreFromBackup().forEach((pair) -> {
OreDictUnifier.registerOre(pair.getLeft(), pair.getRight());
OreDictUnifier.registerOre(pair.getLeft().toStack(), pair.getRight());
needReloading.put(pair.getLeft(), pair.getRight());
});
}
Expand All @@ -59,13 +61,14 @@ public void afterScriptLoad() {
}

@Override
protected boolean compareRecipe(Pair<ItemStack, ItemMaterialInfo> a, Pair<ItemStack, ItemMaterialInfo> b) {
return ItemTagMeta.compare(a.getKey(), b.getKey());
protected boolean compareRecipe(Pair<ItemMeta, ItemMaterialInfo> a, Pair<ItemMeta, ItemMaterialInfo> b) {
return a.getKey().equals(b.getKey());
}

public void registerOre(ItemStack stack, ItemMaterialInfo info) {
addBackup(Pair.of(stack, OreDictUnifier.getMaterialInfo(stack)));
needReloading.put(stack, info);
var in = new ItemTagMeta(stack);
addBackup(Pair.of(in, OreDictUnifier.getMaterialInfo(stack)));
needReloading.put(in, info);
OreDictUnifier.registerOre(stack, info);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/nomiceu/nomilabs/groovy/ReplaceRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ public static void reloadRecyclingRecipes() {
reloadingRecycling = true;
var time = System.currentTimeMillis();
for (var modified : LabsVirtualizedRegistries.REPLACE_RECYCLING_MANAGER.needReloading.entrySet()) {
var stack = modified.getKey();
NomiLabs.LOGGER.debug("Removing Recycling Recipes for {} @ {}...", stack.getItem().getRegistryName(), stack.getMetadata());
var itemMeta = modified.getKey();
var stack = itemMeta.toStack();
NomiLabs.LOGGER.debug("Removing Recycling Recipes for {} @ {}...", itemMeta.getItem().getRegistryName(), itemMeta.getMeta());
removeRecyclingRecipe(RecipeMaps.ARC_FURNACE_RECIPES, RecipeCategories.ARC_FURNACE_RECYCLING, stack, Materials.Oxygen.getFluid());
removeRecyclingRecipe(RecipeMaps.MACERATOR_RECIPES, RecipeCategories.MACERATOR_RECYCLING, stack, null);
removeRecyclingRecipe(RecipeMaps.EXTRACTOR_RECIPES, RecipeCategories.EXTRACTOR_RECYCLING, stack, null);
if (modified.getValue() == null) continue;
NomiLabs.LOGGER.debug("Adding Recycling Recipes for {} @ {}...", stack.getItem().getRegistryName(), stack.getMetadata());
NomiLabs.LOGGER.debug("Adding Recycling Recipes for {} @ {}...", itemMeta.getItem().getRegistryName(), itemMeta.getMeta());
RecyclingRecipes.registerRecyclingRecipes(stack, modified.getValue().getMaterials(),false, null );
}
NomiLabs.LOGGER.info("Reloading Recycling Recipes took {}ms", System.currentTimeMillis() - time);
Expand Down

This file was deleted.

8 changes: 8 additions & 0 deletions src/main/java/com/nomiceu/nomilabs/util/ItemMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,12 @@ public static boolean compare(ItemStack a, ItemStack b) {
public ItemStack toStack() {
return new ItemStack(item, 1, meta);
}

public Item getItem() {
return item;
}

public int getMeta() {
return meta;
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/nomiceu/nomilabs/util/ItemTagMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ public ItemStack toStack() {
if (tag != null) stack.setTagCompound(tag);
return stack;
}

public NBTTagCompound getTag() {
return tag;
}
}
12 changes: 0 additions & 12 deletions src/main/resources/mixins.nomilabs.groovyscript.json

This file was deleted.

0 comments on commit 069a849

Please sign in to comment.