Fixed RemoveAll in CraftTweaker. Closes #1410

This commit is contained in:
drcrazy 2018-01-17 15:39:41 +03:00
parent ca9508c381
commit 8e12543902
14 changed files with 65 additions and 12 deletions

View file

@ -59,6 +59,11 @@ public class CTAlloySmelter extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.alloySmelterRecipe;

View file

@ -55,6 +55,11 @@ public class CTAssemblingMachine extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.assemblingMachineRecipe;

View file

@ -55,6 +55,11 @@ public class CTBlastFurnace extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.blastFurnaceRecipe;

View file

@ -55,6 +55,11 @@ public class CTCentrifuge extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.centrifugeRecipe;

View file

@ -55,6 +55,11 @@ public class CTChemicalReactor extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.chemicalReactorRecipe;

View file

@ -43,10 +43,7 @@ public class CTCompressor extends CTGeneric {
@ZenMethod
public static void addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) CraftTweakerCompat.toObject(input1);
//public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick);
addRecipe(r);
}
@ -59,6 +56,11 @@ public class CTCompressor extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.compressorRecipe;

View file

@ -59,6 +59,11 @@ public class CTDistillationTower extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.distillationTowerRecipe;

View file

@ -32,16 +32,12 @@ import net.minecraft.item.ItemStack;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.ItemUtils;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.BaseRecipe;
import java.util.ArrayList;
import java.util.List;
public class CTGeneric {
public static String getMachineName() {
return null;
}
public static void addRecipe(BaseRecipe recipe) {
CraftTweakerAPI.apply(new Add(recipe));
@ -147,9 +143,4 @@ public class CTGeneric {
return "Removing all recipes from " + name;
}
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
}

View file

@ -58,6 +58,11 @@ public class CTGrinder extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.grinderRecipe;

View file

@ -56,6 +56,11 @@ public class CTImplosionCompressor extends CTGeneric {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.implosionCompressorRecipe;
}

View file

@ -55,6 +55,11 @@ public class CTIndustrialElectrolyzer extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.industrialElectrolyzerRecipe;

View file

@ -100,6 +100,11 @@ public class CTIndustrialGrinder extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
/**
* Get reference machine name

View file

@ -76,6 +76,11 @@ public class CTIndustrialSawmill extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.industrialSawmillRecipe;

View file

@ -53,6 +53,11 @@ public class CTVacuumFreezer extends CTGeneric {
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.vacuumFreezerRecipe;