Merge branch 'bloodmagic1.8' of https://github.com/WayofTime/BloodMagic into bloodmagic1.8
This commit is contained in:
commit
2472cad9f1
266 changed files with 2398 additions and 6083 deletions
|
@ -1,14 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
|
||||
public class AWBaseItems extends Item
|
||||
{
|
||||
|
@ -19,23 +17,6 @@ public class AWBaseItems extends Item
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (this.equals(ModItems.blankSlate))
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSlate");
|
||||
} else if (this.equals(ModItems.reinforcedSlate))
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedSlate");
|
||||
} else if (this.equals(ModItems.imbuedSlate))
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InfusedSlate");
|
||||
} else if (this.equals(ModItems.demonicSlate))
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonSlate");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,30 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
|
||||
public class ActivationCrystal extends EnergyItems
|
||||
{
|
||||
private static final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"Weak", "Awakened", "Creative"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ActivationCrystal()
|
||||
{
|
||||
super();
|
||||
|
@ -34,18 +31,6 @@ public class ActivationCrystal extends EnergyItems
|
|||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
icons = new IIcon[ACTIVATION_CRYSTAL_NAMES.length];
|
||||
|
||||
for (int i = 0; i < ACTIVATION_CRYSTAL_NAMES.length; ++i)
|
||||
{
|
||||
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "activationCrystal" + ACTIVATION_CRYSTAL_NAMES[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -119,14 +104,6 @@ public class ActivationCrystal extends EnergyItems
|
|||
return ("" + "item.activationCrystal" + ACTIVATION_CRYSTAL_NAMES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta)
|
||||
{
|
||||
int j = MathHelper.clamp_int(meta, 0, ACTIVATION_CRYSTAL_NAMES.length - 1);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class AirScribeTool extends ScribeTool
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class AirScribeTool extends ScribeTool
|
|||
{
|
||||
super(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ApprenticeBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
@ -11,11 +8,4 @@ public class ApprenticeBloodOrb extends EnergyBattery
|
|||
super(damage);
|
||||
orbLevel = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ApprenticeBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ArchmageBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
@ -11,11 +8,4 @@ public class ArchmageBloodOrb extends EnergyBattery
|
|||
super(damage);
|
||||
orbLevel = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArchmageBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
|
||||
public class ArmourInhibitor extends EnergyItems
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 200;
|
||||
|
||||
public ArmourInhibitor()
|
||||
|
@ -32,117 +24,76 @@ public class ArmourInhibitor extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
if (!(stack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (stack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
}
|
||||
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated");
|
||||
}
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (par1 == 1)
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
stack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % tickDelay);
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
stack.setItemDamage(stack.getMaxDamage());
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
if (!(entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (stack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
if (world.getWorldTime() % tickDelay == stack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
}
|
||||
|
||||
//TODO Do stuff
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0, true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellTable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -10,8 +10,8 @@ import net.minecraft.util.BlockPos;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
|
||||
public class BlankSpell extends EnergyItems
|
||||
{
|
||||
|
@ -23,69 +23,69 @@ public class BlankSpell extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
if (!(stack.getTagCompound() == null))
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
NBTTagCompound itemTag = stack.getTagCompound();
|
||||
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
if (!stack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.coords") + " " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(par1ItemStack));
|
||||
list.add(StatCollector.translateToLocal("tooltip.alchemy.coords") + " " + itemTag.getInteger("xCoord") + ", " + itemTag.getInteger("yCoord") + ", " + itemTag.getInteger("zCoord"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.alchemy.dimension") + " " + getDimensionID(stack));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
if (!world.isRemote)
|
||||
{
|
||||
World world = DimensionManager.getWorld(getDimensionID(par1ItemStack));
|
||||
World newWorld = DimensionManager.getWorld(getDimensionID(stack));
|
||||
|
||||
if (world != null)
|
||||
if (newWorld != null)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
TileEntity tileEntity = world.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
|
||||
NBTTagCompound itemTag = stack.getTagCompound();
|
||||
TileEntity tileEntity = newWorld.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
|
||||
|
||||
if (tileEntity instanceof TESpellTable)
|
||||
if (tileEntity instanceof TEHomHeart)
|
||||
{
|
||||
TESpellTable homHeart = (TESpellTable) tileEntity;
|
||||
TEHomHeart homHeart = (TEHomHeart) tileEntity;
|
||||
|
||||
if (homHeart.canCastSpell())
|
||||
if (homHeart.canCastSpell(stack, world, player))
|
||||
{
|
||||
if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.getCostForSpell()))
|
||||
if(EnergyItems.syphonBatteries(stack, player, homHeart.getCostForSpell()))
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.castSpell(par1ItemStack, par2World, par3EntityPlayer));
|
||||
EnergyItems.syphonBatteries(stack, player, homHeart.castSpell(stack, world, player));
|
||||
}
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
return par1ItemStack;
|
||||
world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
return stack;
|
||||
}
|
||||
|
||||
public int getDimensionID(ItemStack itemStack)
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
|
||||
public class BloodShard extends Item implements ArmourUpgrade
|
||||
{
|
||||
|
@ -20,22 +17,6 @@ public class BloodShard extends Item implements ArmourUpgrade
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (this.equals(ModItems.weakBloodShard))
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBloodShard");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.demonBloodShard))
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonBloodShard");
|
||||
}
|
||||
}
|
||||
|
||||
public int getBloodShardLevel()
|
||||
{
|
||||
if (this.equals(ModItems.weakBloodShard))
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLeavesBase;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -13,11 +12,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.ItemType;
|
||||
|
@ -25,17 +24,10 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
|||
|
||||
import com.google.common.collect.HashMultiset;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BoundAxe extends ItemAxe implements IBindable
|
||||
{
|
||||
public float efficiencyOnProperMaterial = 12.0F;
|
||||
public float damageVsEntity;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int energyUsed;
|
||||
|
||||
public BoundAxe()
|
||||
|
@ -81,49 +73,21 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundAxe_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par2World.isRemote)
|
||||
if (world.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -138,10 +102,7 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int posX = (int) (blockVec.xCoord);
|
||||
int posY = (int) (blockVec.yCoord);
|
||||
int posZ = (int) (blockVec.zCoord);
|
||||
BlockPos pos = par3EntityPlayer.getPosition();
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
|
||||
|
||||
|
@ -153,21 +114,22 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
{
|
||||
for (int k = -5; k <= 5; k++)
|
||||
{
|
||||
Block block = par2World.getBlock(posX + i, posY + j, posZ + k);
|
||||
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
|
||||
if (block != null)
|
||||
{
|
||||
float str = func_150893_a(par1ItemStack, block);
|
||||
float str = getStrVsBlock(par1ItemStack, block);
|
||||
|
||||
if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
|
||||
if (str > 1.1f || block instanceof BlockLeavesBase && world.canMineBlockBody(par3EntityPlayer, newPos))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
|
||||
if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
|
||||
{
|
||||
dropMultiset.add(new ItemType(block, meta));
|
||||
dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
|
||||
} else
|
||||
{
|
||||
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
|
||||
List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
|
@ -176,20 +138,20 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
}
|
||||
}
|
||||
|
||||
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
|
||||
world.setBlockToAir(newPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
|
@ -202,7 +164,7 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (world.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
|
@ -216,28 +178,14 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
if (!par1ItemStack.hasTagCompound())
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -245,14 +193,14 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
return super.func_150893_a(par1ItemStack, par2Block);
|
||||
return super.getStrVsBlock(par1ItemStack, par2Block);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -264,7 +212,7 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
return getActivated(par1ItemStack);
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World world, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -292,19 +240,19 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
* FORGE: Overridden to allow custom tool effectiveness
|
||||
*/
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
public float getDigSpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||
for (String type : getToolClasses(stack))
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
|
||||
return func_150893_a(stack, block);
|
||||
return super.getDigSpeed(stack, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -13,11 +12,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.ItemType;
|
||||
|
@ -26,17 +25,10 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
|||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multiset;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BoundPickaxe extends ItemPickaxe implements IBindable
|
||||
{
|
||||
public float efficiencyOnProperMaterial = 12.0F;
|
||||
public float damageVsEntity;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
private int energyUsed;
|
||||
|
||||
|
@ -61,14 +53,14 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
if (!(stack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (stack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -76,75 +68,44 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
}
|
||||
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
if (!stack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPickaxe_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
return par1ItemStack;
|
||||
this.setActivated(stack, !getActivated(stack));
|
||||
stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (par2World.isRemote)
|
||||
if (world.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
|
||||
if(!EnergyItems.syphonBatteries(stack, par3EntityPlayer, 10000))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int posX = (int) (blockVec.xCoord);
|
||||
int posY = (int) (blockVec.yCoord);
|
||||
int posZ = (int) (blockVec.zCoord);
|
||||
BlockPos pos = par3EntityPlayer.getPosition();
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
|
||||
|
||||
|
@ -152,43 +113,44 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
|
||||
for (int i = -5; i <= 5; i++)
|
||||
{
|
||||
for (int j = -5; j <= 5; j++)
|
||||
for (int j = 0; j <= 10; j++)
|
||||
{
|
||||
for (int k = -5; k <= 5; k++)
|
||||
{
|
||||
Block block = par2World.getBlock(posX + i, posY + j, posZ + k);
|
||||
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
|
||||
if (block != null && block.getBlockHardness(par2World, posX + i, posY + j, posZ + k) != -1)
|
||||
if (block != null)
|
||||
{
|
||||
float str = func_150893_a(par1ItemStack, block);
|
||||
float str = getStrVsBlock(stack, block);
|
||||
|
||||
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
|
||||
if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
|
||||
if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
|
||||
{
|
||||
dropMultiset.add(new ItemType(block, meta));
|
||||
dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
|
||||
} else
|
||||
{
|
||||
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
|
||||
List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
for (ItemStack stack : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
|
||||
for (ItemStack stacky : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize);
|
||||
}
|
||||
}
|
||||
|
||||
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
|
||||
world.setBlockToAir(newPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
|
||||
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static void dropMultisetStacks(Multiset<ItemType> dropMultiset, World world, double x, double y, double z)
|
||||
|
@ -212,7 +174,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack stack, World world, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
|
@ -221,47 +183,33 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (world.getWorldTime() % 200 == stack.getTagCompound().getInteger("worldTimeDelay") && stack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20))
|
||||
if(!EnergyItems.syphonBatteries(stack, par3EntityPlayer, 20))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
this.setActivated(stack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
par1ItemStack.setItemDamage(0);
|
||||
stack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
if (!par1ItemStack.hasTagCompound())
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -269,34 +217,23 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) //getStrVsBlock
|
||||
public float getStrVsBlock(ItemStack stack, Block par2Block) //getStrVsBlock
|
||||
{
|
||||
if (!getActivated(par1ItemStack))
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
return super.func_150893_a(par1ItemStack, par2Block);
|
||||
return super.getStrVsBlock(stack, par2Block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
|
||||
* the damage on the stack.
|
||||
*/
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
return getActivated(par1ItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
|
||||
if (par7EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par7EntityLivingBase, getEnergyUsed());
|
||||
}
|
||||
return true;
|
||||
return getActivated(stack);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -322,19 +259,19 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
* FORGE: Overridden to allow custom tool effectiveness
|
||||
*/
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
public float getDigSpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||
for (String type : getToolClasses(stack))
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
|
||||
return func_150893_a(stack, block);
|
||||
return super.getDigSpeed(stack, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,45 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.ItemType;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BoundShovel extends ItemSpade implements IBindable
|
||||
{
|
||||
public float efficiencyOnProperMaterial = 12.0F;
|
||||
public float damageVsEntity;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
private int energyUsed;
|
||||
|
||||
public BoundShovel()
|
||||
|
@ -85,67 +73,36 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundShovel_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
return par1ItemStack;
|
||||
this.setActivated(stack, !getActivated(stack));
|
||||
stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (par2World.isRemote)
|
||||
if (world.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
|
||||
if(!EnergyItems.syphonBatteries(stack, par3EntityPlayer, 10000))
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int posX = (int) (blockVec.xCoord);
|
||||
int posY = (int) (blockVec.yCoord);
|
||||
int posZ = (int) (blockVec.zCoord);
|
||||
BlockPos pos = par3EntityPlayer.getPosition();
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
|
||||
|
||||
|
@ -157,39 +114,40 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
{
|
||||
for (int k = -5; k <= 5; k++)
|
||||
{
|
||||
Block block = par2World.getBlock(posX + i, posY + j, posZ + k);
|
||||
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
|
||||
if (block != null)
|
||||
{
|
||||
float str = func_150893_a(par1ItemStack, block);
|
||||
float str = getStrVsBlock(stack, block);
|
||||
|
||||
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
|
||||
if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
|
||||
if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
|
||||
{
|
||||
dropMultiset.add(new ItemType(block, meta));
|
||||
dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
|
||||
} else
|
||||
{
|
||||
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
|
||||
List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
for (ItemStack stack : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
|
||||
for (ItemStack stacky : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize);
|
||||
}
|
||||
}
|
||||
|
||||
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
|
||||
world.setBlockToAir(newPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
|
||||
|
||||
return par1ItemStack;
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -220,28 +178,14 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
if (!par1ItemStack.hasTagCompound())
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,14 +193,14 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
return super.func_150893_a(par1ItemStack, par2Block);
|
||||
return super.getStrVsBlock(par1ItemStack, par2Block);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -291,31 +235,23 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers()
|
||||
{
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double) this.damageVsEntity, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
/**
|
||||
* FORGE: Overridden to allow custom tool effectiveness
|
||||
*/
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
public float getDigSpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||
for (String type : getToolClasses(stack))
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
|
||||
return func_150893_a(stack, block);
|
||||
return super.getDigSpeed(stack, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class CheatyItem extends Item implements IBindable
|
||||
{
|
||||
|
@ -29,13 +26,6 @@ public class CheatyItem extends Item implements IBindable
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -119,7 +109,7 @@ public class CheatyItem extends Item implements IBindable
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,10 +166,4 @@ public class CheatyItem extends Item implements IBindable
|
|||
int currentEssence = data.currentEssence;
|
||||
return (currentEssence);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
|
||||
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
|
||||
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
|
||||
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
|
@ -20,7 +22,6 @@ public class CreativeDagger extends Item
|
|||
public CreativeDagger()
|
||||
{
|
||||
super();
|
||||
setTextureName("AlchemicalWizardry:SacrificialDagger");
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setFull3D();
|
||||
|
@ -69,7 +70,7 @@ public class CreativeDagger extends Item
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
|
||||
if (!world.isRemote && SpellHelper.isFakePlayer(world, player))
|
||||
|
@ -83,10 +84,8 @@ public class CreativeDagger extends Item
|
|||
|
||||
public void findAndFillAltar(World world, EntityPlayer player, int amount)
|
||||
{
|
||||
int posX = (int) Math.round(player.posX - 0.5f);
|
||||
int posY = (int) player.posY;
|
||||
int posZ = (int) Math.round(player.posZ - 0.5f);
|
||||
IBloodAltar altarEntity = getAltar(world, posX, posY, posZ);
|
||||
BlockPos pos = player.getPosition();
|
||||
IBloodAltar altarEntity = getAltar(world, pos);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -97,7 +96,7 @@ public class CreativeDagger extends Item
|
|||
altarEntity.startCycle();
|
||||
}
|
||||
|
||||
public IBloodAltar getAltar(World world, int x, int y, int z)
|
||||
public IBloodAltar getAltar(World world, BlockPos pos)
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
|
||||
|
@ -107,7 +106,8 @@ public class CreativeDagger extends Item
|
|||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
tileEntity = world.getTileEntity(newPos);
|
||||
|
||||
if(tileEntity instanceof IBloodAltar)
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
|
@ -17,20 +17,18 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.common.IDemon;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class DaggerOfSacrifice extends EnergyItems
|
||||
{
|
||||
public DaggerOfSacrifice()
|
||||
|
@ -43,13 +41,6 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
setMaxDamage(100);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DaggerOfSacrifice");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
|
@ -118,7 +109,7 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (par2Block == Blocks.web)
|
||||
{
|
||||
|
@ -140,16 +131,14 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
public Multimap getItemAttributeModifiers()
|
||||
{
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 1.0d, 0));
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(4186465, 46565), "Tool modifier", 1.0d, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice)
|
||||
{
|
||||
int posX = (int) Math.round(sacrifice.posX - 0.5f);
|
||||
int posY = (int) sacrifice.posY;
|
||||
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
|
||||
IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ);
|
||||
BlockPos pos = sacrifice.getPosition();
|
||||
IBloodAltar altarEntity = this.getAltar(world, pos);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -163,10 +152,8 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
|
||||
public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount)
|
||||
{
|
||||
int posX = (int) Math.round(sacrifice.posX - 0.5f);
|
||||
int posY = (int) sacrifice.posY;
|
||||
int posZ = (int) Math.round(sacrifice.posZ - 0.5f);
|
||||
IBloodAltar altarEntity = this.getAltar(world, posX, posY, posZ);
|
||||
BlockPos pos = sacrifice.getPosition();
|
||||
IBloodAltar altarEntity = this.getAltar(world, pos);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -178,7 +165,7 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
return true;
|
||||
}
|
||||
|
||||
public IBloodAltar getAltar(World world, int x, int y, int z)
|
||||
public IBloodAltar getAltar(World world, BlockPos pos)
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
|
||||
|
@ -188,7 +175,8 @@ public class DaggerOfSacrifice extends EnergyItems
|
|||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
tileEntity = world.getTileEntity(newPos);
|
||||
|
||||
if ((tileEntity instanceof IBloodAltar))
|
||||
{
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class DawnScribeTool extends ScribeTool
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class DawnScribeTool extends ScribeTool
|
|||
{
|
||||
super(6);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DawnScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,29 +1,24 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityList.EntityEggInfo;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Facing;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
|
||||
public class DemonPlacer extends Item
|
||||
{
|
||||
|
@ -35,48 +30,45 @@ public class DemonPlacer extends Item
|
|||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
||||
{
|
||||
EntityEggInfo entityegginfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage()));
|
||||
return entityegginfo != null ? (par2 == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
||||
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (par3World.isRemote)
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else
|
||||
}
|
||||
else if (!playerIn.func_175151_a(pos.offset(side), side, stack))
|
||||
{
|
||||
Block i1 = par3World.getBlock(par4, par5, par6);
|
||||
par4 += Facing.offsetsXForSide[par7];
|
||||
par5 += Facing.offsetsYForSide[par7];
|
||||
par6 += Facing.offsetsZForSide[par7];
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate = world.getBlockState(pos);
|
||||
|
||||
pos = pos.offset(side);
|
||||
double d0 = 0.0D;
|
||||
|
||||
if (par7 == 1 && i1 != null && i1.getRenderType() == 11)
|
||||
if (side == EnumFacing.UP && iblockstate instanceof BlockFence)
|
||||
{
|
||||
d0 = 0.5D;
|
||||
}
|
||||
|
||||
String demonName = DemonPlacer.getDemonString(par1ItemStack);
|
||||
Entity entity = spawnCreature(par3World, demonName, (double) par4 + 0.5D, (double) par5 + d0, (double) par6 + 0.5D, par1ItemStack);
|
||||
String demonName = DemonPlacer.getDemonString(stack);
|
||||
Entity entity = spawnCreature(world, demonName, (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D, stack);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
|
||||
if (entity instanceof EntityLivingBase && stack.hasDisplayName())
|
||||
{
|
||||
((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
|
||||
entity.setCustomNameTag(stack.getDisplayName());
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--par1ItemStack.stackSize;
|
||||
--stack.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,64 +76,6 @@ public class DemonPlacer extends Item
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
} else
|
||||
{
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return par1ItemStack;
|
||||
} else
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par2World.getBlock(i, j, k).getMaterial() == Material.water)
|
||||
{
|
||||
String demonName = DemonPlacer.getDemonString(par1ItemStack);
|
||||
Entity entity = spawnCreature(par2World, demonName, (double) i, (double) j, (double) k, par1ItemStack);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
|
||||
{
|
||||
((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
--par1ItemStack.stackSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns the creature specified by the egg's type in the location specified by the last three parameters.
|
||||
* Parameters: world, entityID, x, y, z.
|
||||
|
@ -230,11 +164,4 @@ public class DemonPlacer extends Item
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPlacer");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DemonicTelepositionFocus extends TelepositionFocus
|
||||
{
|
||||
public DemonicTelepositionFocus()
|
||||
|
@ -17,13 +14,6 @@ public class DemonicTelepositionFocus extends TelepositionFocus
|
|||
super(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonicTeleposerFocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class DuskScribeTool extends ScribeTool
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class DuskScribeTool extends ScribeTool
|
|||
{
|
||||
super(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class EarthScribeTool extends ScribeTool
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class EarthScribeTool extends ScribeTool
|
|||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,5 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
|
@ -7,18 +17,6 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
|||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
||||
{
|
||||
|
@ -34,13 +32,6 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
|
|||
orbLevel = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -125,7 +116,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,10 +201,4 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
|
|||
|
||||
return data.currentEssence;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
|
||||
|
||||
public class EnergyBazooka extends EnergyItems
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int damage;
|
||||
|
||||
public EnergyBazooka()
|
||||
|
@ -35,34 +27,6 @@ public class EnergyBazooka extends EnergyItems
|
|||
damage = 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBazooka_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -168,28 +132,14 @@ public class EnergyBazooka extends EnergyItems
|
|||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
public void setDelay(ItemStack par1ItemStack, int newDelay)
|
||||
|
|
|
@ -1,26 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
|
||||
public class EnergyBlast extends EnergyItems
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int damage;
|
||||
|
||||
public EnergyBlast()
|
||||
|
@ -35,34 +27,6 @@ public class EnergyBlast extends EnergyItems
|
|||
damage = 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBlaster_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -162,28 +126,14 @@ public class EnergyBlast extends EnergyItems
|
|||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
public void setDelay(ItemStack par1ItemStack, int newDelay)
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -14,21 +13,14 @@ import net.minecraft.item.ItemSword;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EnergySword extends ItemSword
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int energyUsed;
|
||||
|
||||
public EnergySword()
|
||||
|
@ -50,34 +42,6 @@ public class EnergySword extends ItemSword
|
|||
{
|
||||
return this.energyUsed;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundSword_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
private OmegaParadigm getOmegaParadigmOfWeilder(EntityPlayer player)
|
||||
{
|
||||
|
@ -171,28 +135,14 @@ public class EnergySword extends ItemSword
|
|||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
public float func_82803_g()
|
||||
|
@ -224,7 +174,7 @@ public class EnergySword extends ItemSword
|
|||
}
|
||||
|
||||
@Override
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (par2Block == Blocks.web)
|
||||
{
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EnhancedTelepositionFocus extends TelepositionFocus
|
||||
{
|
||||
public EnhancedTelepositionFocus()
|
||||
|
@ -17,13 +14,6 @@ public class EnhancedTelepositionFocus extends TelepositionFocus
|
|||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedTeleposerFocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class FireScribeTool extends ScribeTool
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class FireScribeTool extends ScribeTool
|
|||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:FireScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,30 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
|
||||
public class ItemAlchemyBase extends Item
|
||||
{
|
||||
private static final String[] ITEM_NAMES = new String[]{"Offensa", "Praesidium", "OrbisTerrae", "StrengthenedCatalyst", "ConcentratedCatalyst", "FracturedBone", "Virtus", "Reductus", "Potentia"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ItemAlchemyBase()
|
||||
{
|
||||
super();
|
||||
|
@ -33,18 +30,6 @@ public class ItemAlchemyBase extends Item
|
|||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
icons = new IIcon[ITEM_NAMES.length];
|
||||
|
||||
for (int i = 0; i < ITEM_NAMES.length; ++i)
|
||||
{
|
||||
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseAlchemyItem" + ITEM_NAMES[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -85,14 +70,6 @@ public class ItemAlchemyBase extends Item
|
|||
return ("" + "item.bloodMagicAlchemyItem." + ITEM_NAMES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta)
|
||||
{
|
||||
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
|
||||
|
|
|
@ -3,11 +3,14 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
@ -77,17 +80,14 @@ public class ItemBlockCrystalBelljar extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
|
||||
{
|
||||
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!world.setBlockState(pos, newState, 3)) return false;
|
||||
|
||||
if (world.getBlock(x, y, z) == field_150939_a)
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() == this.block)
|
||||
{
|
||||
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
this.block.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -2,14 +2,13 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -18,14 +17,9 @@ import WayofTime.alchemicalWizardry.api.items.IAltarManipulator;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAltarManipulator
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
|
||||
{
|
||||
public int conversionRate = 100; //LP / half heart
|
||||
public float activationPoint = 0.5f;
|
||||
public int tickRate = 20;
|
||||
|
@ -37,13 +31,6 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodPack");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -54,12 +41,6 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
par3List.add(StatCollector.translateToLocal("tooltip.lp.storedlp") + " " + this.getStoredLP(par1ItemStack));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||
|
@ -84,11 +65,9 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (!(tile instanceof TEAltar))
|
||||
{
|
||||
|
@ -106,7 +85,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
amount -= filledAmount;
|
||||
this.setStoredLP(itemStack, amount);
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
world.markBlockForUpdate(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
|
||||
public class ItemComplexSpellCrystal extends EnergyItems
|
||||
{
|
||||
|
@ -24,13 +22,6 @@ public class ItemComplexSpellCrystal extends EnergyItems
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ComplexCrystal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -65,7 +56,7 @@ public class ItemComplexSpellCrystal extends EnergyItems
|
|||
if (world != null)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord"));
|
||||
TileEntity tileEntity = world.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
|
||||
|
||||
if (tileEntity instanceof TESpellParadigmBlock)
|
||||
{
|
||||
|
|
|
@ -1,26 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
|
||||
public class ItemComponents extends Item
|
||||
{
|
||||
private static final String[] ITEM_NAMES = new String[]{"QuartzRod", "EmptyCore", "MagicalesCable", "WoodBrace", "StoneBrace", "ProjectileCore", "SelfCore", "MeleeCore", "ParadigmBackPlate", "OutputCable", "FlameCore", "IcyCore", "GustCore", "EarthenCore", "InputCable", "CrackedRunicPlate", "RunicPlate", "ScribedRunicPlate", "DefaultCore", "OffensiveCore", "DefensiveCore", "EnvironmentalCore", "PowerCore", "CostCore", "PotencyCore", "ObsidianBrace", "ToolCore", "EtherealSlate", "LifeShard", "SoulShard", "SoulRunicPlate", "LifeBrace", "EnderShard"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ItemComponents()
|
||||
{
|
||||
super();
|
||||
|
@ -29,18 +24,6 @@ public class ItemComponents extends Item
|
|||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
icons = new IIcon[ITEM_NAMES.length];
|
||||
|
||||
for (int i = 0; i < ITEM_NAMES.length; ++i)
|
||||
{
|
||||
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseItem" + ITEM_NAMES[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -55,14 +38,6 @@ public class ItemComponents extends Item
|
|||
return ("" + "item.bloodMagicBaseItem." + ITEM_NAMES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta)
|
||||
{
|
||||
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
@ -16,8 +11,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class ItemDiabloKey extends EnergyItems
|
||||
{
|
||||
|
@ -30,13 +29,6 @@ public class ItemDiabloKey extends EnergyItems
|
|||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DiabloKey");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -2,32 +2,27 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.sacrifice.IIncense;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemIncense extends Item implements IIncense
|
||||
{
|
||||
private static final String[] ITEM_NAMES = new String[]{"Woodash", "Byrrus", "Livens", "Viridis", "Purpura"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ItemIncense()
|
||||
{
|
||||
super();
|
||||
|
@ -36,26 +31,6 @@ public class ItemIncense extends Item implements IIncense
|
|||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
icons = new IIcon[ITEM_NAMES.length];
|
||||
|
||||
IIcon baseIcon = iconRegister.registerIcon("AlchemicalWizardry:" + "baseIncenseItem");
|
||||
|
||||
for (int i = 0; i < ITEM_NAMES.length; ++i)
|
||||
{
|
||||
if(this.doesIncenseHaveUniqueTexture(i))
|
||||
{
|
||||
icons[i] = iconRegister.registerIcon("AlchemicalWizardry:" + "baseIncenseItem" + ITEM_NAMES[i]);
|
||||
}else
|
||||
{
|
||||
icons[i] = baseIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
|
@ -69,14 +44,6 @@ public class ItemIncense extends Item implements IIncense
|
|||
return ("" + "item.bloodMagicIncenseItem." + ITEM_NAMES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta)
|
||||
{
|
||||
int j = MathHelper.clamp_int(meta, 0, ITEM_NAMES.length - 1);
|
||||
return icons[j];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.MailOrderEntityItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMailOrderCatalogue extends Item
|
||||
{
|
||||
|
@ -18,13 +15,6 @@ public class ItemMailOrderCatalogue extends Item
|
|||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MailOrder");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomEntity(ItemStack stack)
|
||||
{
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockRitualStone;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemRitualDismantler extends EnergyItems
|
||||
{
|
||||
|
@ -26,13 +25,6 @@ public class ItemRitualDismantler extends EnergyItems
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ritual_dismantler");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x)
|
||||
{
|
||||
|
@ -42,15 +34,15 @@ public class ItemRitualDismantler extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return EnergyItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, x, y, z);
|
||||
return EnergyItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, pos);
|
||||
}
|
||||
|
||||
public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z)
|
||||
public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos)
|
||||
{
|
||||
ItemStack[] playerInventory = player.inventory.mainInventory;
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
|
@ -75,17 +67,18 @@ public class ItemRitualDismantler extends EnergyItems
|
|||
|
||||
for (RitualComponent rc : ritualList)
|
||||
{
|
||||
if (!world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) && world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)) instanceof BlockRitualStone)
|
||||
BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction));
|
||||
if (!world.isAirBlock(newPos) && world.getBlockState(newPos).getBlock() instanceof BlockRitualStone)
|
||||
{
|
||||
if (freeSpace >= 0)
|
||||
{
|
||||
if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode)
|
||||
{
|
||||
world.setBlockToAir(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
world.setBlockToAir(newPos);
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.ritualStone));
|
||||
if (world.isRemote)
|
||||
{
|
||||
world.playAuxSFX(2005, x, y + 1, z, 0);
|
||||
world.playAuxSFX(2005, pos.offsetUp(), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -12,11 +12,15 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
|
@ -29,8 +33,6 @@ import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
|||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
||||
{
|
||||
|
@ -46,13 +48,6 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:RitualDiviner");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x)
|
||||
{
|
||||
|
@ -166,15 +161,15 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack, player)) return false;
|
||||
|
||||
if(placeRitualStoneAtMasterStone(stack, player, world, x, y, z))
|
||||
if(placeRitualStoneAtMasterStone(stack, player, world, pos))
|
||||
{
|
||||
this.setStoredLocation(stack, new Int3(x, y, z));
|
||||
this.setStoredLocation(stack, new Int3(pos));
|
||||
return true;
|
||||
}else if(!(world.getBlock(x, y, z) instanceof IRitualStone || world.getBlock(x, y, z) instanceof IMasterRitualStone) && !player.isSneaking())
|
||||
}else if(!(world.getBlockState(pos).getBlock() instanceof IRitualStone || world.getBlockState(pos).getBlock() instanceof IMasterRitualStone) && !player.isSneaking())
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
|
@ -188,12 +183,12 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z)
|
||||
public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos)
|
||||
{
|
||||
int direction = this.getDirection(stack);
|
||||
|
||||
ItemStack[] playerInventory = player.inventory.mainInventory;
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
|
@ -221,13 +216,15 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
|
||||
for (RitualComponent rc : ritualList)
|
||||
{
|
||||
if (world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)))
|
||||
BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction));
|
||||
|
||||
if (world.isAirBlock(newPos))
|
||||
{
|
||||
if (playerInvRitualStoneLocation >= 0 || player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack))
|
||||
{
|
||||
world.playAuxSFX(200, x, y + 1, z, 0);
|
||||
world.playAuxSFX(200, newPos.offsetUp(), 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -238,11 +235,11 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
|
||||
if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
world.setBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), ModBlocks.ritualStone, rc.getStoneType(), 3);
|
||||
world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3);
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
world.playAuxSFX(2005, x, y + 1, z, 0);
|
||||
world.playAuxSFX(2005, newPos.offsetUp(), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -252,29 +249,29 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
}
|
||||
} else
|
||||
{
|
||||
Block block = world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
|
||||
if (block == ModBlocks.ritualStone)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
|
||||
int metadata = block.getMetaFromState(state);
|
||||
if (metadata != rc.getStoneType())
|
||||
{
|
||||
if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack))
|
||||
{
|
||||
world.playAuxSFX(200, x, y + 1, z, 0);
|
||||
world.playAuxSFX(200, newPos.offsetUp(), 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
world.setBlockMetadataWithNotify(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), rc.getStoneType(), 3);
|
||||
world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
world.playAuxSFX(0, x, y + 1, z, 0);
|
||||
world.playAuxSFX(0, newPos.offsetUp(), 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -295,7 +292,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
|||
int y = loc.yCoord;
|
||||
int z = loc.zCoord;
|
||||
|
||||
if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, x, y, z))
|
||||
if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, new BlockPos(x, y, z)))
|
||||
{
|
||||
this.voidStoredLocation(stack);
|
||||
}
|
||||
|
|
|
@ -2,18 +2,13 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
|
||||
public class LavaCrystal extends EnergyItems
|
||||
{
|
||||
|
@ -26,13 +21,6 @@ public class LavaCrystal extends EnergyItems
|
|||
setEnergyUsed(25);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaCrystal");
|
||||
}
|
||||
|
||||
/*
|
||||
* Used to have the item contain itself.
|
||||
*/
|
||||
|
@ -83,22 +71,7 @@ public class LavaCrystal extends EnergyItems
|
|||
return false;
|
||||
}
|
||||
|
||||
// World world = MinecraftServer.getServer().worldServers[0];
|
||||
WorldProvider provider = DimensionManager.getProvider(0);
|
||||
if(provider == null || provider.worldObj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
World world = provider.worldObj;
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(ownerName);
|
||||
world.setItemData(ownerName, data);
|
||||
}
|
||||
|
||||
if (data.currentEssence >= this.getEnergyUsed())
|
||||
if (SoulNetworkHandler.getCurrentEssence(ownerName) >= this.getEnergyUsed())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
|
||||
public class LifeBucket extends ItemBucket
|
||||
|
@ -12,11 +9,4 @@ public class LifeBucket extends ItemBucket
|
|||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LifeBucket");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class MagicianBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
@ -11,11 +8,4 @@ public class MagicianBloodOrb extends EnergyBattery
|
|||
super(damage);
|
||||
orbLevel = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MagicianBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class MasterBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
@ -11,11 +8,4 @@ public class MasterBloodOrb extends EnergyBattery
|
|||
super(damage);
|
||||
orbLevel = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -21,13 +18,6 @@ public class OrbOfTesting extends EnergyItems
|
|||
this.setEnergyUsed(100);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Untitled");
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!par3EntityPlayer.shouldHeal())
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReinforcedTelepositionFocus extends TelepositionFocus
|
||||
{
|
||||
public ReinforcedTelepositionFocus()
|
||||
|
@ -17,13 +14,6 @@ public class ReinforcedTelepositionFocus extends TelepositionFocus
|
|||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ReinforcedTeleposerFocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
|
@ -10,18 +9,20 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
|
||||
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
|
||||
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SacrificialDagger extends Item
|
||||
{
|
||||
|
@ -33,19 +34,6 @@ public class SacrificialDagger extends Item
|
|||
setFull3D();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
} else
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -85,7 +73,7 @@ public class SacrificialDagger extends Item
|
|||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack stack)
|
||||
{
|
||||
return EnumAction.bow;
|
||||
return EnumAction.BOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,7 +120,7 @@ public class SacrificialDagger extends Item
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
|
||||
if (!world.isRemote && SpellHelper.isFakePlayer(world, player))
|
||||
|
@ -158,10 +146,8 @@ public class SacrificialDagger extends Item
|
|||
|
||||
public void findAndFillAltar(World world, EntityPlayer player, int amount)
|
||||
{
|
||||
int posX = (int) Math.round(player.posX - 0.5f);
|
||||
int posY = (int) player.posY;
|
||||
int posZ = (int) Math.round(player.posZ - 0.5f);
|
||||
IBloodAltar altarEntity = getAltar(world, posX, posY, posZ);
|
||||
BlockPos pos = player.getPosition();
|
||||
IBloodAltar altarEntity = getAltar(world, pos);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -172,7 +158,7 @@ public class SacrificialDagger extends Item
|
|||
altarEntity.startCycle();
|
||||
}
|
||||
|
||||
public IBloodAltar getAltar(World world, int x, int y, int z)
|
||||
public IBloodAltar getAltar(World world, BlockPos pos)
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
|
||||
|
@ -182,7 +168,8 @@ public class SacrificialDagger extends Item
|
|||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
tileEntity = world.getTileEntity(newPos);
|
||||
|
||||
if(tileEntity instanceof IBloodAltar)
|
||||
{
|
||||
|
@ -240,8 +227,8 @@ public class SacrificialDagger extends Item
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack stack, int pass)
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return this.canUseForSacrifice(stack) || super.hasEffect(stack, pass);
|
||||
return this.canUseForSacrifice(stack) || super.hasEffect(stack);
|
||||
}
|
||||
}
|
|
@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -11,8 +10,6 @@ import net.minecraft.util.StatCollector;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TelepositionFocus extends EnergyItems
|
||||
{
|
||||
|
@ -26,13 +23,6 @@ public class TelepositionFocus extends EnergyItems
|
|||
this.focusLevel = focusLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TeleposerFocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class TranscendentBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
@ -11,11 +8,4 @@ public class TranscendentBloodOrb extends EnergyBattery
|
|||
super(damage);
|
||||
orbLevel = 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TranscendentBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class WaterScribeTool extends ScribeTool
|
||||
{
|
||||
|
@ -12,11 +9,4 @@ public class WaterScribeTool extends ScribeTool
|
|||
super(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterScribeTool");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,26 +3,24 @@ package WayofTime.alchemicalWizardry.common.items.armour;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
|
||||
|
@ -32,23 +30,12 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge;
|
|||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilDivination;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Optional.InterfaceList(value = {@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IRunicArmor", modid = "Thaumcraft")})
|
||||
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor, ILPGauge
|
||||
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, ILPGauge//, IRevealer, IGoggles, IRunicArmor
|
||||
{
|
||||
private static int invSize = 9;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon helmetIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
public static boolean tryComplexRendering = true;
|
||||
|
||||
|
@ -109,10 +96,10 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0)
|
||||
{
|
||||
EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction();
|
||||
if (enumaction == EnumAction.block)
|
||||
if (enumaction == EnumAction.BLOCK)
|
||||
{
|
||||
this.model.heldItemRight = 3;
|
||||
} else if (enumaction == EnumAction.bow)
|
||||
} else if (enumaction == EnumAction.BOW)
|
||||
{
|
||||
this.model.aimedBow = true;
|
||||
}
|
||||
|
@ -128,44 +115,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundHelmet");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPlate");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.boundHelmet))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundPlate))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundLeggings))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundBoots))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
|
||||
{
|
||||
|
@ -594,66 +543,66 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
return false;
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public boolean hasIRevealer(ItemStack itemStack)
|
||||
{
|
||||
ItemStack[] inv = getInternalInventory(itemStack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (ItemStack item : inv)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.getItem() instanceof IRevealer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public boolean hasIGoggles(ItemStack itemStack)
|
||||
{
|
||||
ItemStack[] inv = getInternalInventory(itemStack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int blood = getMaxBloodShardLevel(itemStack);
|
||||
|
||||
for (ItemStack item : inv)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.getItem() instanceof ArmourUpgrade && blood > 0)
|
||||
{
|
||||
if (item.getItem() instanceof IGoggles)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(((ArmourUpgrade)item.getItem()).isUpgrade())
|
||||
{
|
||||
blood--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// @Optional.Method(modid = "Thaumcraft")
|
||||
// public boolean hasIRevealer(ItemStack itemStack)
|
||||
// {
|
||||
// ItemStack[] inv = getInternalInventory(itemStack);
|
||||
//
|
||||
// if (inv == null)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// for (ItemStack item : inv)
|
||||
// {
|
||||
// if (item == null)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (item.getItem() instanceof IRevealer)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Optional.Method(modid = "Thaumcraft")
|
||||
// public boolean hasIGoggles(ItemStack itemStack)
|
||||
// {
|
||||
// ItemStack[] inv = getInternalInventory(itemStack);
|
||||
//
|
||||
// if (inv == null)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// int blood = getMaxBloodShardLevel(itemStack);
|
||||
//
|
||||
// for (ItemStack item : inv)
|
||||
// {
|
||||
// if (item == null)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// if (item.getItem() instanceof ArmourUpgrade && blood > 0)
|
||||
// {
|
||||
// if (item.getItem() instanceof IGoggles)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// if(((ArmourUpgrade)item.getItem()).isUpgrade())
|
||||
// {
|
||||
// blood--;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean canSeeLPBar(ItemStack itemStack)
|
||||
|
@ -783,75 +732,75 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
tag.setBoolean("invisible", invisible);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
|
||||
{
|
||||
return this.hasIRevealer(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player)
|
||||
{
|
||||
return this.hasIGoggles(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public int getRunicCharge(ItemStack itemstack)
|
||||
{
|
||||
ItemStack[] inv = this.getInternalInventory(itemstack);
|
||||
int shardLevel = this.getMaxBloodShardLevel(itemstack);
|
||||
int count = 0;
|
||||
int harden = 0;
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (ItemStack stack : inv)
|
||||
{
|
||||
if (count >= shardLevel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (stack == null || !(stack.getItem() instanceof ArmourUpgrade))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
int enchLvl = tag.getByte("RS.HARDEN");
|
||||
|
||||
if (stack.getItem() instanceof IRunicArmor)
|
||||
{
|
||||
enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack);
|
||||
}
|
||||
|
||||
if (enchLvl > 0)
|
||||
{
|
||||
harden += enchLvl;
|
||||
if (((ArmourUpgrade) stack.getItem()).isUpgrade())
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return harden;
|
||||
}
|
||||
// @Override
|
||||
// @Optional.Method(modid = "Thaumcraft")
|
||||
// public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
|
||||
// {
|
||||
// return this.hasIRevealer(itemstack);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Optional.Method(modid = "Thaumcraft")
|
||||
// public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player)
|
||||
// {
|
||||
// return this.hasIGoggles(itemstack);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Optional.Method(modid = "Thaumcraft")
|
||||
// public int getRunicCharge(ItemStack itemstack)
|
||||
// {
|
||||
// ItemStack[] inv = this.getInternalInventory(itemstack);
|
||||
// int shardLevel = this.getMaxBloodShardLevel(itemstack);
|
||||
// int count = 0;
|
||||
// int harden = 0;
|
||||
//
|
||||
// if (inv == null)
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// for (ItemStack stack : inv)
|
||||
// {
|
||||
// if (count >= shardLevel)
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// if (stack == null || !(stack.getItem() instanceof ArmourUpgrade))
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (stack.getItem() instanceof ItemArmor && ((ItemArmor) stack.getItem()).armorType != this.armorType)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (stack.hasTagCompound())
|
||||
// {
|
||||
// NBTTagCompound tag = stack.getTagCompound();
|
||||
//
|
||||
// int enchLvl = tag.getByte("RS.HARDEN");
|
||||
//
|
||||
// if (stack.getItem() instanceof IRunicArmor)
|
||||
// {
|
||||
// enchLvl += ((IRunicArmor) stack.getItem()).getRunicCharge(stack);
|
||||
// }
|
||||
//
|
||||
// if (enchLvl > 0)
|
||||
// {
|
||||
// harden += enchLvl;
|
||||
// if (((ArmourUpgrade) stack.getItem()).isUpgrade())
|
||||
// {
|
||||
// count += 1;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return harden;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player)
|
||||
|
|
|
@ -20,15 +20,16 @@ import net.minecraft.item.EnumAction;
|
|||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class OmegaArmour extends BoundArmour
|
||||
{
|
||||
|
@ -90,10 +91,9 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
{
|
||||
if(this.storeBiomeID())
|
||||
{
|
||||
int xCoord = (int) Math.floor(player.posX);
|
||||
int zCoord = (int) Math.floor(player.posZ);
|
||||
BlockPos pos = player.getPosition();
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(pos);
|
||||
if(biome != null)
|
||||
{
|
||||
this.setBiomeIDStored(itemStack, biome.biomeID);
|
||||
|
@ -376,10 +376,10 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0)
|
||||
{
|
||||
EnumAction enumaction = ((EntityPlayer) entityLiving).getItemInUse().getItemUseAction();
|
||||
if (enumaction == EnumAction.block)
|
||||
if (enumaction == EnumAction.BLOCK)
|
||||
{
|
||||
this.model.heldItemRight = 3;
|
||||
} else if (enumaction == EnumAction.bow)
|
||||
} else if (enumaction == EnumAction.BOW)
|
||||
{
|
||||
this.model.aimedBow = true;
|
||||
}
|
||||
|
|
|
@ -3,32 +3,19 @@ package WayofTime.alchemicalWizardry.common.items.armour;
|
|||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OmegaArmourEarth extends OmegaArmour
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon helmetIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
{
|
||||
public OmegaArmourEarth(int armorType)
|
||||
{
|
||||
super(armorType);
|
||||
|
@ -55,44 +42,6 @@ public class OmegaArmourEarth extends OmegaArmour
|
|||
return new ModelOmegaEarth(0.5f, false, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_earth");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_earth");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_earth");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_earth");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.boundHelmetEarth))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundPlateEarth))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundLeggingsEarth))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundBootsEarth))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
|
|
|
@ -2,34 +2,22 @@ package WayofTime.alchemicalWizardry.common.items.armour;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
public class OmegaArmourFire extends OmegaArmour
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon helmetIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
{
|
||||
public OmegaArmourFire(int armorType)
|
||||
{
|
||||
super(armorType);
|
||||
|
@ -57,44 +45,6 @@ public class OmegaArmourFire extends OmegaArmour
|
|||
return new ModelOmegaFire(0.5f, false, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_fire");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_fire");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_fire");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_fire");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.boundHelmetFire))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundPlateFire))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundLeggingsFire))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundBootsFire))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
|
|
|
@ -2,33 +2,21 @@ package WayofTime.alchemicalWizardry.common.items.armour;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWater;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
public class OmegaArmourWater extends OmegaArmour
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon helmetIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
{
|
||||
public OmegaArmourWater(int armorType)
|
||||
{
|
||||
super(armorType);
|
||||
|
@ -55,44 +43,6 @@ public class OmegaArmourWater extends OmegaArmour
|
|||
return new ModelOmegaWater(0.5f, false, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_water");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_water");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_water");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_water");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.boundHelmetWater))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundPlateWater))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundLeggingsWater))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundBootsWater))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
|
|
|
@ -3,32 +3,19 @@ package WayofTime.alchemicalWizardry.common.items.armour;
|
|||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OmegaArmourWind extends OmegaArmour
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon helmetIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
{
|
||||
public OmegaArmourWind(int armorType)
|
||||
{
|
||||
super(armorType);
|
||||
|
@ -55,44 +42,6 @@ public class OmegaArmourWind extends OmegaArmour
|
|||
return new ModelOmegaWind(0.5f, false, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_wind");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_wind");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_wind");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_wind");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.boundHelmetWind))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundPlateWind))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundLeggingsWind))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.boundBootsWind))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
|
|
|
@ -1,36 +1,34 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.*;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
|
||||
public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
||||
{
|
||||
public static final int maxDistance = 6;
|
||||
|
||||
public IIcon crystalBody;
|
||||
public IIcon crystalLabel;
|
||||
|
||||
|
||||
public ItemAttunedCrystal()
|
||||
{
|
||||
super();
|
||||
|
@ -78,62 +76,6 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal1");
|
||||
this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:AttunedCrystal2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
case 1:
|
||||
Reagent reagent = this.getReagent(stack);
|
||||
if (reagent != null)
|
||||
{
|
||||
return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(int meta)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return this.crystalBody;
|
||||
case 1:
|
||||
return this.crystalLabel;
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -157,11 +99,9 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (!(tile instanceof IReagentHandler))
|
||||
{
|
||||
|
@ -172,7 +112,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(EnumFacing.UP);
|
||||
if (infos != null)
|
||||
{
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
|
@ -223,13 +163,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
return itemStack;
|
||||
}
|
||||
|
||||
if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance)
|
||||
if (dimension != world.provider.getDimensionId() || Math.abs(coords.xCoord - pos.getX()) > maxDistance || Math.abs(coords.yCoord - pos.getY()) > maxDistance || Math.abs(coords.zCoord - pos.getZ()) > maxDistance)
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
TileEntity pastTile = world.getTileEntity(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
|
||||
if (!(pastTile instanceof TEReagentConduit))
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
||||
|
@ -247,10 +187,10 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, x, y, z);
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, pos);
|
||||
} else
|
||||
{
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z))
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, pos))
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name));
|
||||
} else
|
||||
|
@ -258,13 +198,13 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
|||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
world.markBlockForUpdate(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
|
||||
} else
|
||||
{
|
||||
int dimension = world.provider.getDimensionId();
|
||||
|
||||
this.setDimension(itemStack, dimension);
|
||||
this.setCoordinates(itemStack, new Int3(x, y, z));
|
||||
this.setCoordinates(itemStack, new Int3(pos));
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking"));
|
||||
}
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
|
||||
public class ItemDestinationClearer extends Item implements IReagentManipulator
|
||||
{
|
||||
|
@ -26,13 +24,6 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
|
|||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
@ -57,11 +48,9 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (!(tile instanceof TEReagentConduit))
|
||||
{
|
||||
|
|
|
@ -1,33 +1,29 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.*;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
|
||||
public class ItemTankSegmenter extends Item implements IReagentManipulator
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon crystalBody;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon crystalLabel;
|
||||
|
||||
public ItemTankSegmenter()
|
||||
{
|
||||
super();
|
||||
|
@ -64,62 +60,6 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.crystalBody = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter1");
|
||||
this.crystalLabel = iconRegister.registerIcon("AlchemicalWizardry:TankSegmenter2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
case 1:
|
||||
Reagent reagent = this.getReagent(stack);
|
||||
if (reagent != null)
|
||||
{
|
||||
return (reagent.getColourRed() * 256 * 256 + reagent.getColourGreen() * 256 + reagent.getColourBlue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 256 * (256 * 255 + 255) + 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(int meta)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass)
|
||||
{
|
||||
switch (pass)
|
||||
{
|
||||
case 0:
|
||||
return this.crystalBody;
|
||||
case 1:
|
||||
return this.crystalLabel;
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -136,10 +76,8 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (!(tile instanceof ISegmentedReagentHandler))
|
||||
{
|
||||
return itemStack;
|
||||
|
@ -148,7 +86,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(EnumFacing.UP);
|
||||
if (infos != null)
|
||||
{
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.ai.attributes.IAttribute;
|
||||
|
@ -23,12 +23,10 @@ import net.minecraft.util.EnumChatFormatting;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
|
||||
public class AlchemyFlask extends Item
|
||||
{
|
||||
|
@ -40,13 +38,6 @@ public class AlchemyFlask extends Item
|
|||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:PotionFlask");
|
||||
}
|
||||
|
||||
public static ArrayList<AlchemyPotionHelper> getEffects(ItemStack par1ItemStack)
|
||||
{
|
||||
if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomFlaskEffects"))
|
||||
|
@ -149,10 +140,10 @@ public class AlchemyFlask extends Item
|
|||
{
|
||||
if (this.isPotionThrowable(par1ItemStack))
|
||||
{
|
||||
return EnumAction.none;
|
||||
return EnumAction.NONE;
|
||||
}
|
||||
|
||||
return EnumAction.drink;
|
||||
return EnumAction.DRINK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -283,7 +274,7 @@ public class AlchemyFlask extends Item
|
|||
PotionEffect potioneffect = (PotionEffect) iterator.next();
|
||||
String s = StatCollector.translateToLocal(potioneffect.getEffectName()).trim();
|
||||
Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
|
||||
Map map = potion.func_111186_k();
|
||||
Map map = potion.getAttributeModifierMap();
|
||||
|
||||
if (map != null && map.size() > 0)
|
||||
{
|
||||
|
@ -293,7 +284,7 @@ public class AlchemyFlask extends Item
|
|||
{
|
||||
Entry entry = (Entry) iterator1.next();
|
||||
AttributeModifier attributemodifier = (AttributeModifier) entry.getValue();
|
||||
AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation());
|
||||
AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation());
|
||||
hashmultimap.put(((IAttribute) entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1);
|
||||
}
|
||||
}
|
||||
|
@ -345,11 +336,11 @@ public class AlchemyFlask extends Item
|
|||
|
||||
if (d0 > 0.0D)
|
||||
{
|
||||
par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
|
||||
par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
|
||||
} else if (d0 < 0.0D)
|
||||
{
|
||||
d1 *= -1.0D;
|
||||
par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
|
||||
par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
|
||||
public class AlchemyReagent extends Item
|
||||
{
|
||||
|
@ -24,61 +22,6 @@ public class AlchemyReagent extends Item
|
|||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (this == ModItems.incendium)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Incendium");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.magicales)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Magicales");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.sanctus)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Sanctus");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.aether)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aether");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.simpleCatalyst)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleCatalyst");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.crepitous)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crepitous");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.crystallos)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Crystallos");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.terrae)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Terrae");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.aquasalus)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Aquasalus");
|
||||
return;
|
||||
}
|
||||
if (this == ModItems.tennebrae)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:Tennebrae");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class AverageLengtheningCatalyst extends LengtheningCatalyst
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class AverageLengtheningCatalyst extends LengtheningCatalyst
|
|||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AverageLengtheningCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class AveragePowerCatalyst extends PowerCatalyst
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class AveragePowerCatalyst extends PowerCatalyst
|
|||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AveragePowerCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,11 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class CombinationalCatalyst extends Item implements ICombinationalCatalyst
|
||||
{
|
||||
|
@ -15,10 +12,4 @@ public class CombinationalCatalyst extends Item implements ICombinationalCatalys
|
|||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CombinationalCatalyst");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class EnhancedFillingAgent extends WeakFillingAgent
|
||||
{
|
||||
|
@ -41,11 +38,4 @@ public class EnhancedFillingAgent extends WeakFillingAgent
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedFillingAgent");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class GreaterLengtheningCatalyst extends LengtheningCatalyst
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class GreaterLengtheningCatalyst extends LengtheningCatalyst
|
|||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterLengtheningCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class GreaterPowerCatalyst extends PowerCatalyst
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class GreaterPowerCatalyst extends PowerCatalyst
|
|||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterPowerCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class MundaneLengtheningCatalyst extends LengtheningCatalyst
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class MundaneLengtheningCatalyst extends LengtheningCatalyst
|
|||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundaneLengtheningCatalyst");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class MundanePowerCatalyst extends PowerCatalyst
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class MundanePowerCatalyst extends PowerCatalyst
|
|||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundanePowerCatalyst");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.IBindingAgent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.IBindingAgent;
|
||||
|
||||
public class StandardBindingAgent extends Item implements IBindingAgent
|
||||
{
|
||||
|
@ -29,13 +28,6 @@ public class StandardBindingAgent extends Item implements IBindingAgent
|
|||
return (float) Math.pow(0.65, potions);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardBindingAgent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class StandardFillingAgent extends WeakFillingAgent
|
||||
{
|
||||
|
@ -28,11 +25,4 @@ public class StandardFillingAgent extends WeakFillingAgent
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardFillingAgent");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class WeakBindingAgent extends StandardBindingAgent
|
||||
{
|
||||
|
@ -16,11 +13,4 @@ public class WeakBindingAgent extends StandardBindingAgent
|
|||
{
|
||||
return (float) Math.pow(0.4, potions);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakBindingAgent");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.IFillingAgent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.IFillingAgent;
|
||||
|
||||
public class WeakFillingAgent extends Item implements IFillingAgent
|
||||
{
|
||||
|
@ -48,13 +47,6 @@ public class WeakFillingAgent extends Item implements IFillingAgent
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WeakFillingAgent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.routing;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class InputRoutingFocus extends RoutingFocus
|
||||
{
|
||||
|
@ -10,11 +7,4 @@ public class InputRoutingFocus extends RoutingFocus
|
|||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InputRoutingFocus");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,30 +2,23 @@ package WayofTime.alchemicalWizardry.common.items.routing;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
|
||||
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitDefault;
|
||||
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitGlobal;
|
||||
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitIgnMeta;
|
||||
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitMatchNBT;
|
||||
import WayofTime.alchemicalWizardry.common.routing.RoutingFocusLogicLimitModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingFocus
|
||||
{
|
||||
IIcon modItemIcon;
|
||||
IIcon ignMetaIcon;
|
||||
IIcon matchNBTIcon;
|
||||
IIcon globalIcon;
|
||||
|
||||
{
|
||||
public OutputRoutingFocus()
|
||||
{
|
||||
super();
|
||||
|
@ -46,36 +39,6 @@ public class OutputRoutingFocus extends RoutingFocus implements ILimitedRoutingF
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocus");
|
||||
this.modItemIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusModItems");
|
||||
this.ignMetaIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusIgnMeta");
|
||||
this.matchNBTIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusMatchNBT");
|
||||
this.globalIcon = iconRegister.registerIcon("AlchemicalWizardry:OutputRoutingFocusGlobal");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage)
|
||||
{
|
||||
switch(damage)
|
||||
{
|
||||
case 0:
|
||||
return this.itemIcon;
|
||||
case 1:
|
||||
return this.modItemIcon;
|
||||
case 2:
|
||||
return this.ignMetaIcon;
|
||||
case 3:
|
||||
return this.matchNBTIcon;
|
||||
case 4:
|
||||
return this.globalIcon;
|
||||
}
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
|
|
|
@ -8,10 +8,11 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
|
||||
|
@ -41,18 +42,18 @@ public class RoutingFocus extends Item
|
|||
//
|
||||
// public void cycleDirection(ItemStack itemStack)
|
||||
// {
|
||||
// ForgeDirection dir = this.getSetDirection(itemStack);
|
||||
// EnumFacing dir = this.getSetDirection(itemStack);
|
||||
// int direction = dir.ordinal();
|
||||
// direction++;
|
||||
// if(direction >= ForgeDirection.VALID_DIRECTIONS.length)
|
||||
// if(direction >= EnumFacing.VALID_DIRECTIONS.length)
|
||||
// {
|
||||
// direction = 0;
|
||||
// }
|
||||
//
|
||||
// this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction));
|
||||
// this.setSetDirection(itemStack, EnumFacing.getOrientation(direction));
|
||||
// }
|
||||
|
||||
public ForgeDirection getSetDirection(ItemStack itemStack)
|
||||
public EnumFacing getSetDirection(ItemStack itemStack)
|
||||
{
|
||||
if(!itemStack.hasTagCompound())
|
||||
{
|
||||
|
@ -61,10 +62,10 @@ public class RoutingFocus extends Item
|
|||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
return ForgeDirection.getOrientation(tag.getInteger("direction"));
|
||||
return EnumFacing.getFront(tag.getInteger("direction"));
|
||||
}
|
||||
|
||||
public void setSetDirection(ItemStack itemStack, ForgeDirection dir)
|
||||
public void setSetDirection(ItemStack itemStack, EnumFacing dir)
|
||||
{
|
||||
if(!itemStack.hasTagCompound())
|
||||
{
|
||||
|
@ -96,14 +97,14 @@ public class RoutingFocus extends Item
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if(tile instanceof IInventory)
|
||||
{
|
||||
if(player.isSneaking())
|
||||
|
@ -111,7 +112,7 @@ public class RoutingFocus extends Item
|
|||
if(this instanceof ILimitedRoutingFocus)
|
||||
{
|
||||
int pastAmount = ((ILimitedRoutingFocus)this).getRoutingFocusLimit(stack);
|
||||
int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, ForgeDirection.getOrientation(side));
|
||||
int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, side);
|
||||
if(amount != pastAmount)
|
||||
{
|
||||
((ILimitedRoutingFocus)this).setRoutingFocusLimit(stack, amount);
|
||||
|
@ -120,8 +121,8 @@ public class RoutingFocus extends Item
|
|||
}
|
||||
}
|
||||
|
||||
this.setCoordinates(stack, x, y, z);
|
||||
this.setSetDirection(stack, ForgeDirection.getOrientation(side));
|
||||
this.setCoordinates(stack, pos);
|
||||
this.setSetDirection(stack, side);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -129,7 +130,7 @@ public class RoutingFocus extends Item
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setCoordinates(ItemStack itemStack, int x, int y, int z)
|
||||
public void setCoordinates(ItemStack itemStack, BlockPos pos)
|
||||
{
|
||||
if(!itemStack.hasTagCompound())
|
||||
{
|
||||
|
@ -138,9 +139,9 @@ public class RoutingFocus extends Item
|
|||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
tag.setInteger("xCoord", x);
|
||||
tag.setInteger("yCoord", y);
|
||||
tag.setInteger("zCoord", z);
|
||||
tag.setInteger("xCoord", pos.getX());
|
||||
tag.setInteger("yCoord", pos.getY());
|
||||
tag.setInteger("zCoord", pos.getZ());
|
||||
}
|
||||
|
||||
public int xCoord(ItemStack itemStack)
|
||||
|
|
|
@ -2,19 +2,19 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import codechicken.lib.render.TextureUtils.IIconRegister;
|
||||
|
||||
public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
|
|
|
@ -1,30 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfWind extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfWind()
|
||||
{
|
||||
super();
|
||||
|
@ -40,7 +31,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (this.getActivated(par1ItemStack))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -52,47 +43,6 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:WindSigil_deactivated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (par1 == 1)
|
||||
{
|
||||
return this.activeIcon;
|
||||
} else
|
||||
{
|
||||
return this.passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -107,13 +57,13 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
|
||||
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (this.getActivated(par1ItemStack) && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionProjProt.id, 2, 1, true, false));
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -148,7 +98,7 @@ public class SigilOfWind extends EnergyItems implements ArmourUpgrade, ISigil
|
|||
{
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
|
||||
public class SigilToggleable extends EnergyItems
|
||||
{
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
}
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil.holding;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
|
||||
public class ContainerHolding extends Container
|
||||
{
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil.holding;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil.holding;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class HoldingPacketHandler
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil.holding;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
|
||||
public class HoldingPacketProcessor implements IMessage, IMessageHandler<HoldingPacketProcessor, IMessage>
|
||||
{
|
||||
|
|
|
@ -6,9 +6,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ScrollHelper
|
||||
|
|
|
@ -2,20 +2,18 @@ package WayofTime.alchemicalWizardry.common.items.sigil.holding;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilOfHolding extends EnergyItems
|
||||
{
|
||||
|
@ -31,51 +29,21 @@ public class SigilOfHolding extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfHolding");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
|
||||
{
|
||||
if (!(stack.getTagCompound() == null))
|
||||
{
|
||||
ItemStack[] inv = getInternalInventory(stack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
ItemStack item = getCurrentSigil(stack);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
return item.getIconIndex();
|
||||
}
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigilofholding.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
if (!(stack.getTagCompound() == null))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
ItemStack[] inv = getInternalInventory(stack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int currentSlot = getCurrentItem(par1ItemStack);
|
||||
int currentSlot = getCurrentItem(stack);
|
||||
ItemStack item = inv[currentSlot];
|
||||
|
||||
if (item != null)
|
||||
|
@ -94,12 +62,12 @@ public class SigilOfHolding extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (checkAndSetItemOwner(par1ItemStack, par2EntityPlayer))
|
||||
if (checkAndSetItemOwner(stack, player))
|
||||
{
|
||||
int currentSlot = getCurrentItem(par1ItemStack);
|
||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||
int currentSlot = getCurrentItem(stack);
|
||||
ItemStack[] inv = getInternalInventory(stack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
|
@ -113,9 +81,9 @@ public class SigilOfHolding extends EnergyItems
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean bool = itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
boolean bool = itemUsed.getItem().onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ);
|
||||
|
||||
saveInventory(par1ItemStack, inv);
|
||||
saveInventory(stack, inv);
|
||||
|
||||
return bool;
|
||||
}
|
||||
|
@ -124,36 +92,36 @@ public class SigilOfHolding extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
if (checkAndSetItemOwner(stack, par3EntityPlayer))
|
||||
{
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
InventoryHolding.setUUID(par1ItemStack);
|
||||
InventoryHolding.setUUID(stack);
|
||||
par3EntityPlayer.openGui(AlchemicalWizardry.instance, 3, par3EntityPlayer.worldObj, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ);
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
int currentSlot = getCurrentItem(par1ItemStack);
|
||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||
int currentSlot = getCurrentItem(stack);
|
||||
ItemStack[] inv = getInternalInventory(stack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
ItemStack itemUsed = inv[currentSlot];
|
||||
|
||||
if (itemUsed == null)
|
||||
{
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
itemUsed.getItem().onItemRightClick(itemUsed, par2World, par3EntityPlayer);
|
||||
saveInventory(par1ItemStack, inv);
|
||||
saveInventory(stack, inv);
|
||||
}
|
||||
return par1ItemStack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static int next(int mode)
|
||||
|
@ -184,7 +152,7 @@ public class SigilOfHolding extends EnergyItems
|
|||
{
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.getTagCompound() = new NBTTagCompound();
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
itemStack.getTagCompound().setInteger(NBT_CURRENT_SIGIL, invSize);
|
||||
}
|
||||
}
|
||||
|
@ -284,17 +252,17 @@ public class SigilOfHolding extends EnergyItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack stack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
if (!(stack.getTagCompound() == null))
|
||||
{
|
||||
this.tickInternalInventory(par1ItemStack, par2World, par3Entity, par4, par5);
|
||||
this.tickInternalInventory(stack, par2World, par3Entity, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
public void tickInternalInventory(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
public void tickInternalInventory(ItemStack stack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
ItemStack[] inv = getInternalInventory(par1ItemStack);
|
||||
ItemStack[] inv = getInternalInventory(stack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
|
|
|
@ -1,192 +1,192 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon helmetIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon plateIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon leggingsIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon bootsIcon;
|
||||
|
||||
public ItemSanguineArmour(int armorType)
|
||||
{
|
||||
super(AlchemicalWizardry.sanguineArmourArmourMaterial, 0, armorType);
|
||||
setMaxDamage(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguinePlate");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineLeggings");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineBoots");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.sanguineHelmet))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.sanguineRobe))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.sanguinePants))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.sanguineBoots))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||
{
|
||||
if (this == ModItems.sanguineHelmet)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
|
||||
}
|
||||
|
||||
if (this == ModItems.sanguineRobe || this == ModItems.sanguineBoots)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
|
||||
}
|
||||
|
||||
if (this == ModItems.sanguinePants)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/sanguineArmour_layer_2.png";
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
int discount = 0;
|
||||
|
||||
switch (this.armorType)
|
||||
{
|
||||
case 0:
|
||||
discount = 6;
|
||||
break;
|
||||
case 1:
|
||||
discount = 3;
|
||||
break;
|
||||
case 2:
|
||||
discount = 3;
|
||||
break;
|
||||
case 3:
|
||||
discount = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (this.armorType)
|
||||
{
|
||||
case 0:
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.desc1"));
|
||||
break;
|
||||
case 1:
|
||||
|
||||
case 2:
|
||||
|
||||
case 3:
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.desc2"));
|
||||
}
|
||||
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.visdisc") + " " + discount + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyForTenSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect)
|
||||
{
|
||||
switch (this.armorType)
|
||||
{
|
||||
case 0:
|
||||
return 7;
|
||||
case 1:
|
||||
return 3;
|
||||
case 2:
|
||||
return 2;
|
||||
case 3:
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemstack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//package WayofTime.alchemicalWizardry.common.items.thaumcraft;
|
||||
//
|
||||
//import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
//import WayofTime.alchemicalWizardry.ModItems;
|
||||
//import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
//import cpw.mods.fml.relauncher.Side;
|
||||
//import cpw.mods.fml.relauncher.SideOnly;
|
||||
//import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
//import net.minecraft.entity.Entity;
|
||||
//import net.minecraft.entity.EntityLivingBase;
|
||||
//import net.minecraft.entity.player.EntityPlayer;
|
||||
//import net.minecraft.item.ItemArmor;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//import net.minecraft.util.IIcon;
|
||||
//import net.minecraft.util.StatCollector;
|
||||
//import net.minecraft.world.World;
|
||||
//import thaumcraft.api.IGoggles;
|
||||
//import thaumcraft.api.IRepairable;
|
||||
//import thaumcraft.api.IRunicArmor;
|
||||
//import thaumcraft.api.IVisDiscountGear;
|
||||
//import thaumcraft.api.aspects.Aspect;
|
||||
//import thaumcraft.api.nodes.IRevealer;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable
|
||||
//{
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// private IIcon helmetIcon;
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// private IIcon plateIcon;
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// private IIcon leggingsIcon;
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// private IIcon bootsIcon;
|
||||
//
|
||||
// public ItemSanguineArmour(int armorType)
|
||||
// {
|
||||
// super(AlchemicalWizardry.sanguineArmourArmourMaterial, 0, armorType);
|
||||
// setMaxDamage(1000);
|
||||
// setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(IIconRegister iconRegister)
|
||||
// {
|
||||
// this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
// this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet");
|
||||
// this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguinePlate");
|
||||
// this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineLeggings");
|
||||
// this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineBoots");
|
||||
// }
|
||||
//
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIconFromDamage(int par1)
|
||||
// {
|
||||
// if (this.equals(ModItems.sanguineHelmet))
|
||||
// {
|
||||
// return this.helmetIcon;
|
||||
// }
|
||||
//
|
||||
// if (this.equals(ModItems.sanguineRobe))
|
||||
// {
|
||||
// return this.plateIcon;
|
||||
// }
|
||||
//
|
||||
// if (this.equals(ModItems.sanguinePants))
|
||||
// {
|
||||
// return this.leggingsIcon;
|
||||
// }
|
||||
//
|
||||
// if (this.equals(ModItems.sanguineBoots))
|
||||
// {
|
||||
// return this.bootsIcon;
|
||||
// }
|
||||
//
|
||||
// return this.itemIcon;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||
// {
|
||||
// if (this == ModItems.sanguineHelmet)
|
||||
// {
|
||||
// return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
|
||||
// }
|
||||
//
|
||||
// if (this == ModItems.sanguineRobe || this == ModItems.sanguineBoots)
|
||||
// {
|
||||
// return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
|
||||
// }
|
||||
//
|
||||
// if (this == ModItems.sanguinePants)
|
||||
// {
|
||||
// return "alchemicalwizardry:models/armor/sanguineArmour_layer_2.png";
|
||||
// } else
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
// {
|
||||
// int discount = 0;
|
||||
//
|
||||
// switch (this.armorType)
|
||||
// {
|
||||
// case 0:
|
||||
// discount = 6;
|
||||
// break;
|
||||
// case 1:
|
||||
// discount = 3;
|
||||
// break;
|
||||
// case 2:
|
||||
// discount = 3;
|
||||
// break;
|
||||
// case 3:
|
||||
// discount = 2;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// switch (this.armorType)
|
||||
// {
|
||||
// case 0:
|
||||
// par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.desc1"));
|
||||
// break;
|
||||
// case 1:
|
||||
//
|
||||
// case 2:
|
||||
//
|
||||
// case 3:
|
||||
// par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.desc2"));
|
||||
// }
|
||||
//
|
||||
// par3List.add(StatCollector.translateToLocal("tooltip.sanguinearmor.visdisc") + " " + discount + "%");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isUpgrade()
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getEnergyForTenSeconds()
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect)
|
||||
// {
|
||||
// switch (this.armorType)
|
||||
// {
|
||||
// case 0:
|
||||
// return 7;
|
||||
// case 1:
|
||||
// return 3;
|
||||
// case 2:
|
||||
// return 2;
|
||||
// case 3:
|
||||
// return 2;
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getRunicCharge(ItemStack itemstack)
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//}
|
Loading…
Add table
Add a link
Reference in a new issue