mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
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:
1 parent
46a8c566d7
commit
b14aded91f
57 files changed
+382
-759
No files matched your search
@@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.spell.simple;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -21,7 +22,7 @@ public class SpellExplosions extends HomSpell {
|
||||
@Override
|
||||
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World,
|
||||
EntityPlayer par3EntityPlayer) {
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ public class SpellExplosions extends HomSpell {
|
||||
@Override
|
||||
public ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World,
|
||||
EntityPlayer par3EntityPlayer) {
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@@ -66,7 +67,7 @@ public class SpellExplosions extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ public class SpellExplosions extends HomSpell {
|
||||
@Override
|
||||
public ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World,
|
||||
EntityPlayer par3EntityPlayer) {
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user