mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-16 01:55:11 +00:00
Also changes like all packages inb4 "jared changes a package name in ModTweaker2 breaking compatability with everything" drama tweet.
41 lines
1.1 KiB
Java
41 lines
1.1 KiB
Java
package modtweaker2.mods.tconstruct.handlers;
|
|
|
|
import java.util.List;
|
|
|
|
import minetweaker.MineTweakerAPI;
|
|
import modtweaker2.mods.tconstruct.TConstructHelper;
|
|
import modtweaker2.util.BaseListRemoval;
|
|
import stanhebben.zenscript.annotations.ZenClass;
|
|
import stanhebben.zenscript.annotations.ZenMethod;
|
|
import tconstruct.library.modifier.ItemModifier;
|
|
|
|
@ZenClass("mods.tconstruct.Modifiers")
|
|
public class Modifiers {
|
|
@ZenMethod
|
|
public static void remove(String mod) {
|
|
MineTweakerAPI.apply(new Remove(mod));
|
|
}
|
|
|
|
//Searches through the modifiers and removes the first valid entry
|
|
private static class Remove extends BaseListRemoval {
|
|
private final String check;
|
|
|
|
public Remove(String check) {
|
|
super("Modifier", TConstructHelper.modifiers);
|
|
this.check = check;
|
|
}
|
|
|
|
@Override
|
|
public void apply() {
|
|
for (ItemModifier m : (List<ItemModifier>) list) {
|
|
if (m.key.equals(check)) {
|
|
recipe = m;
|
|
break;
|
|
}
|
|
}
|
|
|
|
list.remove(recipe);
|
|
}
|
|
}
|
|
}
|