Skip to content

Commit

Permalink
Soft REI dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Sep 16, 2023
1 parent 7e98553 commit 4afc5cb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ allprojects {

tasks {
jar {
manifest.attributes("Implementation-Version" to project.version)
manifest.attributes("Implementation-Version" to provider { project.version })
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package dev.su5ed.sinytra.connectorextras.reibridge;

import com.google.common.base.Suppliers;
import me.shedaniel.rei.fabric.PluginDetectorImpl;
import me.shedaniel.rei.impl.init.PluginDetector;
import net.minecraftforge.fml.common.Mod;

import java.util.function.Supplier;

@Mod(REIBridge.MODID)
@Mod("connectorextras_rei_bridge")
public class REIBridge {
public static final String MODID = "connectorextras_rei_bridge";
public static final Supplier<PluginDetector> FABRIC_PLUGIN_DETECTOR = Suppliers.memoize(PluginDetectorImpl::new);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dev.su5ed.sinytra.connectorextras.reibridge;

import com.google.common.base.Suppliers;
import me.shedaniel.rei.fabric.PluginDetectorImpl;
import me.shedaniel.rei.impl.init.PluginDetector;

import java.util.function.Supplier;

public final class REIBridgeSetup {
public static final Supplier<PluginDetector> FABRIC_PLUGIN_DETECTOR = Suppliers.memoize(PluginDetectorImpl::new);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.su5ed.sinytra.connectorextras.reibridge.mixin;

import dev.su5ed.sinytra.connectorextras.reibridge.REIBridge;
import dev.su5ed.sinytra.connectorextras.reibridge.REIBridgeSetup;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.impl.init.PluginDetector;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -13,7 +13,7 @@ public class RoughlyEnoughItemsCoreMixin {

@Inject(method = "onInitialize", at = @At("HEAD"), remap = false)
private void initializeFabricPlugin(CallbackInfo ci) {
PluginDetector detector = REIBridge.FABRIC_PLUGIN_DETECTOR.get();
PluginDetector detector = REIBridgeSetup.FABRIC_PLUGIN_DETECTOR.get();
detector.detectCommonPlugins();
detector.detectServerPlugins();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.su5ed.sinytra.connectorextras.reibridge.mixin.client;

import dev.su5ed.sinytra.connectorextras.reibridge.REIBridge;
import dev.su5ed.sinytra.connectorextras.reibridge.REIBridgeSetup;
import me.shedaniel.rei.RoughlyEnoughItemsCoreClient;
import me.shedaniel.rei.impl.init.PluginDetector;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -13,7 +13,7 @@ public class RoughlyEnoughItemsCoreClientMixin {

@Inject(method = "onInitializeClient", at = @At(value = "INVOKE", target = "Lme/shedaniel/rei/RoughlyEnoughItemsCore;getPluginDetector()Lme/shedaniel/rei/impl/init/PluginDetector;"), remap = false)
private void initializeFabricPluginClient(CallbackInfo ci) {
PluginDetector detector = REIBridge.FABRIC_PLUGIN_DETECTOR.get();
PluginDetector detector = REIBridgeSetup.FABRIC_PLUGIN_DETECTOR.get();
detector.detectClientPlugins().get().run();
}
}
6 changes: 0 additions & 6 deletions rei-bridge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ displayTest = 'IGNORE_ALL_VERSION'
versionRange="[1.20.1,1.21)"
ordering="NONE"
side="BOTH"
[[dependencies.connectorextras_rei_bridge]]
modId="roughlyenoughitems"
mandatory=true
versionRange="[0,)"
ordering="NONE"
side="BOTH"

0 comments on commit 4afc5cb

Please sign in to comment.