mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-25 14:44:32 +00:00
Initial Comment
This commit is contained in:
commit
419ac849d0
276 files changed
+17939
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package modtweaker.mods.botania;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker.mods.botania.handlers.Apothecary;
|
||||
import modtweaker.mods.botania.handlers.ElvenTrade;
|
||||
import modtweaker.mods.botania.handlers.ManaInfusion;
|
||||
import modtweaker.mods.botania.handlers.Orechid;
|
||||
import modtweaker.mods.botania.handlers.RuneAltar;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
public class Botania {
|
||||
public Botania() {
|
||||
MineTweakerAPI.registerClass(Apothecary.class);
|
||||
MineTweakerAPI.registerClass(ElvenTrade.class);
|
||||
MineTweakerAPI.registerClass(ManaInfusion.class);
|
||||
MineTweakerAPI.registerClass(Orechid.class);
|
||||
MineTweakerAPI.registerClass(RuneAltar.class);
|
||||
}
|
||||
|
||||
public static boolean isSubtile(ItemStack stack) {
|
||||
return stack.getItem() instanceof ItemBlockSpecialFlower;
|
||||
}
|
||||
|
||||
public static boolean subtileMatches(ItemStack stack, ItemStack stack2) {
|
||||
return (ItemBlockSpecialFlower.getType(stack2).equals(ItemBlockSpecialFlower.getType(stack)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package modtweaker.mods.botania.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.toObjects;
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import static modtweaker.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.util.BaseListAddition;
|
||||
import modtweaker.util.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
@ZenClass("mods.botania.Apothecary")
|
||||
public class Apothecary {
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient[] input) {
|
||||
MineTweakerAPI.apply(new Add(new RecipePetals(toStack(output), toObjects(input))));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(String output, IIngredient[] input) {
|
||||
MineTweakerAPI.apply(new Add(new RecipePetals(ItemBlockSpecialFlower.ofType(output), toObjects(input))));
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(RecipePetals recipe) {
|
||||
super("Botania Petal Recipe", BotaniaAPI.petalRecipes, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipePetals) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(String output) {
|
||||
MineTweakerAPI.apply(new Remove(ItemBlockSpecialFlower.ofType(output)));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Botania Petal recipe", BotaniaAPI.petalRecipes, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (RecipePetals r : BotaniaAPI.petalRecipes) {
|
||||
if (areEqual(r.getOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BotaniaAPI.petalRecipes.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package modtweaker.mods.botania.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.toObjects;
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import static modtweaker.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.util.BaseListAddition;
|
||||
import modtweaker.util.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
|
||||
@ZenClass("mods.botania.ElvenTrade")
|
||||
public class ElvenTrade {
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient[] input) {
|
||||
MineTweakerAPI.apply(new Add(new RecipeElvenTrade(toStack(output), toObjects(input))));
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(RecipeElvenTrade recipe) {
|
||||
super("Botania Eleven Trade", BotaniaAPI.elvenTradeRecipes, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipeElvenTrade) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Botania Elven Trade", BotaniaAPI.elvenTradeRecipes, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (RecipeElvenTrade r : BotaniaAPI.elvenTradeRecipes) {
|
||||
if (r.getOutput() != null && areEqual(r.getOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BotaniaAPI.elvenTradeRecipes.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package modtweaker.mods.botania.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.toObject;
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import static modtweaker.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.util.BaseListAddition;
|
||||
import modtweaker.util.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
|
||||
@ZenClass("mods.botania.ManaInfusion")
|
||||
public class ManaInfusion {
|
||||
@ZenMethod
|
||||
public static void addInfusion(IItemStack output, IIngredient input, int mana) {
|
||||
MineTweakerAPI.apply(new Add(new RecipeManaInfusion(toStack(output), toObject(input), mana)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addAlchemy(IItemStack output, IIngredient input, int mana) {
|
||||
RecipeManaInfusion recipe = new RecipeManaInfusion(toStack(output), toObject(input), mana);
|
||||
recipe.setAlchemy(true);
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addConjuration(IItemStack output, IIngredient input, int mana) {
|
||||
RecipeManaInfusion recipe = new RecipeManaInfusion(toStack(output), toObject(input), mana);
|
||||
recipe.setConjuration(true);
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(RecipeManaInfusion recipe) {
|
||||
super("Botania Mana Infusion", BotaniaAPI.manaInfusionRecipes, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipeManaInfusion) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Botania Mana Infusion", BotaniaAPI.manaInfusionRecipes, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (RecipeManaInfusion r : BotaniaAPI.manaInfusionRecipes) {
|
||||
if (r.getOutput() != null && areEqual(r.getOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BotaniaAPI.manaInfusionRecipes.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package modtweaker.mods.botania.handlers;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
|
||||
@ZenClass("mods.botania.Orechid")
|
||||
public class Orechid {
|
||||
@ZenMethod
|
||||
public static void addOre(IOreDictEntry oreDict, int weight) {
|
||||
MineTweakerAPI.apply(new Add(oreDict.getName(), weight));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addOre(String oreDict, int weight) {
|
||||
MineTweakerAPI.apply(new Add(oreDict, weight));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
String oreDict;
|
||||
int weight;
|
||||
|
||||
public Add(String ore, int prop) {
|
||||
oreDict = ore;
|
||||
weight = prop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
|
||||
BotaniaAPI.addOreWeight(oreDict, weight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding Orechid Ore Weight: " + oreDict + ":" + weight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return oreDict != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
BotaniaAPI.oreWeights.remove(oreDict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing Orechid Ore: " + oreDict;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeOre(IOreDictEntry oreDict) {
|
||||
MineTweakerAPI.apply(new Remove(oreDict.getName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeOre(String oreDict) {
|
||||
MineTweakerAPI.apply(new Remove(oreDict));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
String oreDict;
|
||||
int weight;
|
||||
|
||||
public Remove(String ore) {
|
||||
oreDict = ore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
weight = BotaniaAPI.getOreWeight(oreDict);
|
||||
BotaniaAPI.oreWeights.remove(oreDict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Orechid Ore: " + oreDict;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return weight > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
BotaniaAPI.addOreWeight(oreDict, weight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Restoring Orechid Ore Weight: " + oreDict + ":" + weight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package modtweaker.mods.botania.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.toObjects;
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import static modtweaker.helpers.StackHelper.areEqual;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.util.BaseListAddition;
|
||||
import modtweaker.util.BaseListRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
|
||||
@ZenClass("mods.botania.RuneAltar")
|
||||
public class RuneAltar {
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient[] input, int mana) {
|
||||
MineTweakerAPI.apply(new Add(new RecipeRuneAltar(toStack(output), mana, toObjects(input))));
|
||||
}
|
||||
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(RecipeRuneAltar recipe) {
|
||||
super("Botania Rune Altar", BotaniaAPI.runeAltarRecipes, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return ((RecipeRuneAltar) recipe).getOutput().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("Botania Rune Altar", BotaniaAPI.runeAltarRecipes, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (RecipeRuneAltar r : BotaniaAPI.runeAltarRecipes) {
|
||||
if (r.getOutput() != null && areEqual(r.getOutput(), stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BotaniaAPI.runeAltarRecipes.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user