Replace fields for tickDelay and isBoundTool as well as the drain cost and bound tool right click cost with overridable methods. Removed parameters from various methods and made some static methods instance methods as a consequence.

Improved the check for valid sigils to put in the Sigil of Holding by using an overridable method instead of checking if it's a SigilOfHolding.
This commit is contained in:
koolkrafter5 committed 2025-04-20 06:58:06 -04:00
1 parent 3e40aa9708
commit fc589690d0
24 files changed
+204 -101

No files matched your search

@@ -33,7 +33,6 @@ public class BoundAxe extends ItemAxe implements IBindable {
public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity;
public int rightClickCost = 10000;
public boolean isBoundTool = true;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@@ -61,6 +60,11 @@ public class BoundAxe extends ItemAxe implements IBindable {
return this.energyUsed;
}
@Override
public int drainCost() {
return this.energyUsed;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add(StatCollector.translateToLocal("tooltip.boundaxe.desc"));
@@ -86,7 +90,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (checkRightClick(par1ItemStack, par2World, par3EntityPlayer, rightClickCost)) {
if (checkRightClick(par1ItemStack, par2World, par3EntityPlayer)) {
return par1ItemStack;
}
@@ -146,7 +150,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
if (par1ItemStack.getTagCompound() == null) {
par1ItemStack.setTagCompound(new NBTTagCompound());
}
IBindable.passiveDrain(par1ItemStack, par2World, par3EntityPlayer, tickDelay, 20);
checkPassiveDrain(par1ItemStack, par2World, par3EntityPlayer);
par1ItemStack.setItemDamage(0);
}
@@ -220,4 +224,14 @@ public class BoundAxe extends ItemAxe implements IBindable {
public int getHarvestLevel(ItemStack stack, String toolClass) {
return IBindable.isActive(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
}
@Override
public boolean isBoundTool() {
return true;
}
@Override
public int rightClickCost() {
return rightClickCost;
}
}