-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fac88d
commit 407657f
Showing
26 changed files
with
557 additions
and
250 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/java/mods/bio/gttweaker/api/mods/gregtech/GregTweakerAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech; | ||
|
||
import gregapi.oredict.OreDictMaterial; | ||
import minetweaker.api.item.IIngredient; | ||
import mods.bio.gttweaker.api.mods.gregtech.oredict.IMaterial; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fluids.FluidStack; | ||
import net.minecraftforge.oredict.OreDictionary; | ||
|
||
public class GregTweakerAPI { | ||
public static OreDictMaterial getMaterial(IMaterial iMaterial){ | ||
return iMaterial.getMaterial(); | ||
} | ||
|
||
// public static OreDictPrefix getPrefix(IPrefix iPrefix){ | ||
// return iPrefix. | ||
// } | ||
|
||
public static ItemStack getItemStackOrNull(IIngredient ingredient) { | ||
Object internal = ingredient.getInternal(); | ||
if (internal instanceof ItemStack) return (ItemStack) internal; | ||
else if (internal instanceof String) return OreDictionary.getOres((String) internal) | ||
.size() > 0 ? OreDictionary.getOres((String) internal) | ||
.get(0) : null; | ||
return null; | ||
} | ||
|
||
public static FluidStack getFluidStackOrNull(IIngredient ingredient) { | ||
Object internal = ingredient.getInternal(); | ||
if (internal instanceof FluidStack) return (FluidStack) internal; | ||
return null; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/mods/bio/gttweaker/api/mods/gregtech/oredict/IMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.oredict; | ||
|
||
import gregapi.oredict.OreDictMaterial; | ||
import stanhebben.zenscript.annotations.OperatorType; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenOperator; | ||
|
||
@ZenClass("mods.gregtech.oredict.IMaterial") | ||
public interface IMaterial { | ||
OreDictMaterial getMaterial(); | ||
|
||
@ZenOperator(OperatorType.MUL) | ||
IMaterialStack multiply(long amount); | ||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/mods/bio/gttweaker/api/mods/gregtech/oredict/IMaterialData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.oredict; | ||
|
||
import gregapi.oredict.OreDictItemData; | ||
import gregapi.oredict.OreDictManager; | ||
import gregapi.oredict.OreDictMaterial; | ||
import gregapi.oredict.OreDictMaterialStack; | ||
import minetweaker.MineTweakerAPI; | ||
import minetweaker.api.item.IItemStack; | ||
import minetweaker.api.liquid.ILiquidStack; | ||
import minetweaker.api.minecraft.MineTweakerMC; | ||
import minetweaker.api.oredict.IOreDictEntry; | ||
import mods.bio.gttweaker.mods.gregtech.oredict.CTMaterialData; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenGetter; | ||
import stanhebben.zenscript.annotations.ZenMethod; | ||
|
||
import java.util.List; | ||
|
||
import static gregapi.data.CS.F; | ||
|
||
@ZenClass("mods.gregtech.oredict.IMaterialData") | ||
public interface IMaterialData { | ||
@ZenMethod | ||
public static IMaterialData association(IItemStack item) { | ||
OreDictItemData data = OreDictManager.INSTANCE.getAssociation(MineTweakerMC.getItemStack(item), F); | ||
if (data != null) return new CTMaterialData(data); | ||
MineTweakerAPI.logError(item + " dose not have a GT Association!"); | ||
return null; | ||
} | ||
|
||
@ZenMethod | ||
public static IMaterialData association(ILiquidStack iLiquidStack) { | ||
OreDictMaterialStack stack = OreDictMaterial.FLUID_MAP.get(MineTweakerMC.getLiquidStack(iLiquidStack).getFluid().getName()); | ||
if (stack != null) { | ||
OreDictItemData data = new OreDictItemData(stack); | ||
return new CTMaterialData(data); | ||
} | ||
MineTweakerAPI.logError(iLiquidStack + " dose not have a GT Association!"); | ||
return null; | ||
} | ||
|
||
@ZenMethod | ||
public static IMaterialData association(IOreDictEntry ore) { | ||
OreDictItemData data = OreDictManager.INSTANCE.getAutomaticItemData(ore.getName()); | ||
if (data != null) return new CTMaterialData(data); | ||
MineTweakerAPI.logError(ore + " dose not have a GT Association!"); | ||
return null; | ||
} | ||
|
||
@ZenGetter | ||
IMaterialStack material(); | ||
|
||
@ZenGetter | ||
IPrefix prefix(); | ||
|
||
@ZenGetter | ||
List<IMaterialStack> byProducts(); | ||
|
||
@ZenGetter | ||
List<IMaterialStack> materials(); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/mods/bio/gttweaker/api/mods/gregtech/oredict/IMaterialStack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.oredict; | ||
|
||
import stanhebben.zenscript.annotations.OperatorType; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenGetter; | ||
import stanhebben.zenscript.annotations.ZenOperator; | ||
|
||
@ZenClass("mods.gregtech.oredict.IMaterialStack") | ||
public interface IMaterialStack { | ||
@ZenGetter | ||
IMaterial material(); | ||
|
||
@ZenOperator(OperatorType.MUL) | ||
@ZenGetter | ||
long amount(); | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/mods/bio/gttweaker/api/mods/gregtech/oredict/IPrefix.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.oredict; | ||
|
||
import minetweaker.api.item.IItemStack; | ||
import minetweaker.api.oredict.IOreDictEntry; | ||
import mods.bio.gttweaker.mods.gregtech.oredict.CTPrefix; | ||
import stanhebben.zenscript.annotations.ZenGetter; | ||
import stanhebben.zenscript.annotations.ZenMethod; | ||
|
||
public interface IPrefix { | ||
@ZenGetter | ||
long amount(); | ||
|
||
@ZenMethod | ||
IItemStack withMaterial(IMaterial aMaterial); | ||
|
||
@ZenMethod | ||
IItemStack mat(IMaterial aMaterial); | ||
|
||
@ZenMethod | ||
IItemStack material(IMaterial aMaterial); | ||
|
||
@ZenMethod | ||
IPrefix disableItemGeneration(); | ||
|
||
@ZenMethod | ||
IPrefix forceItemGeneration(); | ||
|
||
@ZenMethod | ||
boolean contains(IItemStack aIItemStack); | ||
|
||
@ZenMethod | ||
boolean contains(IItemStack... aIItemStacks); | ||
|
||
@ZenMethod | ||
// TODO there is more to this visit later, but it's rather ready for production | ||
IPrefix contains(int stackSize); | ||
|
||
// TODO: to be implemented | ||
boolean contains(IOreDictEntry aIOreDictEntry); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/mods/bio/gttweaker/api/mods/gregtech/recipe/IRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.recipe; | ||
|
||
import gregapi.recipes.Recipe; | ||
import minetweaker.api.item.IItemStack; | ||
import minetweaker.api.liquid.ILiquidStack; | ||
import mods.bio.gttweaker.mods.gregtech.recipe.CTRecipe; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenGetter; | ||
|
||
import java.util.List; | ||
|
||
@ZenClass("mods.gregtech.recipe.IRecipe") | ||
public interface IRecipe { | ||
@ZenGetter | ||
int duration(); | ||
|
||
@ZenGetter | ||
int EUt(); | ||
|
||
@ZenGetter | ||
int meta(); | ||
|
||
@ZenGetter("outputs") | ||
List<IItemStack> getOutputs(); | ||
|
||
@ZenGetter("inputs") | ||
List<IItemStack> getInputs(); | ||
|
||
@ZenGetter("fluidOutputs") | ||
List<ILiquidStack> getFluidOutputs(); | ||
|
||
@ZenGetter("fluidInputs") | ||
List<ILiquidStack> getFluidInputs(); | ||
|
||
boolean remove(IRecipeMap recipeMap); | ||
|
||
boolean add(IRecipeMap recipeMap); | ||
} |
81 changes: 81 additions & 0 deletions
81
src/main/java/mods/bio/gttweaker/api/mods/gregtech/recipe/IRecipeFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.recipe; | ||
|
||
import minetweaker.api.item.IIngredient; | ||
import minetweaker.api.item.IItemStack; | ||
import minetweaker.api.liquid.ILiquidStack; | ||
import mods.bio.gttweaker.api.mods.gregtech.oredict.IMaterial; | ||
import mods.bio.gttweaker.api.mods.gregtech.oredict.IPrefix; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenMethod; | ||
|
||
@ZenClass("mods.gregtech.recipe.IRecipeFactory") | ||
public interface IRecipeFactory { | ||
@ZenMethod | ||
IRecipeFactory EUt(int energy); | ||
|
||
@ZenMethod | ||
IRecipeFactory duration(int ticks); | ||
|
||
@ZenMethod | ||
IRecipeFactory nonConsumable(IItemStack stack); | ||
|
||
@ZenMethod | ||
IRecipeFactory circuit(int config); | ||
|
||
@ZenMethod | ||
IRecipeFactory specialValue(int config); | ||
|
||
@ZenMethod | ||
IRecipeFactory input(IPrefix aPrefix, IMaterial aMaterial); | ||
|
||
@ZenMethod | ||
IRecipeFactory input(IPrefix aPrefix, IMaterial aMaterial, int aAmount); | ||
|
||
@ZenMethod | ||
IRecipeFactory output(IPrefix aPrefix, IMaterial aMaterial); | ||
|
||
@ZenMethod | ||
IRecipeFactory output(IPrefix aPrefix, IMaterial aMaterial, int aAmount); | ||
|
||
@ZenMethod | ||
IRecipeFactory input(IItemStack input); | ||
|
||
@ZenMethod | ||
IRecipeFactory inputs(IItemStack... inputs); | ||
|
||
@ZenMethod("inputFluid") | ||
IRecipeFactory fluidInput(ILiquidStack input); | ||
|
||
@ZenMethod("inputFluids") | ||
IRecipeFactory fluidInputs(ILiquidStack... inputs); | ||
|
||
@ZenMethod | ||
IRecipeFactory output(IItemStack output); | ||
|
||
@ZenMethod | ||
IRecipeFactory outputs(IItemStack... outputs); | ||
|
||
@ZenMethod | ||
IRecipeFactory chancedOutput(IItemStack output, int chance); | ||
|
||
@ZenMethod("outputFluid") | ||
IRecipeFactory fluidOutput(ILiquidStack output); | ||
|
||
@ZenMethod("outputFluids") | ||
IRecipeFactory fluidOutputs(ILiquidStack... fluids); | ||
|
||
@ZenMethod | ||
IRecipeFactory output(IIngredient ingredient); | ||
|
||
@ZenMethod | ||
IRecipeFactory input(IIngredient ingredient); | ||
|
||
@ZenMethod | ||
IRecipeFactory inputs(IIngredient... ingredients); | ||
|
||
@ZenMethod | ||
IRecipe build(); | ||
|
||
@ZenMethod | ||
void buildAndRegister(); | ||
} |
70 changes: 70 additions & 0 deletions
70
src/main/java/mods/bio/gttweaker/api/mods/gregtech/recipe/IRecipeMap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package mods.bio.gttweaker.api.mods.gregtech.recipe; | ||
|
||
import minetweaker.api.item.IItemStack; | ||
import minetweaker.api.liquid.ILiquidStack; | ||
import mods.bio.gttweaker.mods.gregtech.recipe.CTRecipe; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenGetter; | ||
import stanhebben.zenscript.annotations.ZenMethod; | ||
|
||
import java.util.List; | ||
|
||
@ZenClass("mods.gregtech.recipe.IRecipeMap") | ||
public interface IRecipeMap { | ||
@ZenMethod("name") | ||
String getNameShort(); | ||
|
||
@ZenMethod("nameInternal") | ||
String getNameInternal(); | ||
|
||
@ZenMethod("getRecipes") | ||
List<IRecipe> getRecipesCT(); | ||
|
||
@ZenMethod("findRecipe") | ||
CTRecipe findRecipeCT(IItemStack[] itemsIn, ILiquidStack[] liquidsIn); | ||
|
||
@ZenMethod("removeRecipe") | ||
boolean removeRecipeCT(IItemStack[] itemsIn); | ||
|
||
@ZenMethod("removeRecipe") | ||
boolean removeRecipeCT(ILiquidStack[] liquidsIn); | ||
|
||
@ZenMethod("removeRecipe") | ||
boolean removeRecipeCT(IItemStack[] itemsIn, ILiquidStack[] liquidsIn); | ||
|
||
@ZenMethod | ||
boolean remove(IRecipe recipe); | ||
|
||
@ZenMethod | ||
boolean add(IRecipe recipe); | ||
|
||
@ZenMethod | ||
IRecipeFactory factory(); | ||
|
||
@ZenGetter("minInputs") | ||
int getMinInputs(); | ||
|
||
@ZenGetter("maxInputs") | ||
int getMaxInputs(); | ||
|
||
@ZenGetter("minOutputs") | ||
int getMinOutputs(); | ||
|
||
@ZenGetter("maxOutputs") | ||
int getMaxOutputs(); | ||
|
||
@ZenGetter("minFluidInputs") | ||
int getMinFluidInputs(); | ||
|
||
@ZenGetter("maxFluidInputs") | ||
int getMaxFluidInputs(); | ||
|
||
@ZenGetter("minFluidOutputs") | ||
int getMinFluidOutputs(); | ||
|
||
@ZenGetter("maxFluidOutputs") | ||
int getMaxFluidOutputs(); | ||
|
||
@ZenMethod("register") | ||
void registerRecipe(IRecipe recipe); | ||
} |
Oops, something went wrong.