aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-09-07 16:36:25 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-09-07 16:36:25 +1000
commit221c2f0fe81430e7dd4087e5f5845bd7c62ec56d (patch)
treed6e0faaef01b9d517828557e1be82500d476f95e /src/Java/gtPlusPlus/xmod/gregtech/api/interfaces
parent5872c0947ce7bc788b03fa2fb690b8815d3d0a04 (diff)
downloadGT5-Unofficial-221c2f0fe81430e7dd4087e5f5845bd7c62ec56d.tar.gz
GT5-Unofficial-221c2f0fe81430e7dd4087e5f5845bd7c62ec56d.tar.bz2
GT5-Unofficial-221c2f0fe81430e7dd4087e5f5845bd7c62ec56d.zip
% Refactored the entire project to stop using MiscUtils everywhere possible, now it's gtPlusPlus.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/interfaces')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java21
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java41
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java160
8 files changed, 353 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
new file mode 100644
index 0000000000..3c29b34e27
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public interface GregtechItemContainer {
+ public Item getItem();
+ public Block getBlock();
+ public boolean isStackEqual(Object aStack);
+ public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT);
+ public ItemStack get(long aAmount, Object... aReplacements);
+ public ItemStack getWildcard(long aAmount, Object... aReplacements);
+ public ItemStack getUndamaged(long aAmount, Object... aReplacements);
+ public ItemStack getAlmostBroken(long aAmount, Object... aReplacements);
+ public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements);
+ public GregtechItemContainer set(Item aItem);
+ public GregtechItemContainer set(ItemStack aStack);
+ public GregtechItemContainer registerOre(Object... aOreNames);
+ public GregtechItemContainer registerWildcardAsOre(Object... aOreNames);
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
+ public boolean hasBeenSet();
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
new file mode 100644
index 0000000000..6aada2bdac
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -0,0 +1,55 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public interface IGregtech_RecipeAdder {
+ /**
+ * Adds a Coke Oven Recipe
+ *
+ * @param aInput1 = first Input (not null, and respects StackSize)
+ * @param aInputb = second Input (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be null, and respects StackSize)
+ * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ //public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
+ public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
+
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+
+
+ /**
+ * Adds a Matter Fabricator Recipe
+ *
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+
+
+
+ /**
+ * Adds a Recipe for the Sifter. (up to 9 Outputs)
+ *
+ * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+
+ public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt);
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
new file mode 100644
index 0000000000..8e1715caf5
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
@@ -0,0 +1,21 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+public interface Interface_IconContainer {
+ /**
+ * @return A regular Icon.
+ */
+ public IIcon getIcon();
+
+ /**
+ * @return Icon of the Overlay (or null if there is no Icon)
+ */
+ public IIcon getOverlayIcon();
+
+ /**
+ * @return the Default Texture File for this Icon.
+ */
+ public ResourceLocation getTextureFile();
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
new file mode 100644
index 0000000000..03f7b1bd1e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.enums.SubTag;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
+
+import java.util.List;
+
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public interface Interface_ItemBehaviour<E extends Item> {
+ public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
+
+ public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
+
+ public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
+
+ public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
+
+ public List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
+
+ public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
+
+ public boolean isItemStackUsable(E aItem, ItemStack aStack);
+
+ public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+
+ public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+
+ public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack);
+
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ);
+
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
new file mode 100644
index 0000000000..f1583764f7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+
+public interface Interface_OreRecipeRegistrator {
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
new file mode 100644
index 0000000000..ed276ad3f9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.enums.OrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+
+public interface Interface_OreRecipeRegistrator_GT {
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
new file mode 100644
index 0000000000..76c5113186
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
@@ -0,0 +1,20 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+
+public interface Interface_Texture {
+ public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+
+ public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+
+ public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+
+ public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+
+ public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+
+ public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ);
+
+ public boolean isValidTexture();
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
new file mode 100644
index 0000000000..3d94d449a6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
@@ -0,0 +1,160 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.interfaces.IIconContainer;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+import net.minecraftforge.event.world.BlockEvent;
+
+/**
+ * The Stats for GT Tools. Not including any Material Modifiers.
+ * <p/>
+ * And this is supposed to not have any ItemStack Parameters as these are generic Stats.
+ */
+public interface Interface_ToolStats {
+ /**
+ * Called when aPlayer crafts this Tool
+ */
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
+
+ /**
+ * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerBlockBreak();
+
+ /**
+ * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerDropConversion();
+
+ /**
+ * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal.
+ */
+ public int getToolDamagePerContainerCraft();
+
+ /**
+ * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
+ */
+ public int getToolDamagePerEntityAttack();
+
+ /**
+ * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible.
+ */
+ public int getBaseQuality();
+
+ /**
+ * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
+ */
+ public float getBaseDamage();
+
+ /**
+ * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
+ */
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
+ */
+ public float getSpeedMultiplier();
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
+ */
+ public float getMaxDurabilityMultiplier();
+
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+
+ public String getMiningSound();
+
+ public String getCraftingSound();
+
+ public String getEntityHitSound();
+
+ public String getBreakingSound();
+
+ public Enchantment[] getEnchantments(ItemStack aStack);
+
+ public int[] getEnchantmentLevels(ItemStack aStack);
+
+ /**
+ * @return If this Tool can be used for blocking Damage like a Sword.
+ */
+ public boolean canBlock();
+
+ /**
+ * @return If this Tool can be used as an RC Crowbar.
+ */
+ public boolean isCrowbar();
+
+ /**
+ * @return If this Tool can be used as an BC Wrench.
+ */
+ public boolean isWrench();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isWeapon();
+
+ /**
+ * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something
+ */
+ public boolean isRangedWeapon();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isMiningTool();
+
+ /**
+ * aBlock.getHarvestTool(aMetaData) can return the following Values for example.
+ * "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch"
+ *
+ * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check.
+ */
+ public boolean isMinableBlock(Block aBlock, byte aMetaData);
+
+ /**
+ * This lets you modify the Drop List, when this type of Tool has been used.
+ *
+ * @return the Amount of modified Items.
+ */
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
+
+ /**
+ * @return Returns a broken Version of the Item.
+ */
+ public ItemStack getBrokenItem(ItemStack aStack);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ //public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID);
+} \ No newline at end of file