Replace a bunch of duplicated checks done for various items with methods in IBindable.

Replace a bunch of duplicated checks for toggling sigils in ISigil.
Move static methods from EnergyItems to IBindable so they are more relevant for the bound tools (they don't extend EnergyItems because they need to extend the tool classes).
This commit is contained in:
koolkrafter5 committed 2025-04-10 15:25:15 -04:00
1 parent 46a8c566d7
commit b14aded91f
57 files changed
+382 -759

No files matched your search

@@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
@@ -25,17 +26,12 @@ public class ScribeTool extends EnergyItems {
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.scribetool.desc"));
if (!(par1ItemStack.getTagCompound() == null)) {
par3List.add(
StatCollector.translateToLocal("tooltip.owner.currentowner") + " "
+ par1ItemStack.getTagCompound().getString("ownerName"));
}
addBindingInformation(par1ItemStack, par3List);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
if (IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer)) {
if (par1ItemStack.getItemDamage() > 0) {
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
}