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.
This commit is contained in:
1 parent
4fd2551072
commit
ec562b62ea
187 files changed
+977
-991
No files matched your search
@@ -0,0 +1,40 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user