Skip to content

Commit

Permalink
switch to less restrictive EMI hiding
Browse files Browse the repository at this point in the history
fixes #67
  • Loading branch information
rlnt committed Mar 1, 2024
1 parent 7ff762b commit bb0a3b5
Showing 1 changed file with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.almostreliable.unified.config.UnifyConfig;
import com.almostreliable.unified.recipe.CRTLookup;
import dev.emi.emi.api.EmiEntrypoint;
import dev.emi.emi.api.EmiInitRegistry;
import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
import dev.emi.emi.api.recipe.EmiRecipe;
Expand All @@ -18,8 +17,26 @@
@EmiEntrypoint
public class AlmostEMI implements EmiPlugin {

// temporarily disabled to due to it breaking transfer handlers
// @Override
// public void initialize(EmiInitRegistry registry) {
// AlmostUnifiedFallbackRuntime.getInstance().reload();
//
// var emiDisabled = AlmostUnified.getRuntime()
// .getUnifyConfig()
// .map(UnifyConfig::reiOrJeiDisabled)
// .orElse(false);
// if (emiDisabled) return;
//
// for (ItemStack item : HideHelper.createHidingList(AlmostUnified.getRuntime())) {
// registry.disableStack(EmiStack.of(item));
// }
// }

@Override
public void initialize(EmiInitRegistry registry) {
public void register(EmiRegistry registry) {
registry.addRecipeDecorator(new IndicatorDecorator());

AlmostUnifiedFallbackRuntime.getInstance().reload();

var emiDisabled = AlmostUnified.getRuntime()
Expand All @@ -29,15 +46,10 @@ public void initialize(EmiInitRegistry registry) {
if (emiDisabled) return;

for (ItemStack item : HideHelper.createHidingList(AlmostUnified.getRuntime())) {
registry.disableStack(EmiStack.of(item));
registry.removeEmiStacks(EmiStack.of(item));
}
}

@Override
public void register(EmiRegistry registry) {
registry.addRecipeDecorator(new IndicatorDecorator());
}

private static class IndicatorDecorator implements EmiRecipeDecorator {

@Override
Expand Down

0 comments on commit bb0a3b5

Please sign in to comment.