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

@ -60,6 +60,11 @@ public class CTAlloySmelter 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.alloySmelterRecipe;
}

View file

@ -56,6 +56,11 @@ public class CTAssemblingMachine 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.assemblingMachineRecipe;
}

View file

@ -56,6 +56,11 @@ public class CTBlastFurnace 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.blastFurnaceRecipe;
}

View file

@ -56,6 +56,11 @@ public class CTCentrifuge 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.centrifugeRecipe;
}

View file

@ -56,6 +56,11 @@ public class CTChemicalReactor 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.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);
}
@ -60,6 +57,11 @@ public class CTCompressor 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.compressorRecipe;
}

View file

@ -60,6 +60,11 @@ public class CTDistillationTower 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.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

@ -59,6 +59,11 @@ public class CTGrinder 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.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

@ -56,6 +56,11 @@ public class CTIndustrialElectrolyzer 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.industrialElectrolyzerRecipe;
}

View file

@ -101,6 +101,11 @@ public class CTIndustrialGrinder extends CTGeneric {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
/**
* Get reference machine name
* @return String Reference name for Industrial Grinder

View file

@ -77,6 +77,11 @@ public class CTIndustrialSawmill 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.industrialSawmillRecipe;
}

View file

@ -54,6 +54,11 @@ public class CTVacuumFreezer 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.vacuumFreezerRecipe;
}