diff options
| author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 22:15:09 -0400 |
|---|---|---|
| committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 22:15:09 -0400 |
| commit | 123aa6ed288b2f67b0d47177f4d27cd6893daf3a (patch) | |
| tree | 358e3704182f5b6fda44fa8b20605ab63edca092 /src/main/java/gregtech/api/interfaces | |
| parent | 43ddecc7b9715d2038747566f89930b5db8d0181 (diff) | |
| download | GT5-Unofficial-123aa6ed288b2f67b0d47177f4d27cd6893daf3a.tar.gz GT5-Unofficial-123aa6ed288b2f67b0d47177f4d27cd6893daf3a.tar.bz2 GT5-Unofficial-123aa6ed288b2f67b0d47177f4d27cd6893daf3a.zip | |
Reformat code
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
47 files changed, 2121 insertions, 1954 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java b/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java index b1151cf808..ad3aa3c908 100644 --- a/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java +++ b/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java @@ -1,5 +1,5 @@ package gregtech.api.interfaces; public interface IColorModulationContainer { - public short[] getRGBA(); + public short[] getRGBA(); } diff --git a/src/main/java/gregtech/api/interfaces/ICondition.java b/src/main/java/gregtech/api/interfaces/ICondition.java index 507315ee91..9e31da7338 100644 --- a/src/main/java/gregtech/api/interfaces/ICondition.java +++ b/src/main/java/gregtech/api/interfaces/ICondition.java @@ -1,104 +1,104 @@ package gregtech.api.interfaces; public interface ICondition<O> { - public boolean isTrue(O aObject); - - // Utility Classes for adding relations between Conditions. - - public static class Not<O> implements ICondition<O> { - private final ICondition<O> mCondition; - - public Not(ICondition<O> aCondition) { - mCondition = aCondition; - } - - @Override - public boolean isTrue(O aObject) { - return !mCondition.isTrue(aObject); - } - } - - public static class Or<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public Or(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (tCondition.isTrue(aObject)) return true; - return false; - } - } - - public static class Nor<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public Nor(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (tCondition.isTrue(aObject)) return false; - return true; - } - } - - public static class And<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public And(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (!tCondition.isTrue(aObject)) return false; - return true; - } - } - - public static class Nand<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public Nand(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (!tCondition.isTrue(aObject)) return true; - return false; - } - } - - public static class Xor<O> implements ICondition<O> { - private final ICondition<O> mCondition1, mCondition2; - - public Xor(ICondition<O> aCondition1, ICondition<O> aCondition2) { - mCondition1 = aCondition1; - mCondition2 = aCondition2; - } - - @Override - public boolean isTrue(O aObject) { - return mCondition1.isTrue(aObject) != mCondition2.isTrue(aObject); - } - } - - public static class Equal<O> implements ICondition<O> { - private final ICondition<O> mCondition1, mCondition2; - - public Equal(ICondition<O> aCondition1, ICondition<O> aCondition2) { - mCondition1 = aCondition1; - mCondition2 = aCondition2; - } - - @Override - public boolean isTrue(O aObject) { - return mCondition1.isTrue(aObject) == mCondition2.isTrue(aObject); - } - } + public boolean isTrue(O aObject); + + // Utility Classes for adding relations between Conditions. + + public static class Not<O> implements ICondition<O> { + private final ICondition<O> mCondition; + + public Not(ICondition<O> aCondition) { + mCondition = aCondition; + } + + @Override + public boolean isTrue(O aObject) { + return !mCondition.isTrue(aObject); + } + } + + public static class Or<O> implements ICondition<O> { + private final ICondition<O>[] mConditions; + + public Or(ICondition<O>... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition<O> tCondition : mConditions) if (tCondition.isTrue(aObject)) return true; + return false; + } + } + + public static class Nor<O> implements ICondition<O> { + private final ICondition<O>[] mConditions; + + public Nor(ICondition<O>... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition<O> tCondition : mConditions) if (tCondition.isTrue(aObject)) return false; + return true; + } + } + + public static class And<O> implements ICondition<O> { + private final ICondition<O>[] mConditions; + + public And(ICondition<O>... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition<O> tCondition : mConditions) if (!tCondition.isTrue(aObject)) return false; + return true; + } + } + + public static class Nand<O> implements ICondition<O> { + private final ICondition<O>[] mConditions; + + public Nand(ICondition<O>... aConditions) { + mConditions = aConditions; + } + + @Override + public boolean isTrue(O aObject) { + for (ICondition<O> tCondition : mConditions) if (!tCondition.isTrue(aObject)) return true; + return false; + } + } + + public static class Xor<O> implements ICondition<O> { + private final ICondition<O> mCondition1, mCondition2; + + public Xor(ICondition<O> aCondition1, ICondition<O> aCondition2) { + mCondition1 = aCondition1; + mCondition2 = aCondition2; + } + + @Override + public boolean isTrue(O aObject) { + return mCondition1.isTrue(aObject) != mCondition2.isTrue(aObject); + } + } + + public static class Equal<O> implements ICondition<O> { + private final ICondition<O> mCondition1, mCondition2; + + public Equal(ICondition<O> aCondition1, ICondition<O> aCondition2) { + mCondition1 = aCondition1; + mCondition2 = aCondition2; + } + + @Override + public boolean isTrue(O aObject) { + return mCondition1.isTrue(aObject) == mCondition2.isTrue(aObject); + } + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDamagableItem.java b/src/main/java/gregtech/api/interfaces/IDamagableItem.java index f47c65f545..b7ebd6690d 100644 --- a/src/main/java/gregtech/api/interfaces/IDamagableItem.java +++ b/src/main/java/gregtech/api/interfaces/IDamagableItem.java @@ -3,5 +3,5 @@ package gregtech.api.interfaces; import net.minecraft.item.ItemStack; public interface IDamagableItem { - public boolean doDamageToItem(ItemStack aStack, int aVanillaDamage); + public boolean doDamageToItem(ItemStack aStack, int aVanillaDamage); }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java index ce95982018..bdb550ff53 100644 --- a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java +++ b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java @@ -1,26 +1,27 @@ package gregtech.api.interfaces; -import java.util.ArrayList; - import net.minecraft.entity.player.EntityPlayer; +import java.util.ArrayList; + /** * You are allowed to include this File in your Download, as i will not change it. */ public interface IDebugableBlock { - /** - * Returns a Debug Message, for a generic DebugItem - * Blocks have to implement this interface NOT TileEntities! - * @param aPlayer the Player, who rightclicked with his Debug Item - * @param aX Block-Coordinate - * @param aY Block-Coordinate - * @param aZ Block-Coordinate - * @param aLogLevel the Log Level of the Debug Item. - * 0 = Obvious - * 1 = Visible for the regular Scanner - * 2 = Only visible to more advanced Scanners - * 3 = Debug ONLY - * @return a String-Array containing the DebugInfo, every Index is a separate line (0 = first Line) - */ - public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel); + /** + * Returns a Debug Message, for a generic DebugItem + * Blocks have to implement this interface NOT TileEntities! + * + * @param aPlayer the Player, who rightclicked with his Debug Item + * @param aX Block-Coordinate + * @param aY Block-Coordinate + * @param aZ Block-Coordinate + * @param aLogLevel the Log Level of the Debug Item. + * 0 = Obvious + * 1 = Visible for the regular Scanner + * 2 = Only visible to more advanced Scanners + * 3 = Debug ONLY + * @return a String-Array containing the DebugInfo, every Index is a separate line (0 = first Line) + */ + public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel); }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDescribable.java b/src/main/java/gregtech/api/interfaces/IDescribable.java index 7ccf1a6627..d4bcf58de8 100644 --- a/src/main/java/gregtech/api/interfaces/IDescribable.java +++ b/src/main/java/gregtech/api/interfaces/IDescribable.java @@ -4,8 +4,8 @@ package gregtech.api.interfaces; * To get simple things like a ToolTip Description */ public interface IDescribable { - /** - * The Tooltip Text - */ - public String[] getDescription(); + /** + * The Tooltip Text + */ + public String[] getDescription(); } diff --git a/src/main/java/gregtech/api/interfaces/IFoodStat.java b/src/main/java/gregtech/api/interfaces/IFoodStat.java index cb01e102c6..b6773e9d65 100644 --- a/src/main/java/gregtech/api/interfaces/IFoodStat.java +++ b/src/main/java/gregtech/api/interfaces/IFoodStat.java @@ -6,16 +6,30 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; public interface IFoodStat { - /** Warning the "aPlayer" Parameter may be null! */ - public int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); - /** Warning the "aPlayer" Parameter may be null! */ - public float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); - /** Warning the "aPlayer" Parameter may be null! */ - public boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); - /** Warning the "aPlayer" Parameter may be null! */ - public boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); - /** Warning the "aPlayer" Parameter may be null! */ - public EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack); - - public void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + /** + * Warning the "aPlayer" Parameter may be null! + */ + public int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + + /** + * Warning the "aPlayer" Parameter may be null! + */ + public float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + + /** + * Warning the "aPlayer" Parameter may be null! + */ + public boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + + /** + * Warning the "aPlayer" Parameter may be null! + */ + public boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + + /** + * Warning the "aPlayer" Parameter may be null! + */ + public EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack); + + public void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IIconContainer.java b/src/main/java/gregtech/api/interfaces/IIconContainer.java index dc9a845f06..c8b995e9a7 100644 --- a/src/main/java/gregtech/api/interfaces/IIconContainer.java +++ b/src/main/java/gregtech/api/interfaces/IIconContainer.java @@ -4,18 +4,18 @@ import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; public interface IIconContainer { - /** - * @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(); + /** + * @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(); } diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java index 1f28b6a696..1d75f41e17 100644 --- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java +++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java @@ -2,9 +2,6 @@ package gregtech.api.interfaces; import gregtech.api.enums.SubTag; import gregtech.api.items.GT_MetaBase_Item; - -import java.util.List; - import net.minecraft.dispenser.IBlockSource; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -14,17 +11,30 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import java.util.List; + public interface IItemBehaviour<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 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(GT_MetaBase_Item 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); + + 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(GT_MetaBase_Item 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/main/java/gregtech/api/interfaces/IItemContainer.java b/src/main/java/gregtech/api/interfaces/IItemContainer.java index e61553ce7d..3c1bd87543 100644 --- a/src/main/java/gregtech/api/interfaces/IItemContainer.java +++ b/src/main/java/gregtech/api/interfaces/IItemContainer.java @@ -5,20 +5,35 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public interface IItemContainer { - 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 IItemContainer set(Item aItem); - public IItemContainer set(ItemStack aStack); - public IItemContainer registerOre(Object... aOreNames); - public IItemContainer registerWildcardAsOre(Object... aOreNames); - public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements); - public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements); - public boolean hasBeenSet(); + 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 IItemContainer set(Item aItem); + + public IItemContainer set(ItemStack aStack); + + public IItemContainer registerOre(Object... aOreNames); + + public IItemContainer 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/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java b/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java index 4535c4d6c8..1f0ec91bba 100644 --- a/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java +++ b/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java @@ -5,11 +5,12 @@ import gregtech.api.enums.OrePrefixes; import net.minecraft.item.ItemStack; public interface IOreRecipeRegistrator { - /** - * 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, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack); + /** + * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I di |
