From 1b820de08a05070909a267e17f033fcf58ac8710 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 2 Sep 2024 23:17:17 +0200 Subject: The Great Renaming (#3014) * move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names --- .../api/interfaces/internal/IItemBehaviour.java | 46 +++++ .../interfaces/internal/IOreRecipeRegistrator.java | 24 +++ .../api/interfaces/internal/IToolStats.java | 201 ++++++++++++++++++++ .../internal/Interface_ItemBehaviour.java | 46 ----- .../internal/Interface_OreRecipeRegistrator.java | 24 --- .../interfaces/internal/Interface_ToolStats.java | 202 --------------------- 6 files changed, 271 insertions(+), 272 deletions(-) create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java new file mode 100644 index 0000000000..a68efc4fb8 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IItemBehaviour.java @@ -0,0 +1,46 @@ +package gtPlusPlus.xmod.gregtech.api.interfaces.internal; + +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; + +import gregtech.api.enums.SubTag; +import gtPlusPlus.xmod.gregtech.api.items.GTMetaItemBase; + +public interface IItemBehaviour { + + 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 getAdditionalToolTips(E aItem, List 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(GTMetaItemBase 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); +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java new file mode 100644 index 0000000000..4c8b1c2391 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IOreRecipeRegistrator.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.gregtech.api.interfaces.internal; + +import net.minecraft.item.ItemStack; + +import gregtech.api.enums.Materials; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; + +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(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, + ItemStack aStack); + + public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, + ItemStack copyAmount); +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java new file mode 100644 index 0000000000..98b446869c --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IToolStats.java @@ -0,0 +1,201 @@ +package gtPlusPlus.xmod.gregtech.api.interfaces.internal; + +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; + +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.MetaGeneratedTool; +import gtPlusPlus.xmod.gregtech.api.items.GTMetaTool; + +/** + * The Stats for GT Tools. Not including any Material Modifiers. + *

+ * And this is supposed to not have any ItemStack Parameters as these are generic Stats. + */ +public interface IToolStats extends gregtech.api.interfaces.IToolStats { + + /** + * Called when aPlayer crafts this Tool + */ + @Override + public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer); + + /** + * Called when this gets added to a Tool Item + */ + public void onStatsAddedToTool(GTMetaTool gregtech_MetaTool, int aID); + + /** + * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU). + */ + @Override + public int getToolDamagePerBlockBreak(); + + /** + * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU). + */ + @Override + 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. + */ + @Override + public int getToolDamagePerContainerCraft(); + + /** + * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons. + */ + @Override + 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. + */ + @Override + public int getBaseQuality(); + + /** + * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch. + */ + @Override + public float getBaseDamage(); + + /** + * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum) + */ + @Override + public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity); + + /** + * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed. + */ + @Override + public float getSpeedMultiplier(); + + /** + * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability. + */ + @Override + public float getMaxDurabilityMultiplier(); + + @Override + public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity); + + @Override + public String getMiningSound(); + + @Override + public String getCraftingSound(); + + @Override + public String getEntityHitSound(); + + @Override + public String getBreakingSound(); + + @Override + public Enchantment[] getEnchantments(ItemStack aStack); + + @Override + public int[] getEnchantmentLevels(ItemStack aStack); + + /** + * @return If this Tool can be used for blocking Damage like a Sword. + */ + @Override + public boolean canBlock(); + + /** + * @return If this Tool can be used as an RC Crowbar. + */ + @Override + public boolean isCrowbar(); + + /** + * @return If this Tool can be used as an BC Wrench. + */ + @Override + public boolean isWrench(); + + /** + * @return If this Tool can be used as Weapon i.e. if that is the main purpose. + */ + @Override + 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 + */ + @Override + public boolean isRangedWeapon(); + + /** + * @return If this Tool can be used as Weapon i.e. if that is the main purpose. + */ + @Override + 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. + */ + @Override + 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. + */ + @Override + public int convertBlockDrops(List 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. + */ + @Override + public ItemStack getBrokenItem(ItemStack aStack); + + /** + * @return the Damage actually done to the Mob. + */ + @Override + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer); + + /** + * @return the Damage actually done to the Mob. + */ + @Override + public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer); + + @Override + public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); + + @Override + public short[] getRGBa(boolean aIsToolHead, ItemStack aStack); + + /** + * Called when this gets added to a Tool Item + */ + @Override + public void onStatsAddedToTool(MetaGeneratedTool aItem, int aID); +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java deleted file mode 100644 index 545a97288f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java +++ /dev/null @@ -1,46 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces.internal; - -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; - -import gregtech.api.enums.SubTag; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base; - -public interface Interface_ItemBehaviour { - - 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 getAdditionalToolTips(E aItem, List 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); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java deleted file mode 100644 index 6ae25525bd..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java +++ /dev/null @@ -1,24 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces.internal; - -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.Materials; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; - -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); - - public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, - ItemStack copyAmount); -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java deleted file mode 100644 index 97d952d4a1..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java +++ /dev/null @@ -1,202 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.interfaces.internal; - -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; - -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; - -/** - * The Stats for GT Tools. Not including any Material Modifiers. - *

- * And this is supposed to not have any ItemStack Parameters as these are generic Stats. - */ -public interface Interface_ToolStats extends IToolStats { - - /** - * Called when aPlayer crafts this Tool - */ - @Override - 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). - */ - @Override - public int getToolDamagePerBlockBreak(); - - /** - * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU). - */ - @Override - 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. - */ - @Override - public int getToolDamagePerContainerCraft(); - - /** - * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons. - */ - @Override - 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. - */ - @Override - public int getBaseQuality(); - - /** - * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch. - */ - @Override - public float getBaseDamage(); - - /** - * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum) - */ - @Override - public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity); - - /** - * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed. - */ - @Override - public float getSpeedMultiplier(); - - /** - * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability. - */ - @Override - public float getMaxDurabilityMultiplier(); - - @Override - public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity); - - @Override - public String getMiningSound(); - - @Override - public String getCraftingSound(); - - @Override - public String getEntityHitSound(); - - @Override - public String getBreakingSound(); - - @Override - public Enchantment[] getEnchantments(ItemStack aStack); - - @Override - public int[] getEnchantmentLevels(ItemStack aStack); - - /** - * @return If this Tool can be used for blocking Damage like a Sword. - */ - @Override - public boolean canBlock(); - - /** - * @return If this Tool can be used as an RC Crowbar. - */ - @Override - public boolean isCrowbar(); - - /** - * @return If this Tool can be used as an BC Wrench. - */ - @Override - public boolean isWrench(); - - /** - * @return If this Tool can be used as Weapon i.e. if that is the main purpose. - */ - @Override - 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 - */ - @Override - public boolean isRangedWeapon(); - - /** - * @return If this Tool can be used as Weapon i.e. if that is the main purpose. - */ - @Override - 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. - */ - @Override - 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. - */ - @Override - public int convertBlockDrops(List 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. - */ - @Override - public ItemStack getBrokenItem(ItemStack aStack); - - /** - * @return the Damage actually done to the Mob. - */ - @Override - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, - EntityPlayer aPlayer); - - /** - * @return the Damage actually done to the Mob. - */ - @Override - public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, - EntityPlayer aPlayer); - - @Override - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); - - @Override - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack); - - /** - * Called when this gets added to a Tool Item - */ - @Override - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID); -} -- cgit