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

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Nov 23, 2023
1 parent ca2d2c0 commit 2c4a5d1
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ org.gradle.parallel=true
loader_version=0.14.17

# Mod Properties
mod_version=0.1.1-mc1.20.1
mod_version=0.1.2-mc1.20.1
maven_group=dm.earth
archives_base_name=CreateFabricREIBugFixDMEEdition

Expand Down
59 changes: 59 additions & 0 deletions src/main/java/ho/artisan/createreibugfix/CFREIBFMixinPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package ho.artisan.createreibugfix;

import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
import it.unimi.dsi.fastutil.objects.Object2BooleanOpenHashMap;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.List;
import java.util.Set;

public class CFREIBFMixinPlugin implements IMixinConfigPlugin {
private final Object2BooleanMap<String> conditionalMixins = new Object2BooleanOpenHashMap<>();

public CFREIBFMixinPlugin() {
boolean isREIInstalled = CreateFabricREIBugFixMod.isREIInstalled();
this.conditionalMixins.put("ho.artisan.createreibugfix.mixin.AssemblySpoutingMixin", isREIInstalled);
this.conditionalMixins.put("ho.artisan.createreibugfix.mixin.BasinCategoryMixin", isREIInstalled);
this.conditionalMixins.put("ho.artisan.createreibugfix.mixin.CreateDisplayMixin", isREIInstalled);
this.conditionalMixins.put("ho.artisan.createreibugfix.mixin.CrushingCategoryMixin", isREIInstalled);
this.conditionalMixins.put("ho.artisan.createreibugfix.mixin.MillingCategoryMixin", isREIInstalled);
this.conditionalMixins.put("ho.artisan.createreibugfix.mixin.SequencedAssemblyRecipeMixin", isREIInstalled);
}

@Override
public void onLoad(String mixinPackage) {

}

@Override
public String getRefMapperConfig() {
return null;
}

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return this.conditionalMixins.getOrDefault(mixinClassName, true);
}

@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {

}

@Override
public List<String> getMixins() {
return null;
}

@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {

}

@Override
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
public class CreateFabricREIBugFixMod implements ModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger(StringUtils.MODNAME);

public static boolean isREIInstalled() {
return FabricLoader.getInstance().isModLoaded("roughlyenoughitems");
}

@Override
public void onInitialize() {
LOGGER.info(StringUtils.MODNAME + " (" + StringUtils.MODID + ") " + " is loaded!");
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/createreibugfix.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "ho.artisan.createreibugfix.mixin",
"plugin": "ho.artisan.createreibugfix.CFREIBFMixinPlugin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"SequencedAssemblyRecipeMixin"
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"fabric": "*",
"minecraft": "1.20.x",
"java": ">=17",
"roughlyenoughitems": "*",
"create": "*"
}
}

0 comments on commit 2c4a5d1

Please sign in to comment.