Attempt to fix repository
This commit is contained in:
parent
e242207d50
commit
1aac4686db
932 changed files with 39272 additions and 11544 deletions
|
@ -0,0 +1,45 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
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.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AWBaseItems extends Item
|
||||
{
|
||||
public AWBaseItems()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(64);
|
||||
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)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc2"));
|
||||
}
|
||||
}
|
|
@ -1,34 +1,51 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivationCrystal extends BindableItems
|
||||
public class ActivationCrystal extends EnergyItems
|
||||
{
|
||||
private final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"weak", "awakened", "creative"};
|
||||
private static final String[] ACTIVATION_CRYSTAL_NAMES = new String[]{"Weak", "Awakened", "Creative"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ActivationCrystal()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
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)
|
||||
{
|
||||
|
@ -85,7 +102,7 @@ public class ActivationCrystal extends BindableItems
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
@ -99,7 +116,15 @@ public class ActivationCrystal extends BindableItems
|
|||
{
|
||||
//This is what will do all the localisation things on the alchemy components so you dont have to set it :D
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ACTIVATION_CRYSTAL_NAMES.length - 1);
|
||||
return (getUnlocalizedName() + "_" + ACTIVATION_CRYSTAL_NAMES[meta]);
|
||||
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
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public AirScribeTool()
|
||||
{
|
||||
super(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,10 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
public class ApprenticeBloodOrb extends Orb
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ApprenticeBloodOrb extends EnergyBattery
|
||||
{
|
||||
public ApprenticeBloodOrb(int damage)
|
||||
{
|
||||
super(damage);
|
||||
orbLevel = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ApprenticeBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
public class ArchmageBloodOrb extends Orb
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ArchmageBloodOrb extends EnergyBattery
|
||||
{
|
||||
public ArchmageBloodOrb(int damage)
|
||||
{
|
||||
super(damage);
|
||||
orbLevel = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArchmageBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,98 +1,148 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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.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;
|
||||
|
||||
public class ArmourInhibitor extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class ArmourInhibitor extends EnergyItems
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 200;
|
||||
|
||||
public ArmourInhibitor()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(0);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
|
||||
list.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.armorinhibitor.desc2"));
|
||||
|
||||
if (!(stack.getTagCompound() == null))
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (stack.getTagCompound().getBoolean("isActive"))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
}
|
||||
|
||||
list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
int tickDelay = 200;
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ArmourInhibitor_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)
|
||||
{
|
||||
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"))
|
||||
{
|
||||
stack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % tickDelay);
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
} else
|
||||
{
|
||||
stack.setItemDamage(stack.getMaxDamage());
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
}
|
||||
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(entity instanceof EntityPlayer))
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (stack.getTagCompound() == null)
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (stack.getTagCompound().getBoolean("isActive"))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
// if (world.getWorldTime() % tickDelay == stack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
}
|
||||
|
||||
//TODO Do stuff
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
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.util.StatCollector;
|
||||
|
||||
public class BaseItems extends Item
|
||||
{
|
||||
public BaseItems()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.infusedstone.desc2"));
|
||||
}
|
||||
}
|
|
@ -1,89 +1,100 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellTable;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
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.nbt.NBTTagCompound;
|
||||
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;
|
||||
|
||||
public class BlankSpell extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class BlankSpell extends EnergyItems
|
||||
{
|
||||
public BlankSpell()
|
||||
{
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BlankSpell");
|
||||
}
|
||||
|
||||
if (!(stack.getTagCompound() == null))
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.blankspell.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
NBTTagCompound itemTag = stack.getTagCompound();
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (!stack.getTagCompound().getString("ownerName").equals(""))
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
|
||||
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));
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
World newWorld = DimensionManager.getWorld(getDimensionID(stack));
|
||||
World world = DimensionManager.getWorld(getDimensionID(par1ItemStack));
|
||||
|
||||
if (newWorld != null)
|
||||
if (world != null)
|
||||
{
|
||||
NBTTagCompound itemTag = stack.getTagCompound();
|
||||
TileEntity tileEntity = newWorld.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
TileEntity tileEntity = world.getTileEntity(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(par1ItemStack, par2World, par3EntityPlayer))
|
||||
{
|
||||
if(BindableItems.syphonBatteries(stack, player, homHeart.getCostForSpell()))
|
||||
if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.getCostForSpell()))
|
||||
{
|
||||
BindableItems.syphonBatteries(stack, player, homHeart.castSpell(stack, world, player));
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, homHeart.castSpell(par1ItemStack, par2World, par3EntityPlayer));
|
||||
}
|
||||
} else
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
world.playSoundAtEntity(player, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
return stack;
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public int getDimensionID(ItemStack itemStack)
|
||||
|
|
|
@ -1,17 +1,39 @@
|
|||
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.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
|
||||
public class BloodShard extends Item implements ArmourUpgrade
|
||||
{
|
||||
public BloodShard()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 64;
|
||||
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()
|
||||
|
@ -28,7 +50,9 @@ public class BloodShard extends Item implements ArmourUpgrade
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
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.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -12,11 +13,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.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
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 net.minecraftforge.common.ForgeHooks;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.ItemType;
|
||||
|
@ -24,18 +25,26 @@ 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()
|
||||
{
|
||||
super(AlchemicalWizardry.bloodBoundToolMaterial);
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
this.efficiencyOnProperMaterial = 12.0F;
|
||||
this.damageVsEntity = 5;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(5);
|
||||
}
|
||||
|
||||
|
@ -72,21 +81,54 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer par3EntityPlayer)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
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)
|
||||
{
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.disableBoundToolsRightClick)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -96,12 +138,15 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
BlockPos pos = par3EntityPlayer.getPosition();
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int posX = (int) (blockVec.xCoord);
|
||||
int posY = (int) (blockVec.yCoord);
|
||||
int posZ = (int) (blockVec.zCoord);
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
|
||||
|
||||
|
@ -113,22 +158,21 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
{
|
||||
for (int k = -5; k <= 5; k++)
|
||||
{
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
Block block = par2World.getBlock(posX + i, posY + j, posZ + k);
|
||||
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
|
||||
if (block != null)
|
||||
{
|
||||
float str = getStrVsBlock(par1ItemStack, block);
|
||||
float str = func_150893_a(par1ItemStack, block);
|
||||
|
||||
if (str > 1.1f || block instanceof BlockLeavesBase && world.canMineBlockBody(par3EntityPlayer, newPos))
|
||||
if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
|
||||
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
|
||||
{
|
||||
dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
|
||||
dropMultiset.add(new ItemType(block, meta));
|
||||
} else
|
||||
{
|
||||
List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
|
||||
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
|
@ -137,20 +181,20 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
}
|
||||
}
|
||||
|
||||
world.setBlockToAir(newPos);
|
||||
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World world, Entity par3Entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
|
@ -163,11 +207,11 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
if (world.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
|
@ -177,14 +221,28 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
if (!par1ItemStack.hasTagCompound())
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,17 +250,16 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
return super.getStrVsBlock(par1ItemStack, par2Block);
|
||||
return super.func_150893_a(par1ItemStack, par2Block);
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
|
||||
* the damage on the stack.
|
||||
|
@ -212,13 +269,13 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
return getActivated(par1ItemStack);
|
||||
}
|
||||
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World world, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Returns True is the item is renderer in full 3D when hold.
|
||||
*/
|
||||
|
@ -240,19 +297,19 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
* FORGE: Overridden to allow custom tool effectiveness
|
||||
*/
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, IBlockState state)
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
for (String type : getToolClasses(stack))
|
||||
if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||
{
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiencyOnProperMaterial;
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
return super.getDigSpeed(stack, state);
|
||||
|
||||
return func_150893_a(stack, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -12,11 +13,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.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
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 net.minecraftforge.common.ForgeHooks;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.ItemType;
|
||||
|
@ -25,19 +26,27 @@ 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;
|
||||
|
||||
public BoundPickaxe()
|
||||
{
|
||||
super(AlchemicalWizardry.bloodBoundToolMaterial);
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
this.efficiencyOnProperMaterial = 12.0F;
|
||||
this.damageVsEntity = 5;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setEnergyUsed(5);
|
||||
}
|
||||
|
||||
|
@ -52,14 +61,14 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc1"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.boundpickaxe.desc2"));
|
||||
|
||||
if (!(stack.getTagCompound() == null))
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (stack.getTagCompound().getBoolean("isActive"))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -67,44 +76,80 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.deactivated"));
|
||||
}
|
||||
|
||||
if (!stack.getTagCompound().getString("ownerName").equals(""))
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
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)
|
||||
{
|
||||
this.setActivated(stack, !getActivated(stack));
|
||||
stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
return stack;
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return stack;
|
||||
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;
|
||||
}
|
||||
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.disableBoundToolsRightClick)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if(!BindableItems.syphonBatteries(stack, par3EntityPlayer, 10000))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
BlockPos pos = par3EntityPlayer.getPosition();
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int posX = (int) (blockVec.xCoord);
|
||||
int posY = (int) (blockVec.yCoord);
|
||||
int posZ = (int) (blockVec.zCoord);
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
|
||||
|
||||
|
@ -112,44 +157,43 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
|
||||
for (int i = -5; i <= 5; i++)
|
||||
{
|
||||
for (int j = 0; j <= 10; j++)
|
||||
for (int j = -5; j <= 5; j++)
|
||||
{
|
||||
for (int k = -5; k <= 5; k++)
|
||||
{
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
Block block = par2World.getBlock(posX + i, posY + j, posZ + k);
|
||||
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
|
||||
if (block != null)
|
||||
if (block != null && block.getBlockHardness(par2World, posX + i, posY + j, posZ + k) != -1)
|
||||
{
|
||||
float str = getStrVsBlock(stack, block);
|
||||
float str = func_150893_a(par1ItemStack, block);
|
||||
|
||||
if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos))
|
||||
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
|
||||
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
|
||||
{
|
||||
dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
|
||||
dropMultiset.add(new ItemType(block, meta));
|
||||
} else
|
||||
{
|
||||
List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
|
||||
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
for (ItemStack stacky : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize);
|
||||
for (ItemStack stack : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
|
||||
}
|
||||
}
|
||||
|
||||
world.setBlockToAir(newPos);
|
||||
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
|
||||
dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
|
||||
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public static void dropMultisetStacks(Multiset<ItemType> dropMultiset, World world, double x, double y, double z)
|
||||
|
@ -173,7 +217,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity par3Entity, int par4, boolean par5)
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (!(par3Entity instanceof EntityPlayer))
|
||||
{
|
||||
|
@ -182,33 +226,47 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
|
||||
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
|
||||
|
||||
if (stack.getTagCompound() == null)
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (world.getWorldTime() % 200 == stack.getTagCompound().getInteger("worldTimeDelay") && stack.getTagCompound().getBoolean("isActive"))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(stack, par3EntityPlayer, 20))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20))
|
||||
{
|
||||
this.setActivated(stack, false);
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack.setItemDamage(0);
|
||||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
if (!par1ItemStack.hasTagCompound())
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,23 +274,34 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack stack, Block par2Block) //getStrVsBlock
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block) //getStrVsBlock
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
return super.getStrVsBlock(stack, par2Block);
|
||||
return super.func_150893_a(par1ItemStack, 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 stack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
|
||||
{
|
||||
return getActivated(stack);
|
||||
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;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -258,19 +327,19 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
* FORGE: Overridden to allow custom tool effectiveness
|
||||
*/
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, IBlockState state)
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
for (String type : getToolClasses(stack))
|
||||
if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||
{
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiencyOnProperMaterial;
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
return super.getDigSpeed(stack, state);
|
||||
|
||||
return func_150893_a(stack, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,41 +1,54 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
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 net.minecraftforge.common.ForgeHooks;
|
||||
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()
|
||||
{
|
||||
super(AlchemicalWizardry.bloodBoundToolMaterial);
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
this.efficiencyOnProperMaterial = 12.0F;
|
||||
this.damageVsEntity = 5;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(5);
|
||||
}
|
||||
|
||||
|
@ -72,36 +85,72 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer par3EntityPlayer)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(stack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
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)
|
||||
{
|
||||
this.setActivated(stack, !getActivated(stack));
|
||||
stack.getTagCompound().setInteger("worldTimeDelay", (int) (world.getWorldTime() - 1) % 200);
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
return stack;
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (!getActivated(stack) || SpellHelper.isFakePlayer(world, par3EntityPlayer))
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
return stack;
|
||||
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;
|
||||
}
|
||||
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (AlchemicalWizardry.disableBoundToolsRightClick)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionInhibit))
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if(!BindableItems.syphonBatteries(stack, par3EntityPlayer, 10000))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
|
||||
{
|
||||
return stack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
BlockPos pos = par3EntityPlayer.getPosition();
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int posX = (int) (blockVec.xCoord);
|
||||
int posY = (int) (blockVec.yCoord);
|
||||
int posZ = (int) (blockVec.zCoord);
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
|
||||
|
||||
|
@ -113,40 +162,39 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
{
|
||||
for (int k = -5; k <= 5; k++)
|
||||
{
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
Block block = par2World.getBlock(posX + i, posY + j, posZ + k);
|
||||
int meta = par2World.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
|
||||
if (block != null)
|
||||
{
|
||||
float str = getStrVsBlock(stack, block);
|
||||
float str = func_150893_a(par1ItemStack, block);
|
||||
|
||||
if (str > 1.1f && world.canMineBlockBody(par3EntityPlayer, newPos))
|
||||
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
|
||||
{
|
||||
if (silkTouch && block.canSilkHarvest(world, newPos, state, par3EntityPlayer))
|
||||
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
|
||||
{
|
||||
dropMultiset.add(new ItemType(block, block.getMetaFromState(state)));
|
||||
dropMultiset.add(new ItemType(block, meta));
|
||||
} else
|
||||
{
|
||||
List<ItemStack> itemDropList = block.getDrops(world, newPos, state, fortuneLvl);
|
||||
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
|
||||
|
||||
if (itemDropList != null)
|
||||
{
|
||||
for (ItemStack stacky : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stacky), stacky.stackSize);
|
||||
for (ItemStack stack : itemDropList)
|
||||
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
|
||||
}
|
||||
}
|
||||
|
||||
world.setBlockToAir(newPos);
|
||||
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, world, pos.getX(), pos.getY() + par3EntityPlayer.getEyeHeight(), pos.getZ());
|
||||
|
||||
return stack;
|
||||
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -167,7 +215,7 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 20))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
|
@ -177,14 +225,28 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
if (!par1ItemStack.hasTagCompound())
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,14 +254,14 @@ public class BoundShovel extends ItemSpade implements IBindable
|
|||
* sword
|
||||
*/
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (!getActivated(par1ItemStack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
return super.getStrVsBlock(par1ItemStack, par2Block);
|
||||
return super.func_150893_a(par1ItemStack, par2Block);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -234,23 +296,31 @@ 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, IBlockState state)
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta)
|
||||
{
|
||||
if (!getActivated(stack))
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
for (String type : getToolClasses(stack))
|
||||
if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||
{
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiencyOnProperMaterial;
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
return super.getDigSpeed(stack, state);
|
||||
|
||||
return func_150893_a(stack, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,27 +1,39 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
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;
|
||||
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.EnumParticleTypes;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
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 CreativeOrb extends Item implements IBindable
|
||||
import java.util.List;
|
||||
|
||||
public class CheatyItem extends Item implements IBindable
|
||||
{
|
||||
public CreativeOrb()
|
||||
public CheatyItem()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnergyBattery");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,7 +53,7 @@ public class CreativeOrb extends Item implements IBindable
|
|||
{
|
||||
World world = par3EntityPlayer.worldObj;
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer)
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -52,7 +64,7 @@ public class CreativeOrb extends Item implements IBindable
|
|||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.worldObj.isRemote)
|
||||
|
@ -77,6 +89,54 @@ public class CreativeOrb extends Item implements IBindable
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
/*
|
||||
* @return the damage that was not deducted
|
||||
*/
|
||||
public int damageItem(ItemStack par1ItemStack, int par2int)
|
||||
{
|
||||
if (par2int == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int before = this.getDamage(par1ItemStack);
|
||||
this.setDamage(par1ItemStack, this.getDamage(par1ItemStack) + par2int);
|
||||
return par2int - (this.getDamage(par1ItemStack) - before);
|
||||
}
|
||||
|
||||
protected void damagePlayer(World world, EntityPlayer player, int damage)
|
||||
{
|
||||
if (world != null)
|
||||
{
|
||||
double posX = player.posX;
|
||||
double posY = player.posY;
|
||||
double posZ = player.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
float f = 1.0F;
|
||||
float f1 = f * 0.6F + 0.4F;
|
||||
float f2 = f * f * 0.7F - 0.5F;
|
||||
float f3 = f * f * 0.6F - 0.7F;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
for (int i = 0; i < damage; i++)
|
||||
{
|
||||
player.setHealth((player.getHealth() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getHealth() <= 0)
|
||||
{
|
||||
player.inventory.dropAllItems();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
|
@ -113,6 +173,13 @@ public class CreativeOrb extends Item implements IBindable
|
|||
worldSave.setItemData(owner, data);
|
||||
}
|
||||
|
||||
return data.currentEssence;
|
||||
int currentEssence = data.currentEssence;
|
||||
return (currentEssence);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,18 +1,17 @@
|
|||
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.api.event.SacrificeKnifeUsedEvent;
|
||||
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
|
@ -21,7 +20,9 @@ public class CreativeDagger extends Item
|
|||
public CreativeDagger()
|
||||
{
|
||||
super();
|
||||
setTextureName("AlchemicalWizardry:SacrificialDagger");
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
|
@ -68,7 +69,7 @@ public class CreativeDagger extends Item
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle("reddust", 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))
|
||||
|
@ -82,8 +83,10 @@ public class CreativeDagger extends Item
|
|||
|
||||
public void findAndFillAltar(World world, EntityPlayer player, int amount)
|
||||
{
|
||||
BlockPos pos = player.getPosition();
|
||||
IBloodAltar altarEntity = getAltar(world, pos);
|
||||
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);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -94,7 +97,7 @@ public class CreativeDagger extends Item
|
|||
altarEntity.startCycle();
|
||||
}
|
||||
|
||||
public IBloodAltar getAltar(World world, BlockPos pos)
|
||||
public IBloodAltar getAltar(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
|
||||
|
@ -104,8 +107,7 @@ public class CreativeDagger extends Item
|
|||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
tileEntity = world.getTileEntity(newPos);
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
|
||||
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,28 +17,39 @@ 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.api.tile.IBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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;
|
||||
|
||||
public class DaggerOfSacrifice extends BindableItems
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class DaggerOfSacrifice extends EnergyItems
|
||||
{
|
||||
public DaggerOfSacrifice()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(100);
|
||||
setFull3D();
|
||||
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)
|
||||
{
|
||||
|
@ -84,7 +95,7 @@ public class DaggerOfSacrifice extends BindableItems
|
|||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 1, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ);
|
||||
}
|
||||
|
||||
par2EntityLivingBase.setHealth(-1);
|
||||
|
@ -107,7 +118,7 @@ public class DaggerOfSacrifice extends BindableItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (par2Block == Blocks.web)
|
||||
{
|
||||
|
@ -126,17 +137,19 @@ public class DaggerOfSacrifice extends BindableItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public Multimap getAttributeModifiers(ItemStack itemStack)
|
||||
public Multimap getItemAttributeModifiers()
|
||||
{
|
||||
Multimap multimap = super.getAttributeModifiers(itemStack);
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(4186465, 46565), "Tool modifier", 1.0d, 0));
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", 1.0d, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
public boolean findAndNotifyAltarOfDemon(World world, EntityLivingBase sacrifice)
|
||||
{
|
||||
BlockPos pos = sacrifice.getPosition();
|
||||
IBloodAltar altarEntity = this.getAltar(world, pos);
|
||||
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);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -150,8 +163,10 @@ public class DaggerOfSacrifice extends BindableItems
|
|||
|
||||
public boolean findAndFillAltar(World world, EntityLivingBase sacrifice, int amount)
|
||||
{
|
||||
BlockPos pos = sacrifice.getPosition();
|
||||
IBloodAltar altarEntity = this.getAltar(world, pos);
|
||||
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);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -163,7 +178,7 @@ public class DaggerOfSacrifice extends BindableItems
|
|||
return true;
|
||||
}
|
||||
|
||||
public IBloodAltar getAltar(World world, BlockPos pos)
|
||||
public IBloodAltar getAltar(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
|
||||
|
@ -173,8 +188,7 @@ public class DaggerOfSacrifice extends BindableItems
|
|||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
tileEntity = world.getTileEntity(newPos);
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
|
||||
if ((tileEntity instanceof IBloodAltar))
|
||||
{
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public DawnScribeTool()
|
||||
{
|
||||
super(6);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DawnScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,167 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
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.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.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
|
||||
public class DemonCrystal extends Item
|
||||
{
|
||||
public DemonCrystal()
|
||||
{
|
||||
super();
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (!playerIn.func_175151_a(pos.offset(side), side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate = world.getBlockState(pos);
|
||||
|
||||
pos = pos.offset(side);
|
||||
double d0 = 0.0D;
|
||||
|
||||
if (side == EnumFacing.UP && iblockstate instanceof BlockFence)
|
||||
{
|
||||
d0 = 0.5D;
|
||||
}
|
||||
|
||||
String demonName = DemonCrystal.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 && stack.hasDisplayName())
|
||||
{
|
||||
entity.setCustomNameTag(stack.getDisplayName());
|
||||
}
|
||||
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns the creature specified by the egg's type in the location specified by the last three parameters.
|
||||
* Parameters: world, entityID, x, y, z.
|
||||
*/
|
||||
public static Entity spawnCreature(World par0World, String par1, double par2, double par4, double par6, ItemStack itemStack)
|
||||
{
|
||||
Entity entity = null;
|
||||
|
||||
for (int j = 0; j < 1; ++j)
|
||||
{
|
||||
entity = SummoningRegistry.getEntityWithID(par0World, par1);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
EntityLiving entityliving = (EntityLiving) entity;
|
||||
entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
|
||||
entityliving.rotationYawHead = entityliving.rotationYaw;
|
||||
entityliving.renderYawOffset = entityliving.rotationYaw;
|
||||
if (entityliving instanceof EntityDemon)
|
||||
{
|
||||
((EntityDemon) entityliving).func_152115_b(DemonCrystal.getOwnerName(itemStack));
|
||||
|
||||
if (!DemonCrystal.getOwnerName(itemStack).equals(""))
|
||||
{
|
||||
((EntityDemon) entityliving).setTamed(true);
|
||||
}
|
||||
}
|
||||
|
||||
par0World.spawnEntityInWorld(entity);
|
||||
entityliving.playLivingSound();
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public static void setOwnerName(ItemStack par1ItemStack, String ownerName)
|
||||
{
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
par1ItemStack.getTagCompound().setString("ownerName", ownerName);
|
||||
}
|
||||
|
||||
public static String getOwnerName(ItemStack par1ItemStack)
|
||||
{
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return par1ItemStack.getTagCompound().getString("ownerName");
|
||||
}
|
||||
|
||||
public static void setDemonString(ItemStack itemStack, String demonName)
|
||||
{
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemStack.getTagCompound().setString("demonName", demonName);
|
||||
}
|
||||
|
||||
public static String getDemonString(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemStack.getTagCompound().getString("demonName");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.demonplacer.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.demonsowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,247 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
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.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.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityDemon;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class DemonPlacer extends Item
|
||||
{
|
||||
public DemonPlacer()
|
||||
{
|
||||
super();
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
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
|
||||
*/
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
Block i1 = par3World.getBlock(par4, par5, par6);
|
||||
par4 += Facing.offsetsXForSide[par7];
|
||||
par5 += Facing.offsetsYForSide[par7];
|
||||
par6 += Facing.offsetsZForSide[par7];
|
||||
double d0 = 0.0D;
|
||||
|
||||
if (par7 == 1 && i1 != null && i1.getRenderType() == 11)
|
||||
{
|
||||
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);
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
|
||||
{
|
||||
((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
--par1ItemStack.stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public static Entity spawnCreature(World par0World, String par1, double par2, double par4, double par6, ItemStack itemStack)
|
||||
{
|
||||
Entity entity = null;
|
||||
|
||||
for (int j = 0; j < 1; ++j)
|
||||
{
|
||||
entity = SummoningRegistry.getEntityWithID(par0World, par1);
|
||||
|
||||
if (entity != null && entity instanceof EntityLivingBase)
|
||||
{
|
||||
EntityLiving entityliving = (EntityLiving) entity;
|
||||
entity.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F);
|
||||
entityliving.rotationYawHead = entityliving.rotationYaw;
|
||||
entityliving.renderYawOffset = entityliving.rotationYaw;
|
||||
if (entityliving instanceof EntityDemon)
|
||||
{
|
||||
Entity owner = SpellHelper.getPlayerForUsername(DemonPlacer.getOwnerName(itemStack));
|
||||
if(owner != null)
|
||||
{
|
||||
((EntityDemon) entityliving).func_152115_b(owner.getPersistentID().toString());
|
||||
|
||||
if (!DemonPlacer.getOwnerName(itemStack).equals(""))
|
||||
{
|
||||
((EntityDemon) entityliving).setTamed(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
par0World.spawnEntityInWorld(entity);
|
||||
entityliving.playLivingSound();
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public static void setOwnerName(ItemStack par1ItemStack, String ownerName)
|
||||
{
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
par1ItemStack.getTagCompound().setString("ownerName", ownerName);
|
||||
}
|
||||
|
||||
public static String getOwnerName(ItemStack par1ItemStack)
|
||||
{
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return par1ItemStack.getTagCompound().getString("ownerName");
|
||||
}
|
||||
|
||||
public static void setDemonString(ItemStack itemStack, String demonName)
|
||||
{
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemStack.getTagCompound().setString("demonName", demonName);
|
||||
}
|
||||
|
||||
public static String getDemonString(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemStack.getTagCompound().getString("demonName");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.demonplacer.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (!par1ItemStack.getTagCompound().getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.demonsowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonPlacer");
|
||||
}
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DemonicTelepositionFocus extends TelepositionFocus
|
||||
{
|
||||
public DemonicTelepositionFocus()
|
||||
|
@ -14,6 +17,13 @@ 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,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public DuskScribeTool()
|
||||
{
|
||||
super(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public EarthScribeTool()
|
||||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,35 +1,46 @@
|
|||
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;
|
||||
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;
|
||||
|
||||
public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
||||
import java.util.List;
|
||||
|
||||
public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
||||
{
|
||||
private int maxEssence;
|
||||
protected int orbLevel;
|
||||
|
||||
public Orb(int damage)
|
||||
public EnergyBattery(int damage)
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
maxEssence = damage;
|
||||
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)
|
||||
{
|
||||
|
@ -40,10 +51,9 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -56,7 +66,7 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
|||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
}
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
|
@ -81,7 +91,7 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
|||
}
|
||||
|
||||
SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence());
|
||||
BindableItems.hurtPlayer(par3EntityPlayer, 200);
|
||||
EnergyItems.hurtPlayer(par3EntityPlayer, 200);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
@ -115,7 +125,7 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +154,9 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
|
@ -198,4 +210,10 @@ public class Orb extends Item implements ArmourUpgrade, IBindable, IBloodOrb
|
|||
|
||||
return data.currentEssence;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,36 +1,74 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
|
||||
|
||||
public class EnergyBazooka extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class EnergyBazooka extends EnergyItems
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int damage;
|
||||
|
||||
public EnergyBazooka()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setFull3D();
|
||||
setMaxDamage(250);
|
||||
this.setEnergyUsed(20000);
|
||||
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)
|
||||
{
|
||||
final int maxDelay = 150;
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
|
@ -98,7 +136,7 @@ public class EnergyBazooka extends BindableItems
|
|||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
|
@ -130,14 +168,28 @@ public class EnergyBazooka extends BindableItems
|
|||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
public void setDelay(ItemStack par1ItemStack, int newDelay)
|
||||
|
|
|
@ -1,35 +1,74 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
|
||||
public class EnergyBlaster extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class EnergyBlast extends EnergyItems
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int damage;
|
||||
|
||||
public EnergyBlaster()
|
||||
public EnergyBlast()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setUnlocalizedName("energyBlaster");
|
||||
setFull3D();
|
||||
setMaxDamage(250);
|
||||
this.setEnergyUsed(150);
|
||||
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)
|
||||
{
|
||||
final int maxDelay = 15;
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
|
@ -89,7 +128,7 @@ public class EnergyBlaster extends BindableItems
|
|||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
|
@ -123,14 +162,28 @@ public class EnergyBlaster extends BindableItems
|
|||
}
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
public void setDelay(ItemStack par1ItemStack, int newDelay)
|
|
@ -1,5 +1,6 @@
|
|||
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;
|
||||
|
@ -10,17 +11,16 @@ 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.world.World;
|
||||
|
||||
public class BindableItems extends Item implements IBindable
|
||||
public class EnergyItems extends Item implements IBindable
|
||||
{
|
||||
private int energyUsed;
|
||||
|
||||
public BindableItems()
|
||||
public EnergyItems()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
protected void setEnergyUsed(int par1int)
|
||||
|
@ -47,7 +47,7 @@ public class BindableItems extends Item implements IBindable
|
|||
float f3 = f * f * 0.6F - 0.7F;
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < damage; i++)
|
||||
|
@ -76,7 +76,7 @@ public class BindableItems extends Item implements IBindable
|
|||
double posY = player.posY;
|
||||
double posZ = player.posZ;
|
||||
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,6 @@ public class BindableItems extends Item implements IBindable
|
|||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean canSyphonInContainer(ItemStack ist, int damageToBeDone)
|
||||
{
|
||||
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))
|
||||
|
@ -174,7 +173,6 @@ public class BindableItems extends Item implements IBindable
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static boolean syphonAndDamageWhileInContainer(ItemStack ist, EntityPlayer player, int damageToBeDone)
|
||||
{
|
||||
if (!syphonWhileInContainer(ist, damageToBeDone))
|
||||
|
@ -224,6 +222,35 @@ public class BindableItems extends Item implements IBindable
|
|||
return item.getTagCompound().getString("ownerName");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void drainPlayerNetwork(EntityPlayer player, int damageToBeDone)
|
||||
{
|
||||
String ownerName = SpellHelper.getUsername(player);
|
||||
|
||||
if (MinecraftServer.getServer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
World world = MinecraftServer.getServer().worldServers[0];
|
||||
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
data = new LifeEssenceNetwork(ownerName);
|
||||
world.setItemData(ownerName, data);
|
||||
}
|
||||
|
||||
if (data.currentEssence >= damageToBeDone)
|
||||
{
|
||||
data.currentEssence -= damageToBeDone;
|
||||
data.markDirty();
|
||||
} else
|
||||
{
|
||||
hurtPlayer(player, damageToBeDone);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getCurrentEssence(String ownerName)
|
||||
{
|
|
@ -4,6 +4,7 @@ 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;
|
||||
|
@ -13,20 +14,28 @@ 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 BoundBlade extends ItemSword
|
||||
public class EnergySword extends ItemSword
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int energyUsed;
|
||||
|
||||
public BoundBlade()
|
||||
public EnergySword()
|
||||
{
|
||||
super(AlchemicalWizardry.bloodBoundToolMaterial);
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(50);
|
||||
setFull3D();
|
||||
setMaxDamage(100);
|
||||
|
@ -41,6 +50,34 @@ public class BoundBlade 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)
|
||||
{
|
||||
|
@ -71,7 +108,7 @@ public class BoundBlade extends ItemSword
|
|||
{
|
||||
if (par3EntityLivingBase instanceof EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase) || !BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed()))
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, (EntityPlayer) par3EntityLivingBase) || !EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3EntityLivingBase, this.getEnergyUsed()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -84,7 +121,8 @@ public class BoundBlade extends ItemSword
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
|
||||
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 100);
|
||||
|
@ -124,7 +162,7 @@ public class BoundBlade extends ItemSword
|
|||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 50))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
}
|
||||
|
@ -134,14 +172,28 @@ public class BoundBlade extends ItemSword
|
|||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
|
||||
public void setActivated(ItemStack stack, boolean newActivated)
|
||||
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
|
||||
{
|
||||
stack.setItemDamage(newActivated ? 1 : 0);
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemTag.setBoolean("isActive", newActivated);
|
||||
}
|
||||
|
||||
public boolean getActivated(ItemStack stack)
|
||||
public boolean getActivated(ItemStack par1ItemStack)
|
||||
{
|
||||
return stack.getItemDamage() == 1;
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
|
||||
if (itemTag == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
return itemTag.getBoolean("isActive");
|
||||
}
|
||||
|
||||
public float func_82803_g()
|
||||
|
@ -173,7 +225,7 @@ public class BoundBlade extends ItemSword
|
|||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
|
||||
public float func_150893_a(ItemStack par1ItemStack, Block par2Block)
|
||||
{
|
||||
if (par2Block == Blocks.web)
|
||||
{
|
|
@ -1,12 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EnhancedTelepositionFocus extends TelepositionFocus
|
||||
{
|
||||
public EnhancedTelepositionFocus()
|
||||
|
@ -14,6 +17,13 @@ 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,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public FireScribeTool()
|
||||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:FireScribeTool");
|
||||
}
|
||||
}
|
|
@ -1,32 +1,50 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemAlchemyBase extends Item
|
||||
{
|
||||
private final String[] ITEM_NAMES = new String[]{"offensa", "praesidium", "orbis_terrae", "strengthened_catalyst", "concentrated_catalyst", "fractured_bone", "virtus", "reductus", "potentia"};
|
||||
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();
|
||||
this.maxStackSize = 64;
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
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)
|
||||
{
|
||||
|
@ -64,7 +82,15 @@ public class ItemAlchemyBase extends Item
|
|||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ITEM_NAMES.length - 1);
|
||||
return (getUnlocalizedName() + "." + ITEM_NAMES[meta]);
|
||||
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
|
||||
|
|
|
@ -3,14 +3,11 @@ 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;
|
||||
|
@ -27,7 +24,6 @@ public class ItemBlockCrystalBelljar extends ItemBlock
|
|||
this.setMaxStackSize(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
{
|
||||
return par1;
|
||||
|
@ -81,14 +77,17 @@ public class ItemBlockCrystalBelljar extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
|
||||
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)
|
||||
{
|
||||
if (!world.setBlockState(pos, newState, 3)) return false;
|
||||
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock() == this.block)
|
||||
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3))
|
||||
{
|
||||
this.block.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z) == field_150939_a)
|
||||
{
|
||||
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -2,23 +2,30 @@ 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.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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;
|
||||
|
@ -27,6 +34,14 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
public ItemBloodLetterPack()
|
||||
{
|
||||
super(ArmorMaterial.CHAIN, 0, 1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodPack");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,6 +54,12 @@ 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)
|
||||
|
@ -63,9 +84,11 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tile instanceof TEAltar))
|
||||
{
|
||||
|
@ -83,7 +106,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
amount -= filledAmount;
|
||||
this.setStoredLP(itemStack, amount);
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +161,10 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
|
|
|
@ -10,9 +10,9 @@ public class ItemBloodRuneBlock extends ItemBlock
|
|||
{
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
String name;
|
||||
|
@ -20,12 +20,16 @@ public class ItemBloodRuneBlock extends ItemBlock
|
|||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "blank";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "fill";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "empty";
|
||||
|
@ -50,7 +54,6 @@ public class ItemBloodRuneBlock extends ItemBlock
|
|||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
|
|
|
@ -1,23 +1,34 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
|
||||
public class ItemComplexSpellCrystal extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class ItemComplexSpellCrystal extends EnergyItems
|
||||
{
|
||||
public ItemComplexSpellCrystal()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
this.setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ComplexCrystal");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +53,7 @@ public class ItemComplexSpellCrystal extends BindableItems
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -54,7 +65,7 @@ public class ItemComplexSpellCrystal extends BindableItems
|
|||
if (world != null)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
|
||||
TileEntity tileEntity = world.getTileEntity(new BlockPos(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord")));
|
||||
TileEntity tileEntity = world.getTileEntity(itemTag.getInteger("xCoord"), itemTag.getInteger("yCoord"), itemTag.getInteger("zCoord"));
|
||||
|
||||
if (tileEntity instanceof TESpellParadigmBlock)
|
||||
{
|
||||
|
|
|
@ -1,26 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemComponents extends Item
|
||||
{
|
||||
private final String[] ITEM_NAMES = new String[]{"quartz_rod", "empty_core", "magicales_cable", "wood_brace", "stone_brace", "projectile_core", "self_core", "melee_core", "paradigm_back_plate", "output_cable", "flame_core", "icy_core", "gust_core", "earthen_core", "input_cable", "cracked_runic_plate", "runic_plate", "scribed_runic_plate", "default_core", "offensive_core", "defensive_core", "environmental_core", "power_core", "cost_core", "potency_core", "obsidian_brace", "tool_core", "ethereal_slate", "life_shard", "soul_shard", "soul_runic_plate", "life_brace", "ender_shard"};
|
||||
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();
|
||||
this.maxStackSize = 64;
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
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)
|
||||
{
|
||||
|
@ -32,7 +52,15 @@ public class ItemComponents extends Item
|
|||
{
|
||||
//This is what will do all the localisation things on the alchemy components so you dont have to set it :D
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ITEM_NAMES.length - 1);
|
||||
return (getUnlocalizedName() + "." + ITEM_NAMES[meta]);
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ public class ItemCrystalBlock extends ItemBlock
|
|||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
String name;
|
||||
|
@ -20,12 +20,16 @@ public class ItemCrystalBlock extends ItemBlock
|
|||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "fullCrystal";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "crystalBrick";
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
|
@ -34,7 +38,6 @@ public class ItemCrystalBlock extends ItemBlock
|
|||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
@ -11,22 +16,27 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class KeyOfBinding extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDiabloKey extends EnergyItems
|
||||
{
|
||||
public KeyOfBinding()
|
||||
public ItemDiabloKey()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setEnergyUsed(1000);
|
||||
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)
|
||||
{
|
||||
|
@ -40,7 +50,7 @@ public class KeyOfBinding extends BindableItems
|
|||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
World world = par3EntityPlayer.worldObj;
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP)
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer instanceof FakePlayer || par3EntityPlayer instanceof EntityPlayerMP)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -51,7 +61,7 @@ public class KeyOfBinding extends BindableItems
|
|||
double posY = par3EntityPlayer.posY;
|
||||
double posZ = par3EntityPlayer.posZ;
|
||||
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.getDimensionId(), 4, posX, posY, posZ);
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 4, posX, posY, posZ);
|
||||
}
|
||||
|
||||
if (!par3EntityPlayer.worldObj.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class)))
|
||||
|
@ -83,14 +93,14 @@ public class KeyOfBinding extends BindableItems
|
|||
|
||||
Item item = itemStack.getItem();
|
||||
|
||||
if (item instanceof KeyOfBinding)
|
||||
if (item instanceof ItemDiabloKey)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item instanceof IBindable)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(itemStack, ownerName);
|
||||
EnergyItems.checkAndSetItemOwner(itemStack, ownerName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +113,7 @@ public class KeyOfBinding extends BindableItems
|
|||
{
|
||||
list.add(new ItemStack(ModItems.itemKeyOfDiablo));
|
||||
ItemStack boundKey = new ItemStack(ModItems.itemKeyOfDiablo);
|
||||
BindableItems.checkAndSetItemOwner(boundKey, "Server-wide Soul Network");
|
||||
EnergyItems.checkAndSetItemOwner(boundKey, "Server-wide Soul Network");
|
||||
list.add(boundKey);
|
||||
}
|
||||
}
|
|
@ -19,16 +19,16 @@ public class ItemEnchantmentGlyphBlock extends ItemBlock
|
|||
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
name = "enchantability";
|
||||
break;
|
||||
case 0:
|
||||
name = "enchantability";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
name = "enchantmentLevel";
|
||||
break;
|
||||
case 1:
|
||||
name = "enchantmentLevel";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
default:
|
||||
name = "broken";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
|
|
|
@ -2,32 +2,60 @@ 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 final String[] ITEM_NAMES = new String[]{"wood_ash", "byrrus", "livens", "viridis", "purpura"};
|
||||
private static final String[] ITEM_NAMES = new String[]{"Woodash", "Byrrus", "Livens", "Viridis", "Purpura"};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ItemIncense()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 64;
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
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)
|
||||
{
|
||||
|
@ -38,7 +66,15 @@ public class ItemIncense extends Item implements IIncense
|
|||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, ITEM_NAMES.length - 1);
|
||||
return (getUnlocalizedName() + "." + ITEM_NAMES[meta]);
|
||||
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
|
||||
|
|
|
@ -1,19 +1,30 @@
|
|||
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
|
||||
{
|
||||
public ItemMailOrderCatalogue()
|
||||
{
|
||||
super();
|
||||
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,26 +1,37 @@
|
|||
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.block.RitualStone;
|
||||
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.item.EntityItem;
|
||||
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;
|
||||
|
||||
public class ItemRitualDismantler extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class ItemRitualDismantler extends EnergyItems
|
||||
{
|
||||
public ItemRitualDismantler()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:ritual_dismantler");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,60 +43,48 @@ public class ItemRitualDismantler extends BindableItems
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
return BindableItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, pos);
|
||||
return EnergyItems.checkAndSetItemOwner(stack, player) && breakRitualStoneAtMasterStone(stack, player, world, x, y, z);
|
||||
}
|
||||
|
||||
public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos)
|
||||
public boolean breakRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
ItemStack[] playerInventory = player.inventory.mainInventory;
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
TEMasterStone masterStone = (TEMasterStone) tileEntity;
|
||||
int direction = masterStone.getDirection();
|
||||
int freeSpace = -1;
|
||||
|
||||
List<RitualComponent> ritualList = Rituals.getRitualList(masterStone.getCurrentRitual());
|
||||
String ritualName = Rituals.checkValidRitual(world, x, y, z);
|
||||
List<RitualComponent> ritualList = Rituals.getRitualList(ritualName);
|
||||
if (ritualList == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < playerInventory.length; i++)
|
||||
{
|
||||
if (playerInventory[i] == null)
|
||||
{
|
||||
freeSpace = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (RitualComponent rc : ritualList)
|
||||
{
|
||||
BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction));
|
||||
if (!world.isAirBlock(newPos) && world.getBlockState(newPos).getBlock() instanceof BlockRitualStone)
|
||||
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 RitualStone)
|
||||
{
|
||||
if (freeSpace >= 0)
|
||||
if (EnergyItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (BindableItems.syphonBatteries(stack, player, getEnergyUsed()) || player.capabilities.isCreativeMode)
|
||||
world.setBlockToAir(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(ModBlocks.ritualStone));
|
||||
if (world.isRemote)
|
||||
{
|
||||
world.setBlockToAir(newPos);
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.ritualStone));
|
||||
if (world.isRemote)
|
||||
{
|
||||
world.playAuxSFX(2005, pos.offsetUp(), 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
world.playAuxSFX(2005, x, y + 1, z, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.items;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -12,18 +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;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IRitualDiviner;
|
||||
|
@ -32,20 +29,30 @@ 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 BindableItems implements IRitualDiviner
|
||||
public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
|
||||
{
|
||||
private int maxMetaData;
|
||||
|
||||
public ItemRitualDiviner()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setMaxDamage(4);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.maxMetaData = 4;
|
||||
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)
|
||||
{
|
||||
|
@ -159,15 +166,15 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(stack, player)) return false;
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack, player)) return false;
|
||||
|
||||
if(placeRitualStoneAtMasterStone(stack, player, world, pos))
|
||||
if(placeRitualStoneAtMasterStone(stack, player, world, x, y, z))
|
||||
{
|
||||
this.setStoredLocation(stack, new Int3(pos));
|
||||
this.setStoredLocation(stack, new Int3(x, y, z));
|
||||
return true;
|
||||
}else if(!(world.getBlockState(pos).getBlock() instanceof IRitualStone || world.getBlockState(pos).getBlock() instanceof IMasterRitualStone) && !player.isSneaking())
|
||||
}else if(!(world.getBlock(x, y, z) instanceof IRitualStone || world.getBlock(x, y, z) instanceof IMasterRitualStone) && !player.isSneaking())
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
|
@ -181,12 +188,12 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, BlockPos pos)
|
||||
public boolean placeRitualStoneAtMasterStone(ItemStack stack, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
int direction = this.getDirection(stack);
|
||||
|
||||
ItemStack[] playerInventory = player.inventory.mainInventory;
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
|
@ -214,15 +221,13 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
|
||||
for (RitualComponent rc : ritualList)
|
||||
{
|
||||
BlockPos newPos = pos.add(rc.getX(direction), rc.getY(), rc.getZ(direction));
|
||||
|
||||
if (world.isAirBlock(newPos))
|
||||
if (world.isAirBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction)))
|
||||
{
|
||||
if (playerInvRitualStoneLocation >= 0 || player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack))
|
||||
{
|
||||
world.playAuxSFX(200, newPos.offsetUp(), 0);
|
||||
world.playAuxSFX(200, x, y + 1, z, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -231,13 +236,13 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
player.inventory.decrStackSize(playerInvRitualStoneLocation, 1);
|
||||
}
|
||||
|
||||
if(BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3);
|
||||
world.setBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), ModBlocks.ritualStone, rc.getStoneType(), 3);
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
world.playAuxSFX(2005, newPos.offsetUp(), 0);
|
||||
world.playAuxSFX(2005, x, y + 1, z, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -247,29 +252,29 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
}
|
||||
} else
|
||||
{
|
||||
IBlockState state = world.getBlockState(newPos);
|
||||
Block block = state.getBlock();
|
||||
Block block = world.getBlock(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
|
||||
if (block == ModBlocks.ritualStone)
|
||||
{
|
||||
int metadata = block.getMetaFromState(state);
|
||||
int metadata = world.getBlockMetadata(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction));
|
||||
|
||||
if (metadata != rc.getStoneType())
|
||||
{
|
||||
if(BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if(EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(stack))
|
||||
{
|
||||
world.playAuxSFX(200, newPos.offsetUp(), 0);
|
||||
world.playAuxSFX(200, x, y + 1, z, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
world.setBlockState(newPos, ModBlocks.ritualStone.getStateFromMeta(rc.getStoneType()), 3);
|
||||
world.setBlockMetadataWithNotify(x + rc.getX(direction), y + rc.getY(), z + rc.getZ(direction), rc.getStoneType(), 3);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
world.playAuxSFX(0, newPos.offsetUp(), 0);
|
||||
world.playAuxSFX(0, x, y + 1, z, 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -290,7 +295,7 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
int y = loc.yCoord;
|
||||
int z = loc.zCoord;
|
||||
|
||||
if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, new BlockPos(x, y, z)))
|
||||
if(!this.placeRitualStoneAtMasterStone(stack, (EntityPlayer)entity, world, x, y, z))
|
||||
{
|
||||
this.voidStoredLocation(stack);
|
||||
}
|
||||
|
@ -359,7 +364,7 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (BindableItems.checkAndSetItemOwner(stack, par3EntityPlayer) && par3EntityPlayer.isSneaking())
|
||||
if (EnergyItems.checkAndSetItemOwner(stack, par3EntityPlayer) && par3EntityPlayer.isSneaking())
|
||||
{
|
||||
rotateRituals(par2World,par3EntityPlayer, stack, true);
|
||||
}
|
||||
|
@ -374,7 +379,7 @@ public class ItemRitualDiviner extends BindableItems implements IRitualDiviner
|
|||
{
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(stack, player)) return true;
|
||||
if (!EnergyItems.checkAndSetItemOwner(stack,player)) return true;
|
||||
|
||||
if (!player.isSwingInProgress)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,6 @@ public class ItemSpellEffectBlock extends ItemBlock
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
String name;
|
||||
|
@ -20,12 +19,16 @@ public class ItemSpellEffectBlock extends ItemBlock
|
|||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "ice";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "wind";
|
||||
|
@ -42,7 +45,6 @@ public class ItemSpellEffectBlock extends ItemBlock
|
|||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
|
|
|
@ -10,9 +10,9 @@ public class ItemSpellEnhancementBlock extends ItemBlock
|
|||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
String name;
|
||||
|
@ -86,7 +86,6 @@ public class ItemSpellEnhancementBlock extends ItemBlock
|
|||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
|
|
|
@ -10,9 +10,9 @@ public class ItemSpellModifierBlock extends ItemBlock
|
|||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
String name;
|
||||
|
@ -20,12 +20,16 @@ public class ItemSpellModifierBlock extends ItemBlock
|
|||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "default";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "offensive";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "defensive";
|
||||
|
@ -42,7 +46,6 @@ public class ItemSpellModifierBlock extends ItemBlock
|
|||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1)
|
||||
|
||||
{
|
||||
|
|
|
@ -20,12 +20,16 @@ public class ItemSpellParadigmBlock extends ItemBlock
|
|||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "projectile";
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
name = "self";
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
name = "melee";
|
||||
|
|
|
@ -19,12 +19,12 @@ public class ItemStabilityGlyphBlock extends ItemBlock
|
|||
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
name = "stability1";
|
||||
break;
|
||||
case 0:
|
||||
name = "stability1";
|
||||
break;
|
||||
|
||||
default:
|
||||
name = "broken";
|
||||
default:
|
||||
name = "broken";
|
||||
}
|
||||
|
||||
return getUnlocalizedName() + "." + name;
|
||||
|
|
|
@ -2,44 +2,61 @@ 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 WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
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;
|
||||
|
||||
public class LavaCrystal extends BindableItems
|
||||
public class LavaCrystal extends EnergyItems
|
||||
{
|
||||
public LavaCrystal()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setUnlocalizedName("lavaCrystal");
|
||||
setEnergyUsed(25);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaCrystal");
|
||||
}
|
||||
|
||||
/*
|
||||
* Used to have the item contain itself.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
SoulNetworkHandler.syphonFromNetwork(itemStack, this.getEnergyUsed());
|
||||
ItemStack copiedStack = itemStack.copy();
|
||||
copiedStack.setItemDamage(copiedStack.getItemDamage());
|
||||
copiedStack.stackSize = 1;
|
||||
return copiedStack;
|
||||
{
|
||||
syphonWhileInContainer(itemStack, this.getEnergyUsed());
|
||||
ItemStack copiedStack = itemStack.copy();
|
||||
copiedStack.setItemDamage(copiedStack.getItemDamage());
|
||||
copiedStack.stackSize = 1;
|
||||
return copiedStack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem(ItemStack itemStack)
|
||||
public boolean hasContainerItem()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
@ -66,7 +83,22 @@ public class LavaCrystal extends BindableItems
|
|||
return false;
|
||||
}
|
||||
|
||||
if (SoulNetworkHandler.getCurrentEssence(ownerName) >= this.getEnergyUsed())
|
||||
// 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())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
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
|
||||
|
@ -9,4 +12,11 @@ public class LifeBucket extends ItemBucket
|
|||
{
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LifeBucket");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
public class MagicianBloodOrb extends Orb
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class MagicianBloodOrb extends EnergyBattery
|
||||
{
|
||||
public MagicianBloodOrb(int damage)
|
||||
{
|
||||
super(damage);
|
||||
orbLevel = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MagicianBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
public class MasterBloodOrb extends Orb
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class MasterBloodOrb extends EnergyBattery
|
||||
{
|
||||
public MasterBloodOrb(int damage)
|
||||
{
|
||||
super(damage);
|
||||
orbLevel = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
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;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class OrbOfTesting extends EnergyItems
|
||||
{
|
||||
public OrbOfTesting()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(CreativeTabs.tabMisc);
|
||||
setUnlocalizedName("orbOfTesting");
|
||||
setMaxDamage(100);
|
||||
setFull3D();
|
||||
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())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
|
||||
{
|
||||
par3EntityPlayer.heal(1);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReinforcedTelepositionFocus extends TelepositionFocus
|
||||
{
|
||||
public ReinforcedTelepositionFocus()
|
||||
|
@ -14,6 +17,13 @@ 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,6 +2,7 @@ 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;
|
||||
|
@ -9,30 +10,42 @@ 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
|
||||
{
|
||||
public SacrificialDagger()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
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)
|
||||
{
|
||||
|
@ -72,7 +85,7 @@ public class SacrificialDagger extends Item
|
|||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack stack)
|
||||
{
|
||||
return EnumAction.BOW;
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,7 +132,7 @@ public class SacrificialDagger extends Item
|
|||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
world.spawnParticle("reddust", 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))
|
||||
|
@ -145,8 +158,10 @@ public class SacrificialDagger extends Item
|
|||
|
||||
public void findAndFillAltar(World world, EntityPlayer player, int amount)
|
||||
{
|
||||
BlockPos pos = player.getPosition();
|
||||
IBloodAltar altarEntity = getAltar(world, pos);
|
||||
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);
|
||||
|
||||
if (altarEntity == null)
|
||||
{
|
||||
|
@ -157,7 +172,7 @@ public class SacrificialDagger extends Item
|
|||
altarEntity.startCycle();
|
||||
}
|
||||
|
||||
public IBloodAltar getAltar(World world, BlockPos pos)
|
||||
public IBloodAltar getAltar(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
|
||||
|
@ -167,8 +182,7 @@ public class SacrificialDagger extends Item
|
|||
{
|
||||
for (int k = -2; k <= 1; k++)
|
||||
{
|
||||
BlockPos newPos = pos.add(i, j, k);
|
||||
tileEntity = world.getTileEntity(newPos);
|
||||
tileEntity = world.getTileEntity(i + x, k + y, j + z);
|
||||
|
||||
if(tileEntity instanceof IBloodAltar)
|
||||
{
|
||||
|
@ -226,8 +240,8 @@ public class SacrificialDagger extends Item
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
public boolean hasEffect(ItemStack stack, int pass)
|
||||
{
|
||||
return this.canUseForSacrifice(stack) || super.hasEffect(stack);
|
||||
return this.canUseForSacrifice(stack) || super.hasEffect(stack, pass);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
@ -7,7 +8,7 @@ import net.minecraft.world.World;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class ScribeTool extends BindableItems
|
||||
public class ScribeTool extends EnergyItems
|
||||
{
|
||||
private int meta;
|
||||
|
||||
|
@ -15,6 +16,7 @@ public class ScribeTool extends BindableItems
|
|||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setMaxDamage(10);
|
||||
setEnergyUsed(10);
|
||||
this.meta = inkType;
|
||||
|
@ -34,7 +36,7 @@ public class ScribeTool extends BindableItems
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
{
|
||||
if (par1ItemStack.getItemDamage() > 0)
|
||||
{
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
|
||||
public class TelepositionFocus extends BindableItems
|
||||
import java.util.List;
|
||||
|
||||
public class TelepositionFocus extends EnergyItems
|
||||
{
|
||||
private int focusLevel;
|
||||
|
||||
|
@ -23,6 +25,13 @@ public class TelepositionFocus extends BindableItems
|
|||
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)
|
||||
{
|
||||
|
@ -45,7 +54,7 @@ public class TelepositionFocus extends BindableItems
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
{
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
|
@ -102,11 +111,6 @@ public class TelepositionFocus extends BindableItems
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockPos getBlockPos(ItemStack stack)
|
||||
{
|
||||
return new BlockPos(xCoord(stack), yCoord(stack), zCoord(stack));
|
||||
}
|
||||
|
||||
public int getFocusLevel()
|
||||
{
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
public class TranscendentBloodOrb extends Orb
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class TranscendentBloodOrb extends EnergyBattery
|
||||
{
|
||||
public TranscendentBloodOrb(int damage)
|
||||
{
|
||||
super(damage);
|
||||
orbLevel = 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TranscendentBloodOrb");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,22 @@
|
|||
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
|
||||
{
|
||||
public WaterScribeTool()
|
||||
{
|
||||
super(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterScribeTool");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ 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;
|
||||
|
@ -13,29 +14,40 @@ 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 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 thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
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, ILPGauge//, IRevealer, IGoggles, IRunicArmor
|
||||
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor, ILPGauge
|
||||
{
|
||||
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;
|
||||
|
||||
|
@ -43,6 +55,13 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
super(ItemArmor.ArmorMaterial.GOLD, 0, armorType);
|
||||
setMaxDamage(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemTool(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ModelBiped model1 = null;
|
||||
|
@ -95,10 +114,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;
|
||||
}
|
||||
|
@ -114,6 +133,44 @@ 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)
|
||||
{
|
||||
|
@ -138,7 +195,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
|
||||
{
|
||||
double armourReduction;
|
||||
double armourReduction = 0.0;
|
||||
|
||||
int f = 0;
|
||||
int h = 0;
|
||||
|
@ -208,7 +265,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
return 3;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.boundChestplate)
|
||||
if (armor.getItem() == ModItems.boundPlate)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
@ -231,7 +288,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
if (entity instanceof EntityPlayer)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(stack, (EntityPlayer) entity);
|
||||
EnergyItems.checkAndSetItemOwner(stack, (EntityPlayer) entity);
|
||||
|
||||
if (((EntityPlayer) entity).capabilities.isCreativeMode)
|
||||
{
|
||||
|
@ -283,7 +340,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
if (this.getIsInvisible(stack))
|
||||
{
|
||||
if (this == ModItems.boundHelmet || this == ModItems.boundChestplate || this == ModItems.boundBoots)
|
||||
if (this == ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/boundArmour_invisible_layer_1.png";
|
||||
}
|
||||
|
@ -295,7 +352,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
}
|
||||
}
|
||||
|
||||
if (this == ModItems.boundHelmet || this == ModItems.boundChestplate || this == ModItems.boundBoots)
|
||||
if (this == ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/boundArmour_layer_1.png";
|
||||
}
|
||||
|
@ -312,7 +369,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
return super.onItemRightClick(par1ItemStack, par2World, par3EntityPlayer);
|
||||
}
|
||||
|
||||
|
@ -338,11 +395,11 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
if (itemStack.getItemDamage() > 0)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(itemStack, player);
|
||||
EnergyItems.checkAndSetItemOwner(itemStack, player);
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if(BindableItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75))
|
||||
if(EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75))
|
||||
{
|
||||
itemStack.setItemDamage(0);
|
||||
}
|
||||
|
@ -379,7 +436,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
if (getUpgradeCostMultiplier(par1ItemStack) > 0.02f)
|
||||
{
|
||||
BindableItems.syphonBatteries(par1ItemStack, par3Entity, (int) (((ArmourUpgrade) inv[i].getItem()).getEnergyForTenSeconds() * getUpgradeCostMultiplier(par1ItemStack)));
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par3Entity, (int) (((ArmourUpgrade) inv[i].getItem()).getEnergyForTenSeconds() * getUpgradeCostMultiplier(par1ItemStack)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -441,6 +498,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
if (nextItem == null)
|
||||
{
|
||||
candidateSlot = i;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -541,66 +599,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)
|
||||
|
@ -730,75 +788,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,16 +20,15 @@ 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.BindableItems;
|
||||
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
|
||||
{
|
||||
|
@ -40,7 +39,7 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
protected boolean storeYLevel = false;
|
||||
protected boolean storeSeesSky = false;
|
||||
|
||||
protected List<Enchantment> illegalEnchantmentList = new LinkedList<Enchantment>();
|
||||
protected List<Enchantment> illegalEnchantmentList = new LinkedList();
|
||||
|
||||
public float reagentDrainPerDamage = 0.1f;
|
||||
|
||||
|
@ -91,9 +90,10 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
{
|
||||
if(this.storeBiomeID())
|
||||
{
|
||||
BlockPos pos = player.getPosition();
|
||||
int xCoord = (int) Math.floor(player.posX);
|
||||
int zCoord = (int) Math.floor(player.posZ);
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(pos);
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
if(biome != null)
|
||||
{
|
||||
this.setBiomeIDStored(itemStack, biome.biomeID);
|
||||
|
@ -102,7 +102,7 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
|
||||
if(this.storeDimensionID())
|
||||
{
|
||||
this.setDimensionIDStored(itemStack, world.provider.getDimensionId());
|
||||
this.setDimensionIDStored(itemStack, world.provider.dimensionId);
|
||||
}
|
||||
|
||||
if(this.storeYLevel())
|
||||
|
@ -129,7 +129,7 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if(BindableItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75))
|
||||
if(EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75))
|
||||
{
|
||||
float reagentAmount = APISpellHelper.getPlayerCurrentReagentAmount(player);
|
||||
|
||||
|
@ -176,7 +176,7 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
}
|
||||
}
|
||||
|
||||
Map<Enchantment, Map<Integer, Integer>> map = new HashMap<Enchantment, Map<Integer, Integer>>();
|
||||
Map<Enchantment, Map<Integer, Integer>> map = new HashMap();
|
||||
|
||||
for(Object obj : enchantList)
|
||||
{
|
||||
|
@ -184,7 +184,7 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
|
||||
if(!map.containsKey(enchantmentdata.enchantmentobj))
|
||||
{
|
||||
map.put(enchantmentdata.enchantmentobj, new HashMap<Integer, Integer>());
|
||||
map.put(enchantmentdata.enchantmentobj, new HashMap());
|
||||
}
|
||||
|
||||
Map<Integer, Integer> numMap = map.get(enchantmentdata.enchantmentobj);
|
||||
|
@ -308,8 +308,9 @@ public abstract class OmegaArmour extends BoundArmour
|
|||
}
|
||||
|
||||
NBTTagCompound tag = omegaTag.getCompoundTag("armour");
|
||||
|
||||
return ItemStack.loadItemStackFromNBT(tag);
|
||||
ItemStack armourStack = ItemStack.loadItemStackFromNBT(tag);
|
||||
|
||||
return armourStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -375,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,19 +3,32 @@ 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.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
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);
|
||||
|
@ -42,6 +55,44 @@ 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,22 +2,34 @@ 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 net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
|
||||
|
||||
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 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);
|
||||
|
@ -45,6 +57,44 @@ 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,21 +2,33 @@ 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 net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
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);
|
||||
|
@ -43,6 +55,44 @@ 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,19 +3,32 @@ 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.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
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);
|
||||
|
@ -42,6 +55,44 @@ 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,42 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
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 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.EnumFacing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class AlchemicalRouter extends Item implements IReagentManipulator
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemAttunedCrystal extends Item implements IReagentManipulator
|
||||
{
|
||||
public AlchemicalRouter()
|
||||
public static final int maxDistance = 6;
|
||||
|
||||
public IIcon crystalBody;
|
||||
public IIcon crystalLabel;
|
||||
|
||||
public ItemAttunedCrystal()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.hasSubtypes = true;
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,6 +78,62 @@ public class AlchemicalRouter 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)
|
||||
{
|
||||
|
@ -95,9 +157,11 @@ public class AlchemicalRouter extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tile instanceof IReagentHandler))
|
||||
{
|
||||
|
@ -108,10 +172,10 @@ public class AlchemicalRouter extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(EnumFacing.UP);
|
||||
ReagentContainerInfo[] infos = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if (infos != null)
|
||||
{
|
||||
List<Reagent> reagentList = new LinkedList<Reagent>();
|
||||
List<Reagent> reagentList = new LinkedList();
|
||||
for (ReagentContainerInfo info : infos)
|
||||
{
|
||||
if (info != null)
|
||||
|
@ -159,15 +223,13 @@ public class AlchemicalRouter extends Item implements IReagentManipulator
|
|||
return itemStack;
|
||||
}
|
||||
|
||||
final int maxDistance = 6;
|
||||
|
||||
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)
|
||||
if (dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance)
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar"));
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
TileEntity pastTile = world.getTileEntity(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
|
||||
TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
if (!(pastTile instanceof TEReagentConduit))
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind"));
|
||||
|
@ -185,10 +247,10 @@ public class AlchemicalRouter extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, pos);
|
||||
pastRelay.removeReagentDestinationViaActual(reagent, x, y, z);
|
||||
} else
|
||||
{
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, pos))
|
||||
if (pastRelay.addReagentDestinationViaActual(reagent, x, y, z))
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name));
|
||||
} else
|
||||
|
@ -196,13 +258,13 @@ public class AlchemicalRouter extends Item implements IReagentManipulator
|
|||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections"));
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(new BlockPos(coords.xCoord, coords.yCoord, coords.zCoord));
|
||||
world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
} else
|
||||
{
|
||||
int dimension = world.provider.getDimensionId();
|
||||
int dimension = world.provider.dimensionId;
|
||||
|
||||
this.setDimension(itemStack, dimension);
|
||||
this.setCoordinates(itemStack, new Int3(pos));
|
||||
this.setCoordinates(itemStack, new Int3(x, y, z));
|
||||
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking"));
|
||||
}
|
|
@ -1,25 +1,36 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
|
||||
public class AlchemicalCleanser extends Item implements IReagentManipulator
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDestinationClearer extends Item implements IReagentManipulator
|
||||
{
|
||||
public AlchemicalCleanser()
|
||||
public ItemDestinationClearer()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:TankClearer");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,9 +57,11 @@ public class AlchemicalCleanser extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tile instanceof TEReagentConduit))
|
||||
{
|
|
@ -1,33 +1,39 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.energy;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
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 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.EnumFacing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class AlchemicalSegmenter extends Item implements IReagentManipulator
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemTankSegmenter extends Item implements IReagentManipulator
|
||||
{
|
||||
public AlchemicalSegmenter()
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon crystalBody;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon crystalLabel;
|
||||
|
||||
public ItemTankSegmenter()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.hasSubtypes = true;
|
||||
setMaxStackSize(1);
|
||||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,6 +64,62 @@ public class AlchemicalSegmenter 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)
|
||||
{
|
||||
|
@ -74,8 +136,10 @@ public class AlchemicalSegmenter extends Item implements IReagentManipulator
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
BlockPos pos = movingobjectposition.func_178782_a();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (!(tile instanceof ISegmentedReagentHandler))
|
||||
{
|
||||
return itemStack;
|
||||
|
@ -84,7 +148,7 @@ public class AlchemicalSegmenter extends Item implements IReagentManipulator
|
|||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(EnumFacing.UP);
|
||||
ReagentContainerInfo[] infos = reagentHandler.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if (infos != null)
|
||||
{
|
||||
List<Reagent> reagentList = new LinkedList();
|
|
@ -1,145 +1,145 @@
|
|||
//package WayofTime.alchemicalWizardry.common.items.forestry;
|
||||
//
|
||||
//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.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;
|
||||
//import forestry.api.apiculture.IBee;
|
||||
//import forestry.api.apiculture.IBeeGenome;
|
||||
//import forestry.api.apiculture.IBeeHousing;
|
||||
//import forestry.api.apiculture.IHiveFrame;
|
||||
//
|
||||
//public class ItemBloodFrame extends EnergyItems implements IHiveFrame
|
||||
//{
|
||||
// public ItemBloodFrame()
|
||||
// {
|
||||
// super();
|
||||
// this.maxStackSize = 1;
|
||||
// this.setMaxDamage(10);
|
||||
// setEnergyUsed(1000);
|
||||
// setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
// {
|
||||
// par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc"));
|
||||
//
|
||||
// if (!(par1ItemStack.getTagCompound() == null))
|
||||
// {
|
||||
// par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(IIconRegister iconRegister)
|
||||
// {
|
||||
// this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
// {
|
||||
// if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
// {
|
||||
// if (par1ItemStack.getItemDamage() > 0)
|
||||
// {
|
||||
// if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
// {
|
||||
// par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return par1ItemStack;
|
||||
// }
|
||||
//
|
||||
// @Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 0.0001f;
|
||||
// }
|
||||
//
|
||||
// @Override public float getProductionModifier(IBeeGenome genome, float currentModifier)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override public float getFloweringModifier(IBeeGenome genome, float currentModifier)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override public float getGeneticDecay(IBeeGenome genome, float currentModifier)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override public boolean isSealed()
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override public boolean isSelfLighted()
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override public boolean isSunlightSimulated()
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override public boolean isHellish()
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear))
|
||||
// {
|
||||
// EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear);
|
||||
// return frame;
|
||||
// }else
|
||||
// {
|
||||
// frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
// if(frame.getItemDamage()>=frame.getMaxDamage())
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// return frame;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
package WayofTime.alchemicalWizardry.common.items.forestry;
|
||||
|
||||
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.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;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
|
||||
public class ItemBloodFrame extends EnergyItems implements IHiveFrame
|
||||
{
|
||||
public ItemBloodFrame()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(10);
|
||||
setEnergyUsed(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.bloodframe.desc"));
|
||||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodFrame");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
|
||||
{
|
||||
if (par1ItemStack.getItemDamage() > 0)
|
||||
{
|
||||
if(EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0.0001f;
|
||||
}
|
||||
|
||||
@Override public float getProductionModifier(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public float getFloweringModifier(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override public float getGeneticDecay(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override public boolean isSealed()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public boolean isSelfLighted()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public boolean isSunlightSimulated()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public boolean isHellish()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
if(EnergyItems.canSyphonInContainer(frame, getEnergyUsed()*wear))
|
||||
{
|
||||
EnergyItems.syphonWhileInContainer(frame, getEnergyUsed()*wear);
|
||||
return frame;
|
||||
}else
|
||||
{
|
||||
frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
if(frame.getItemDamage()>=frame.getMaxDamage())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.ai.attributes.IAttribute;
|
||||
|
@ -23,24 +23,35 @@ import net.minecraft.util.EnumChatFormatting;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class AlchemyFlask extends Item
|
||||
{
|
||||
public AlchemyFlask()
|
||||
{
|
||||
super();
|
||||
setMaxDamage(8);
|
||||
setMaxStackSize(1);
|
||||
this.setMaxDamage(8);
|
||||
this.setMaxStackSize(1);
|
||||
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"))
|
||||
{
|
||||
ArrayList<AlchemyPotionHelper> arraylist = new ArrayList<AlchemyPotionHelper>();
|
||||
ArrayList<AlchemyPotionHelper> arraylist = new ArrayList();
|
||||
NBTTagList nbttaglist = par1ItemStack.getTagCompound().getTagList("CustomFlaskEffects", Constants.NBT.TAG_COMPOUND);
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i)
|
||||
|
@ -61,7 +72,7 @@ public class AlchemyFlask extends Item
|
|||
|
||||
if (list != null)
|
||||
{
|
||||
ArrayList<PotionEffect> newList = new ArrayList<PotionEffect>();
|
||||
ArrayList<PotionEffect> newList = new ArrayList();
|
||||
|
||||
for (AlchemyPotionHelper aph : list)
|
||||
{
|
||||
|
@ -138,10 +149,10 @@ public class AlchemyFlask extends Item
|
|||
{
|
||||
if (this.isPotionThrowable(par1ItemStack))
|
||||
{
|
||||
return EnumAction.NONE;
|
||||
return EnumAction.none;
|
||||
}
|
||||
|
||||
return EnumAction.DRINK;
|
||||
return EnumAction.drink;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -272,7 +283,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.getAttributeModifierMap();
|
||||
Map map = potion.func_111186_k();
|
||||
|
||||
if (map != null && map.size() > 0)
|
||||
{
|
||||
|
@ -282,7 +293,7 @@ public class AlchemyFlask extends Item
|
|||
{
|
||||
Entry entry = (Entry) iterator1.next();
|
||||
AttributeModifier attributemodifier = (AttributeModifier) entry.getValue();
|
||||
AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation());
|
||||
AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation());
|
||||
hashmultimap.put(((IAttribute) entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1);
|
||||
}
|
||||
}
|
||||
|
@ -334,11 +345,11 @@ public class AlchemyFlask extends Item
|
|||
|
||||
if (d0 > 0.0D)
|
||||
{
|
||||
par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
|
||||
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())}));
|
||||
} else if (d0 < 0.0D)
|
||||
{
|
||||
d1 *= -1.0D;
|
||||
par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[]{ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String) entry1.getKey())}));
|
||||
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())}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,82 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyReagent extends Item
|
||||
{
|
||||
public AlchemyReagent()
|
||||
{
|
||||
super();
|
||||
setMaxStackSize(64);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
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
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public AverageLengtheningCatalyst()
|
||||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AverageLengtheningCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public AveragePowerCatalyst()
|
||||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AveragePowerCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,12 +1,24 @@
|
|||
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
|
||||
{
|
||||
public CombinationalCatalyst()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CombinationalCatalyst");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
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
|
||||
{
|
||||
public EnhancedFillingAgent()
|
||||
{
|
||||
super();
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,4 +41,11 @@ public class EnhancedFillingAgent extends WeakFillingAgent
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:EnhancedFillingAgent");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public GreaterLengtheningCatalyst()
|
||||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterLengtheningCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public GreaterPowerCatalyst()
|
||||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GreaterPowerCatalyst");
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.ICatalyst;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -18,6 +19,7 @@ public class LengtheningCatalyst extends Item implements ICatalyst
|
|||
public LengtheningCatalyst(int catalystStrength)
|
||||
{
|
||||
this.catalystStrength = catalystStrength;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public MundaneLengtheningCatalyst()
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundaneLengtheningCatalyst");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public MundanePowerCatalyst()
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MundanePowerCatalyst");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.ICatalyst;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -20,6 +21,7 @@ public class PowerCatalyst extends Item implements ICatalyst
|
|||
{
|
||||
super();
|
||||
this.catalystStrength = catalystStrength;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,23 +1,26 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.IBindingAgent;
|
||||
import java.util.List;
|
||||
|
||||
public class StandardBindingAgent extends Item implements IBindingAgent
|
||||
{
|
||||
public StandardBindingAgent()
|
||||
{
|
||||
super();
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +29,13 @@ 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,10 +1,16 @@
|
|||
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
|
||||
{
|
||||
public StandardFillingAgent()
|
||||
{
|
||||
super();
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,4 +28,11 @@ public class StandardFillingAgent extends WeakFillingAgent
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:StandardFillingAgent");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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
|
||||
{
|
||||
public WeakBindingAgent()
|
||||
|
@ -12,4 +16,11 @@ 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,24 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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 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 WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.IFillingAgent;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class WeakFillingAgent extends Item implements IFillingAgent
|
||||
{
|
||||
public WeakFillingAgent()
|
||||
{
|
||||
super();
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,6 +48,13 @@ 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,9 +1,20 @@
|
|||
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
|
||||
{
|
||||
public InputRoutingFocus()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:InputRoutingFocus");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,23 +2,30 @@ 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();
|
||||
|
@ -39,28 +46,58 @@ 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)
|
||||
{
|
||||
String addedString = "";
|
||||
|
||||
switch (itemStack.getItemDamage())
|
||||
switch(itemStack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
addedString = "default";
|
||||
break;
|
||||
case 1:
|
||||
addedString = "modItem";
|
||||
break;
|
||||
case 2:
|
||||
addedString = "ignMeta";
|
||||
break;
|
||||
case 3:
|
||||
addedString = "matchNBT";
|
||||
break;
|
||||
case 4:
|
||||
addedString = "global";
|
||||
break;
|
||||
case 0:
|
||||
addedString = "default";
|
||||
break;
|
||||
case 1:
|
||||
addedString = "modItem";
|
||||
break;
|
||||
case 2:
|
||||
addedString = "ignMeta";
|
||||
break;
|
||||
case 3:
|
||||
addedString = "matchNBT";
|
||||
break;
|
||||
case 4:
|
||||
addedString = "global";
|
||||
break;
|
||||
}
|
||||
|
||||
return super.getUnlocalizedName() + "." + addedString;
|
||||
|
|
|
@ -8,11 +8,10 @@ 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;
|
||||
|
@ -42,18 +41,18 @@ public class RoutingFocus extends Item
|
|||
//
|
||||
// public void cycleDirection(ItemStack itemStack)
|
||||
// {
|
||||
// EnumFacing dir = this.getSetDirection(itemStack);
|
||||
// ForgeDirection dir = this.getSetDirection(itemStack);
|
||||
// int direction = dir.ordinal();
|
||||
// direction++;
|
||||
// if(direction >= EnumFacing.VALID_DIRECTIONS.length)
|
||||
// if(direction >= ForgeDirection.VALID_DIRECTIONS.length)
|
||||
// {
|
||||
// direction = 0;
|
||||
// }
|
||||
//
|
||||
// this.setSetDirection(itemStack, EnumFacing.getOrientation(direction));
|
||||
// this.setSetDirection(itemStack, ForgeDirection.getOrientation(direction));
|
||||
// }
|
||||
|
||||
public EnumFacing getSetDirection(ItemStack itemStack)
|
||||
public ForgeDirection getSetDirection(ItemStack itemStack)
|
||||
{
|
||||
if(!itemStack.hasTagCompound())
|
||||
{
|
||||
|
@ -62,10 +61,10 @@ public class RoutingFocus extends Item
|
|||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
return EnumFacing.getFront(tag.getInteger("direction"));
|
||||
return ForgeDirection.getOrientation(tag.getInteger("direction"));
|
||||
}
|
||||
|
||||
public void setSetDirection(ItemStack itemStack, EnumFacing dir)
|
||||
public void setSetDirection(ItemStack itemStack, ForgeDirection dir)
|
||||
{
|
||||
if(!itemStack.hasTagCompound())
|
||||
{
|
||||
|
@ -97,14 +96,14 @@ public class RoutingFocus extends Item
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof IInventory)
|
||||
{
|
||||
if(player.isSneaking())
|
||||
|
@ -112,7 +111,7 @@ public class RoutingFocus extends Item
|
|||
if(this instanceof ILimitedRoutingFocus)
|
||||
{
|
||||
int pastAmount = ((ILimitedRoutingFocus)this).getRoutingFocusLimit(stack);
|
||||
int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, side);
|
||||
int amount = SpellHelper.getNumberOfItemsInInventory((IInventory)tile, ForgeDirection.getOrientation(side));
|
||||
if(amount != pastAmount)
|
||||
{
|
||||
((ILimitedRoutingFocus)this).setRoutingFocusLimit(stack, amount);
|
||||
|
@ -121,8 +120,8 @@ public class RoutingFocus extends Item
|
|||
}
|
||||
}
|
||||
|
||||
this.setCoordinates(stack, pos);
|
||||
this.setSetDirection(stack, side);
|
||||
this.setCoordinates(stack, x, y, z);
|
||||
this.setSetDirection(stack, ForgeDirection.getOrientation(side));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -130,7 +129,7 @@ public class RoutingFocus extends Item
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setCoordinates(ItemStack itemStack, BlockPos pos)
|
||||
public void setCoordinates(ItemStack itemStack, int x, int y, int z)
|
||||
{
|
||||
if(!itemStack.hasTagCompound())
|
||||
{
|
||||
|
@ -139,9 +138,9 @@ public class RoutingFocus extends Item
|
|||
|
||||
NBTTagCompound tag = itemStack.getTagCompound();
|
||||
|
||||
tag.setInteger("xCoord", pos.getX());
|
||||
tag.setInteger("yCoord", pos.getY());
|
||||
tag.setInteger("zCoord", pos.getZ());
|
||||
tag.setInteger("xCoord", x);
|
||||
tag.setInteger("yCoord", y);
|
||||
tag.setInteger("zCoord", z);
|
||||
}
|
||||
|
||||
public int xCoord(ItemStack itemStack)
|
||||
|
|
|
@ -2,6 +2,8 @@ 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;
|
||||
|
@ -10,15 +12,19 @@ import net.minecraft.util.Vec3;
|
|||
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.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilAir extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
public SigilAir()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
//setMaxDamage(1000);
|
||||
setEnergyUsed(50);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,10 +38,17 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -62,7 +75,7 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
|||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
if(!par2World.isRemote)
|
||||
{
|
||||
|
@ -108,7 +121,8 @@ public class SigilAir extends BindableItems implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
public void onArmourUpdate(World world, EntityPlayer player,
|
||||
ItemStack thisItemStack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
player.fallDistance = 0;
|
||||
|
|
|
@ -3,105 +3,113 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
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.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilBloodLight extends BindableItems implements IHolding, ArmourUpgrade, ISigil
|
||||
public class SigilBloodLight extends EnergyItems implements IHolding, ArmourUpgrade, ISigil
|
||||
{
|
||||
public SigilBloodLight()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(10);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.bloodlightsigil.desc"));
|
||||
|
||||
if (!(itemStack.getTagCompound() == null))
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + itemStack.getTagCompound().getString("ownerName"));
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + par1ItemStack.getTagCompound().getString("ownerName"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if(!BindableItems.checkAndSetItemOwner(itemStack, player) || !BindableItems.syphonBatteries(itemStack, player, getEnergyUsed()))
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodLightSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if(!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer) || !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
IBlockState light = ModBlocks.blockBloodLight.getBlockState().getBaseState();
|
||||
|
||||
if (side.getIndex() == 0 && world.isAirBlock(blockPos.add(0, -1, 0)))
|
||||
if (par7 == 0 && par3World.isAirBlock(par4, par5 - 1, par6))
|
||||
{
|
||||
world.setBlockState(blockPos.add(0, -1, 0), light);
|
||||
par3World.setBlock(par4, par5 - 1, par6, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
if (side.getIndex() == 1 && world.isAirBlock(blockPos.add(0, 1, 0)))
|
||||
if (par7 == 1 && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
{
|
||||
world.setBlockState(blockPos.add(0, 1, 0), light);
|
||||
par3World.setBlock(par4, par5 + 1, par6, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
if (side.getIndex() == 2 && world.isAirBlock(blockPos.add(0, 0, -1)))
|
||||
if (par7 == 2 && par3World.isAirBlock(par4, par5, par6 - 1))
|
||||
{
|
||||
world.setBlockState(blockPos.add(0, 0, -1), light);
|
||||
par3World.setBlock(par4, par5, par6 - 1, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
if (side.getIndex() == 3 && world.isAirBlock(blockPos.add(0, 0, 1)))
|
||||
if (par7 == 3 && par3World.isAirBlock(par4, par5, par6 + 1))
|
||||
{
|
||||
world.setBlockState(blockPos.add(0, 0, 1), light);
|
||||
par3World.setBlock(par4, par5, par6 + 1, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
if (side.getIndex() == 4 && world.isAirBlock(blockPos.add(-1, 0, 0)))
|
||||
if (par7 == 4 && par3World.isAirBlock(par4 - 1, par5, par6))
|
||||
{
|
||||
world.setBlockState(blockPos.add(-1, 0, 0), light);
|
||||
par3World.setBlock(par4 - 1, par5, par6, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
if (side.getIndex() == 5 && world.isAirBlock(blockPos.add(1, 0, 0)))
|
||||
if (par7 == 5 && par3World.isAirBlock(par4 + 1, par5, par6))
|
||||
{
|
||||
world.setBlockState(blockPos.add(1, 0, 0), light);
|
||||
par3World.setBlock(par4 + 1, par5, par6, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(itemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return itemStack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (itemStack.getTagCompound() == null)
|
||||
if (par1ItemStack.getTagCompound() == null)
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(!BindableItems.syphonBatteries(itemStack, par3EntityPlayer, getEnergyUsed() * 5))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed() * 5))
|
||||
{
|
||||
return itemStack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (!par2World.isRemote)
|
||||
|
@ -109,13 +117,13 @@ public class SigilBloodLight extends BindableItems implements IHolding, ArmourUp
|
|||
par2World.spawnEntityInWorld(new EntityBloodLightProjectile(par2World, par3EntityPlayer, 10));
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true, false));
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 400, 9, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,28 +4,42 @@ import java.util.List;
|
|||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
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 WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilDivination extends BindableItems implements ArmourUpgrade, IReagentManipulator, IBindable, ISigil
|
||||
public class SigilDivination extends Item implements ArmourUpgrade, IReagentManipulator, IBindable, ISigil
|
||||
{
|
||||
public SigilDivination()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DivinationSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,14 +57,14 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote)
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.worldObj.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -75,7 +89,11 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
TileEntity tile = par2World.getTileEntity(movingobjectposition.func_178782_a());
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = par2World.getTileEntity(x, y, z);
|
||||
|
||||
if (!(tile instanceof IReagentHandler))
|
||||
{
|
||||
|
@ -86,7 +104,7 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe
|
|||
|
||||
IReagentHandler relay = (IReagentHandler) tile;
|
||||
|
||||
ReagentContainerInfo[] infoList = relay.getContainerInfo(EnumFacing.DOWN);
|
||||
ReagentContainerInfo[] infoList = relay.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if (infoList != null)
|
||||
{
|
||||
for (ReagentContainerInfo info : infoList)
|
||||
|
@ -104,7 +122,10 @@ public class SigilDivination extends BindableItems implements ArmourUpgrade, IRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {}
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
|
|
|
@ -3,22 +3,28 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SigilFluid extends BindableItems implements IFluidContainerItem, ISigil
|
||||
public class SigilFluid extends Item implements IFluidContainerItem, ISigil
|
||||
{
|
||||
private int capacity = 128 * 1000;
|
||||
private static final int STATE_SYPHON = 0;
|
||||
|
@ -33,6 +39,8 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
super();
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,6 +86,13 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -181,6 +196,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
}
|
||||
int range = 5;
|
||||
|
||||
float f = 1.0F;
|
||||
boolean flag = true;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
|
@ -191,12 +207,16 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a()))
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (!player.func_175151_a(movingobjectposition.func_178782_a(), movingobjectposition.field_178784_b, container))
|
||||
if (!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
@ -214,11 +234,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
}
|
||||
}
|
||||
|
||||
List<Int3> positionList = new ArrayList<Int3>();
|
||||
|
||||
int x = movingobjectposition.func_178782_a().getX();
|
||||
int y = movingobjectposition.func_178782_a().getY();
|
||||
int z = movingobjectposition.func_178782_a().getZ();
|
||||
List<Int3> positionList = new ArrayList();
|
||||
|
||||
boolList[range][range][range] = true;
|
||||
positionList.add(new Int3(range, range, range));
|
||||
|
@ -238,7 +254,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (i - 1 >= 0 && !boolList[i - 1][j][k])
|
||||
{
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i - 1, y - range + j, z - range + k)).getBlock();
|
||||
Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -251,7 +267,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
if (j - 1 >= 0 && !boolList[i][j - 1][k])
|
||||
{
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j - 1, z - range + k)).getBlock();
|
||||
Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -264,7 +280,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
if (k - 1 >= 0 && !boolList[i][j][k - 1])
|
||||
{
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j, z - range + k - 1)).getBlock();
|
||||
Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -277,7 +293,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
if (i + 1 <= 2 * range && !boolList[i + 1][j][k])
|
||||
{
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i + 1, y - range + j, z - range + k)).getBlock();
|
||||
Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -290,7 +306,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
if (j + 1 <= 2 * range && !boolList[i][j + 1][k])
|
||||
{
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j + 1, z - range + k)).getBlock();
|
||||
Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -303,7 +319,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
if (k + 1 <= 2 * range && !boolList[i][j][k + 1])
|
||||
{
|
||||
Block block = world.getBlockState(new BlockPos(x - range + i, y - range + j, z - range + k + 1)).getBlock();
|
||||
Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
|
@ -329,10 +345,10 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock() != null && world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock().getMaterial() instanceof MaterialLiquid)
|
||||
if (world.getBlock(x + i - range, y + j - range, z + k - range) != null && world.getBlock(x + i - range, y + j - range, z + k - range).getMaterial() instanceof MaterialLiquid)
|
||||
{
|
||||
//world.setBlockToAir(x+i-range, y+j-range, z+k-range);
|
||||
Block block = world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock();
|
||||
Block block = world.getBlock(x + i - range, y + j - range, z + k - range);
|
||||
if (block == null)
|
||||
{
|
||||
continue;
|
||||
|
@ -342,7 +358,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
AlchemicalWizardry.logger.info("x: " + (i - range) + " y: " + (j - range) + " z: " + (k - range));
|
||||
|
||||
|
||||
if (fluid == null || world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range)).getBlock().getMetaFromState(world.getBlockState(new BlockPos(x + i - range, y + j - range, z + k - range))) != 0)
|
||||
if (fluid == null || world.getBlockMetadata(x + i - range, y + j - range, z + k - range) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -355,7 +371,8 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
if ((amount > 0 && forceFill) || (amount >= 1000 && !forceFill))
|
||||
{
|
||||
{
|
||||
world.setBlockToAir(new BlockPos(x + i - range, y + j - range, z + k - range));
|
||||
world.setBlockToAir(x + i - range, y + j - range, z + k - range);
|
||||
|
||||
}
|
||||
|
||||
this.fill(container, new FluidStack(fluid, 1000), true);
|
||||
|
@ -370,6 +387,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
public ItemStack fillItemFromWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill)
|
||||
{
|
||||
float f = 1.0F;
|
||||
boolean flag = true;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
|
@ -380,19 +398,23 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a()))
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, i, j, k))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (!player.func_175151_a(movingobjectposition.func_178782_a(), movingobjectposition.field_178784_b, container))
|
||||
if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (world.getBlockState(movingobjectposition.func_178782_a()).getBlock() != null && world.getBlockState(movingobjectposition.func_178782_a()).getBlock().getMaterial() instanceof MaterialLiquid)
|
||||
if (world.getBlock(i, j, k) != null && world.getBlock(i, j, k).getMaterial() instanceof MaterialLiquid)
|
||||
{
|
||||
Block block = world.getBlockState(movingobjectposition.func_178782_a()).getBlock();
|
||||
Block block = world.getBlock(i, j, k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid == null)
|
||||
|
@ -408,7 +430,7 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
world.setBlockToAir(movingobjectposition.func_178782_a());
|
||||
world.setBlockToAir(i, j, k);
|
||||
}
|
||||
|
||||
this.fill(container, new FluidStack(fluid, 1000), true);
|
||||
|
@ -433,6 +455,12 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
|
||||
if (simStack != null && simStack.amount >= 1000)
|
||||
{
|
||||
Block fluidBlock = simStack.getFluid().getBlock();
|
||||
|
||||
float f = 1.0F;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||
boolean flag = false;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
|
@ -443,56 +471,57 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
if (!world.canMineBlockBody(player, movingobjectposition.func_178782_a()))
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, i, j, k))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
int i = movingobjectposition.func_178782_a().getX();
|
||||
int j = movingobjectposition.func_178782_a().getY();
|
||||
int k = movingobjectposition.func_178782_a().getZ();
|
||||
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 0)
|
||||
if (movingobjectposition.sideHit == 0)
|
||||
{
|
||||
--j;
|
||||
}
|
||||
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 1)
|
||||
if (movingobjectposition.sideHit == 1)
|
||||
{
|
||||
++j;
|
||||
}
|
||||
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 2)
|
||||
if (movingobjectposition.sideHit == 2)
|
||||
{
|
||||
--k;
|
||||
}
|
||||
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 3)
|
||||
if (movingobjectposition.sideHit == 3)
|
||||
{
|
||||
++k;
|
||||
}
|
||||
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 4)
|
||||
if (movingobjectposition.sideHit == 4)
|
||||
{
|
||||
--i;
|
||||
}
|
||||
|
||||
if (movingobjectposition.field_178784_b.getIndex() == 5)
|
||||
if (movingobjectposition.sideHit == 5)
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
if (!player.func_175151_a(new BlockPos(i, j, k), movingobjectposition.field_178784_b, container))
|
||||
if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (this.tryPlaceContainedLiquid(world, new BlockPos(i, j, k)) && !player.capabilities.isCreativeMode)
|
||||
if (this.tryPlaceContainedLiquid(world, fluidBlock, d0, d1, d2, i, j, k) && !player.capabilities.isCreativeMode)
|
||||
{
|
||||
this.drain(container, 1000, true);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return container;
|
||||
|
@ -502,28 +531,27 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
return container;
|
||||
}
|
||||
|
||||
public boolean tryPlaceContainedLiquid(World world, BlockPos blockPos)
|
||||
public boolean tryPlaceContainedLiquid(World par1World, Block block, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
{
|
||||
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().isSolid()) //TODO Was func_149730_j() so check this!
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).func_149730_j())
|
||||
{
|
||||
return false;
|
||||
} else if ((world.getBlockState(blockPos).getBlock().getMaterial() instanceof MaterialLiquid && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0))
|
||||
} else if ((par1World.getBlock(par8, par9, par10).getMaterial() instanceof MaterialLiquid && (par1World.getBlockMetadata(par8, par9, par10) == 0)))
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
Block block = world.getBlockState(blockPos).getBlock();
|
||||
if ((block == Blocks.water || block == Blocks.flowing_water) && world.provider.func_177500_n())
|
||||
if ((block == Blocks.water || block == Blocks.flowing_water) && par1World.provider.isHellWorld)
|
||||
{
|
||||
world.playSoundEffect(blockPos.getX() + 0.5D, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
|
||||
par1World.playSoundEffect(par2 + 0.5D, par4 + 0.5D, par6 + 0.5D, "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
|
||||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) blockPos.getX() + Math.random(), (double) blockPos.getY() + Math.random(), (double) blockPos.getZ() + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
par1World.spawnParticle("largesmoke", (double) par8 + Math.random(), (double) par9 + Math.random(), (double) par10 + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
} else
|
||||
{
|
||||
world.setBlockState(blockPos, block.getBlockState().getBaseState());
|
||||
par1World.setBlock(par8, par9, par10, block, 0, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -550,11 +578,15 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(movingobjectposition.func_178782_a());
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(i, j, k);
|
||||
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
int amount = ((IFluidHandler) tile).fill(movingobjectposition.field_178784_b, fluid, true);
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(movingobjectposition.sideHit), fluid, true);
|
||||
|
||||
this.drain(container, amount, true);
|
||||
}
|
||||
|
@ -577,17 +609,21 @@ public class SigilFluid extends BindableItems implements IFluidContainerItem, IS
|
|||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(movingobjectposition.func_178782_a());
|
||||
int i = movingobjectposition.blockX;
|
||||
int j = movingobjectposition.blockY;
|
||||
int k = movingobjectposition.blockZ;
|
||||
|
||||
TileEntity tile = world.getTileEntity(i, j, k);
|
||||
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluidAmount = ((IFluidHandler) tile).drain(movingobjectposition.field_178784_b, this.getCapacity(container), false);
|
||||
FluidStack fluidAmount = ((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), false);
|
||||
|
||||
int amount = this.fill(container, fluidAmount, false);
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
((IFluidHandler) tile).drain(movingobjectposition.field_178784_b, this.getCapacity(container), true);
|
||||
((IFluidHandler) tile).drain(ForgeDirection.getOrientation(movingobjectposition.sideHit), this.getCapacity(container), true);
|
||||
|
||||
this.fill(container, fluidAmount, true);
|
||||
}
|
||||
|
|
|
@ -3,24 +3,35 @@ 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.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpgrade, ISigil
|
||||
public class SigilHarvest extends EnergyItems implements IHolding, ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilHarvest()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(500);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +41,7 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -42,10 +53,51 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HarvestGoddessSigil_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)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -56,18 +108,18 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
tag.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -93,7 +145,7 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
int range = 3;
|
||||
int verticalRange = 1;
|
||||
|
@ -107,18 +159,18 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
HarvestRegistry.harvestBlock(par2World, new BlockPos(ix, iy, iz));
|
||||
HarvestRegistry.harvestBlock(par2World, ix, iy, iz);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +195,7 @@ public class SigilHarvest extends SigilToggleable implements IHolding, ArmourUpg
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
HarvestRegistry.harvestBlock(world, new BlockPos(ix, iy, iz));
|
||||
HarvestRegistry.harvestBlock(world, ix, iy, iz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -13,16 +14,18 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
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 net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.Orb;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
||||
{
|
||||
|
@ -35,7 +38,16 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
public SigilLava()
|
||||
{
|
||||
super(Blocks.lava);
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:LavaSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,27 +80,27 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote || !BindableItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
if (world.isRemote || !EnergyItems.checkAndSetItemOwner(stack, player) || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!world.canMineBlockBody(player, blockPos))
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
FluidStack fluid = new FluidStack(FluidRegistry.LAVA, 1000);
|
||||
int amount = ((IFluidHandler) tile).fill(side, fluid, false);
|
||||
int amount = ((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, false);
|
||||
|
||||
if (amount > 0 && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if (amount > 0 && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).fill(side, fluid, true);
|
||||
((IFluidHandler) tile).fill(ForgeDirection.getOrientation(side), fluid, true);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -99,79 +111,74 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
}
|
||||
|
||||
{
|
||||
int x = blockPos.getX();
|
||||
int y = blockPos.getY();
|
||||
int z = blockPos.getZ();
|
||||
|
||||
if (side.getIndex() == 0)
|
||||
if (side == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side.getIndex() == 1)
|
||||
if (side == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side.getIndex() == 2)
|
||||
if (side == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side.getIndex() == 3)
|
||||
if (side == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side.getIndex() == 4)
|
||||
if (side == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side.getIndex() == 5)
|
||||
if (side == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.func_175151_a(new BlockPos(x, y, z), side, stack))
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.canPlaceContainedLiquid(world, new BlockPos(x, y, z)) && BindableItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
if(this.canPlaceContainedLiquid(world, x, y, z, x, y, z) && EnergyItems.syphonBatteries(stack, player, getEnergyUsed()))
|
||||
{
|
||||
return this.func_180616_a(world, new BlockPos(x, y, z));
|
||||
return this.tryPlaceContainedLiquid(world, x, y, z, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Attempts to place the liquid contained inside the bucket.
|
||||
*/
|
||||
public boolean func_180616_a(World par1World, BlockPos blockPos)
|
||||
public boolean tryPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
{
|
||||
if (!par1World.isAirBlock(blockPos) && par1World.getBlockState(blockPos).getBlock().getMaterial().isSolid())
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlockState(blockPos).getBlock() == Blocks.lava || par1World.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && par1World.getBlockState(blockPos).getBlock().getMetaFromState(par1World.getBlockState(blockPos)) == 0)
|
||||
} else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
par1World.setBlockState(blockPos, this.isFull.getBlockState().getBaseState());
|
||||
par1World.setBlock(par8, par9, par10, this.isFull, 0, 3);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceContainedLiquid(World par1World, BlockPos blockPos)
|
||||
public boolean canPlaceContainedLiquid(World par1World, double par2, double par4, double par6, int par8, int par9, int par10)
|
||||
{
|
||||
if (!par1World.isAirBlock(blockPos) && par1World.getBlockState(blockPos).getBlock().getMaterial().isSolid())
|
||||
if (!par1World.isAirBlock(par8, par9, par10) && par1World.getBlock(par8, par9, par10).getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
} else if ((par1World.getBlockState(blockPos).getBlock() == Blocks.lava || par1World.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && par1World.getBlockState(blockPos).getBlock().getMetaFromState(par1World.getBlockState(blockPos)) == 0)
|
||||
} else if ((par1World.getBlock(par8, par9, par10) == Blocks.lava || par1World.getBlock(par8, par9, par10) == Blocks.flowing_lava) && par1World.getBlockMetadata(par8, par9, par10) == 0)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
|
@ -205,7 +212,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (stack.getItem() instanceof Orb && !usedBattery)
|
||||
if (stack.getItem() instanceof EnergyBattery && !usedBattery)
|
||||
{
|
||||
if (stack.getItemDamage() <= stack.getMaxDamage() - damageToBeDone)
|
||||
{
|
||||
|
@ -225,7 +232,7 @@ public class SigilLava extends ItemBucket implements ArmourUpgrade, ISigil
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true, false));
|
||||
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 9, true));
|
||||
player.extinguish();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,36 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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 java.util.List;
|
||||
|
||||
public class SigilOfElementalAffinity extends SigilToggleable implements ISigil
|
||||
public class SigilOfElementalAffinity extends EnergyItems implements ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfElementalAffinity()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(200);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +41,7 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -41,10 +53,51 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfTheFastMiner");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:ElementalSigil_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)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -55,14 +108,14 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||
} else
|
||||
{
|
||||
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
|
||||
|
@ -86,20 +139,20 @@ public class SigilOfElementalAffinity extends SigilToggleable implements ISigil
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3EntityPlayer.fallDistance = 0;
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,25 +3,36 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
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.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
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;
|
||||
|
||||
public class SigilOfEnderSeverance extends SigilToggleable implements IHolding, ISigil
|
||||
public class SigilOfEnderSeverance extends EnergyItems implements IHolding, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfEnderSeverance()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(200);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +42,7 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding,
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -43,10 +54,51 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSeverance_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)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -57,18 +109,18 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding,
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
tag.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -94,7 +146,7 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding,
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
List<Entity> list = SpellHelper.getEntitiesInRange(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ, 4.5, 4.5);
|
||||
for (Entity entity : list)
|
||||
|
@ -105,15 +157,17 @@ public class SigilOfEnderSeverance extends SigilToggleable implements IHolding,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -1,33 +1,43 @@
|
|||
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.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 100;
|
||||
|
||||
public SigilOfGrowth()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(150);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,7 +48,7 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -51,17 +61,58 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
if (BindableItems.checkAndSetItemOwner(stack, playerIn))
|
||||
{
|
||||
if (applyBonemeal(stack, worldIn, pos, playerIn))
|
||||
{
|
||||
BindableItems.syphonBatteries(stack, playerIn, getEnergyUsed());
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:GrowthSigil_deactivated");
|
||||
}
|
||||
|
||||
if (worldIn.isRemote)
|
||||
@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 boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer))
|
||||
{
|
||||
if (applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer))
|
||||
{
|
||||
EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
|
||||
|
||||
if (par3World.isRemote)
|
||||
{
|
||||
worldIn.playAuxSFX(2005, pos, 0);
|
||||
par3World.playAuxSFX(2005, par4, par5, par6, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -74,7 +125,7 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -92,7 +143,7 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (tag.getBoolean("isActive") && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
|
@ -117,13 +168,13 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
int range = 3;
|
||||
|
@ -138,13 +189,14 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
IBlockState block = par2World.getBlockState(new BlockPos(ix, iy, iz));
|
||||
Block block = par2World.getBlock(ix, iy, iz);
|
||||
|
||||
|
||||
if (block instanceof IPlantable || block instanceof IGrowable)
|
||||
{
|
||||
if (par2World.rand.nextInt(50) == 0)
|
||||
{
|
||||
block.getBlock().updateTick(par2World, new BlockPos(ix, iy, iz), block, par2World.rand);
|
||||
block.updateTick(par2World, ix, iy, iz, par2World.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,17 +205,17 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack p_179234_0_, World world, BlockPos blockPos, EntityPlayer player)
|
||||
public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player)
|
||||
{
|
||||
IBlockState block = world.getBlockState(blockPos);
|
||||
Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_);
|
||||
|
||||
BonemealEvent event = new BonemealEvent(player, world, blockPos, block);
|
||||
BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getResult() == Event.Result.ALLOW)
|
||||
if (event.getResult() == Result.ALLOW)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -172,14 +224,16 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
{
|
||||
IGrowable igrowable = (IGrowable) block;
|
||||
|
||||
if (igrowable.isStillGrowing(world, blockPos, block, world.isRemote))
|
||||
if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote))
|
||||
{
|
||||
if (!world.isRemote)
|
||||
if (!p_150919_1_.isRemote)
|
||||
{
|
||||
if (igrowable.canUseBonemeal(world, world.rand, blockPos, block))
|
||||
if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_))
|
||||
{
|
||||
igrowable.grow(world, world.rand, blockPos, block);
|
||||
igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -209,13 +263,13 @@ public class SigilOfGrowth extends SigilToggleable implements ArmourUpgrade, ISi
|
|||
{
|
||||
for (int iy = posY - verticalRange; iy <= posY + verticalRange; iy++)
|
||||
{
|
||||
IBlockState block = world.getBlockState(new BlockPos(ix, iy, iz));
|
||||
Block block = world.getBlock(ix, iy, iz);
|
||||
|
||||
if (block instanceof IPlantable)
|
||||
{
|
||||
if (world.rand.nextInt(100) == 0)
|
||||
{
|
||||
block.getBlock().updateTick(world, new BlockPos(ix, iy, iz), block, world.rand);
|
||||
block.updateTick(world, ix, iy, iz, world.rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,23 +3,34 @@ 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.BindableItems;
|
||||
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 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;
|
||||
|
||||
public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
public class SigilOfHaste extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
|
||||
public SigilOfHaste()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(250);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +40,7 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -41,10 +52,51 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:HasteSigil_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)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -55,9 +107,9 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
|
||||
|
@ -85,18 +137,18 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true, false));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1));
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +162,7 @@ public class SigilOfHaste extends SigilToggleable implements ArmourUpgrade, ISig
|
|||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true, false));
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionBoost.id, 3, 1, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,7 @@ 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.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
|
@ -10,20 +11,30 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
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.IHolding;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade, IHolding, ISigil
|
||||
public class SigilOfMagnetism extends EnergyItems implements ArmourUpgrade, IHolding, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 300;
|
||||
|
||||
public SigilOfMagnetism()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(50);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,7 +44,7 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade,
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -45,10 +56,51 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfMagnetism_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)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -59,9 +111,9 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
|
@ -88,13 +140,13 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade,
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,8 +155,8 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade,
|
|||
float posX = Math.round(par3Entity.posX);
|
||||
float posY = (float) (par3Entity.posY - par3Entity.getEyeHeight());
|
||||
float posZ = Math.round(par3Entity.posZ);
|
||||
List<EntityItem> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityItem> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
|
||||
for (EntityItem entity : entities)
|
||||
{
|
||||
|
@ -132,8 +184,8 @@ public class SigilOfMagnetism extends SigilToggleable implements ArmourUpgrade,
|
|||
float posX = Math.round(player.posX);
|
||||
float posY = (float) (player.posY - player.getEyeHeight());
|
||||
float posZ = Math.round(player.posZ);
|
||||
List<EntityItem> entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityItem> entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
List<EntityXPOrb> xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range));
|
||||
|
||||
for (EntityItem entity : entities)
|
||||
{
|
||||
|
|
|
@ -1,32 +1,42 @@
|
|||
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.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
public class SigilOfSupression extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int radius = 5;
|
||||
private int refresh = 100;
|
||||
|
||||
public SigilOfSupression()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(400);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,7 +46,7 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -48,12 +58,53 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_deactivated");
|
||||
activeIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_activated");
|
||||
passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfSupression_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 activeIcon;
|
||||
} else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (par1 == 1)
|
||||
{
|
||||
return activeIcon;
|
||||
} else
|
||||
{
|
||||
return passiveIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
int tickDelay = 200;
|
||||
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -69,18 +120,18 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (tag.getBoolean("isActive"))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
tag.setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -111,9 +162,9 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack) && (!par2World.isRemote))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive") && (!par2World.isRemote))
|
||||
{
|
||||
Vec3 blockVec = new Vec3((int) Math.round(par3EntityPlayer.posX - 0.5F), par3EntityPlayer.posY, (int) Math.round(par3EntityPlayer.posZ - 0.5F));
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(par3EntityPlayer);
|
||||
int x = (int) blockVec.xCoord;
|
||||
int y = (int) blockVec.yCoord;
|
||||
int z = (int) blockVec.zCoord;
|
||||
|
@ -129,19 +180,18 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
continue;
|
||||
}
|
||||
|
||||
BlockPos blockPos = new BlockPos(x + i, y + j, z + k);
|
||||
IBlockState block = par2World.getBlockState(blockPos);
|
||||
Block block = par2World.getBlock(x + i, y + j, z + k);
|
||||
|
||||
if (SpellHelper.isBlockFluid(block.getBlock()))
|
||||
if (SpellHelper.isBlockFluid(block))
|
||||
{
|
||||
if (par2World.getTileEntity(blockPos) != null)
|
||||
if (par2World.getTileEntity(x + i, y + j, z + k) != null)
|
||||
{
|
||||
par2World.setBlockToAir(blockPos);
|
||||
par2World.setBlockToAir(x + i, y + j, z + k);
|
||||
}
|
||||
TESpectralContainer.createSpectralBlockAtLocation(par2World, blockPos, refresh);
|
||||
TESpectralContainer.createSpectralBlockAtLocation(par2World, x + i, y + j, z + k, refresh);
|
||||
} else
|
||||
{
|
||||
TileEntity tile = par2World.getTileEntity(blockPos);
|
||||
TileEntity tile = par2World.getTileEntity(x + i, y + j, z + k);
|
||||
if (tile instanceof TESpectralContainer)
|
||||
{
|
||||
((TESpectralContainer) tile).resetDuration(refresh);
|
||||
|
@ -152,13 +202,13 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
|
||||
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
if(!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +217,7 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
Vec3 blockVec = new Vec3((int) Math.round(player.posX - 0.5F), player.posY, (int) Math.round(player.posZ - 0.5F));
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
|
||||
int x = (int) blockVec.xCoord;
|
||||
int y = (int) blockVec.yCoord;
|
||||
int z = (int) blockVec.zCoord;
|
||||
|
@ -183,19 +233,19 @@ public class SigilOfSupression extends SigilToggleable implements ArmourUpgrade,
|
|||
continue;
|
||||
}
|
||||
|
||||
BlockPos blockPos = new BlockPos(x + i, y + j, z + k);
|
||||
IBlockState block = world.getBlockState(blockPos);
|
||||
Block block = world.getBlock(x + i, y + j, z + k);
|
||||
|
||||
if (SpellHelper.isBlockFluid(block.getBlock()))
|
||||
|
||||
if (SpellHelper.isBlockFluid(block))
|
||||
{
|
||||
if (world.getTileEntity(blockPos) != null)
|
||||
if (world.getTileEntity(x + i, y + j, z + k) != null)
|
||||
{
|
||||
world.setBlockToAir(blockPos);
|
||||
world.setBlockToAir(x + i, y + j, z + k);
|
||||
}
|
||||
TESpectralContainer.createSpectralBlockAtLocation(world, blockPos, refresh);
|
||||
TESpectralContainer.createSpectralBlockAtLocation(world, x + i, y + j, z + k, refresh);
|
||||
} else
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
TileEntity tile = world.getTileEntity(x + i, y + j, z + k);
|
||||
if (tile instanceof TESpectralContainer)
|
||||
{
|
||||
((TESpectralContainer) tile).resetDuration(refresh);
|
||||
|
|
|
@ -3,30 +3,39 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.Block;
|
||||
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.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade, ISigil
|
||||
public class SigilOfTheAssassin extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
public SigilOfTheAssassin()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,6 +47,13 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:WaterSigil");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
|
@ -58,16 +74,17 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* 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 (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float f = 10.0F;
|
||||
|
||||
|
@ -91,6 +108,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
if(hitEntity instanceof EntityLivingBase)
|
||||
{
|
||||
AlchemicalWizardry.logger.info("It's a living entity!");
|
||||
|
||||
|
||||
teleportTo(par3EntityPlayer, x, y, z, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ);
|
||||
}
|
||||
|
@ -117,18 +135,17 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
int i = MathHelper.floor_double(entityLiving.posX);
|
||||
int j = MathHelper.floor_double(entityLiving.posY);
|
||||
int k = MathHelper.floor_double(entityLiving.posZ);
|
||||
BlockPos blockPos = new BlockPos(i, j, k);
|
||||
IBlockState l;
|
||||
Block l;
|
||||
|
||||
if (!entityLiving.worldObj.isAirBlock(blockPos))
|
||||
if (entityLiving.worldObj.blockExists(i, j, k))
|
||||
{
|
||||
boolean flag1 = false;
|
||||
|
||||
while (!flag1 && j > 0)
|
||||
{
|
||||
l = entityLiving.worldObj.getBlockState(blockPos);
|
||||
l = entityLiving.worldObj.getBlock(i, j - 1, k);
|
||||
|
||||
if (l != null && l.getBlock().getMaterial().blocksMovement())
|
||||
if (l != null && l.getMaterial().blocksMovement())
|
||||
{
|
||||
flag1 = true;
|
||||
} else
|
||||
|
@ -142,7 +159,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
{
|
||||
SpellTeleport.moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ);
|
||||
|
||||
if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.getBoundingBox()).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.getBoundingBox()))
|
||||
if (entityLiving.worldObj.getCollidingBoundingBoxes(entityLiving, entityLiving.boundingBox).isEmpty() && !entityLiving.worldObj.isAnyLiquid(entityLiving.boundingBox))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
@ -166,7 +183,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height;
|
||||
double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, (double) f, (double) f1, (double) f2);
|
||||
entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -180,7 +197,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)f;
|
||||
double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)f + (double)(p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences
|
||||
double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)f;
|
||||
Vec3 vec3 = new Vec3(d0, d1, d2);
|
||||
Vec3 vec3 = SpellHelper.createVec3(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
|
@ -188,12 +205,12 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = 500.0D;
|
||||
// if (p_77621_2_ instanceof EntityPlayerMP)
|
||||
if (p_77621_2_ instanceof EntityPlayerMP)
|
||||
{
|
||||
// d3 = ((EntityPlayerMP)p_77621_2_).theItemInWorldManager.getBlockReachDistance();
|
||||
}
|
||||
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
|
||||
return p_77621_1_.rayTraceBlocks(vec3, vec31, p_77621_3_, !p_77621_3_, false);
|
||||
return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false);
|
||||
}
|
||||
|
||||
// public MovingObjectPosition movingObjectPositiongdsa(WOrld worldObj, int posX, int posY, int posZ)
|
||||
|
@ -252,7 +269,7 @@ public class SigilOfTheAssassin extends BindableItems implements ArmourUpgrade,
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true, false));
|
||||
player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 9, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,30 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ISigil;
|
||||
import WayofTime.alchemicalWizardry.common.items.BindableItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade, ISigil
|
||||
public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade, ISigil
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon passiveIcon;
|
||||
private int tickDelay = 200;
|
||||
|
||||
public SigilOfTheBridge()
|
||||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +45,7 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
|
||||
if (!(par1ItemStack.getTagCompound() == null))
|
||||
{
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
|
||||
} else
|
||||
|
@ -47,10 +57,51 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_deactivated");
|
||||
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_activated");
|
||||
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:BridgeSigil_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)
|
||||
{
|
||||
if (!BindableItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
@ -61,9 +112,9 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
|
||||
NBTTagCompound tag = par1ItemStack.getTagCompound();
|
||||
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
|
||||
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
|
||||
|
||||
if (this.getActivated(par1ItemStack) && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
if (tag.getBoolean("isActive") && EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
|
||||
{
|
||||
par1ItemStack.setItemDamage(1);
|
||||
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
|
||||
|
@ -90,16 +141,16 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.getActivated(par1ItemStack))
|
||||
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
|
||||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
|
||||
{
|
||||
if(BindableItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack)))
|
||||
if(EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer) par3Entity, this.getLPUsed(par1ItemStack)))
|
||||
{
|
||||
this.setLPUsed(par1ItemStack, 0);
|
||||
}else
|
||||
{
|
||||
this.setActivated(par1ItemStack, false);
|
||||
par1ItemStack.getTagCompound().setBoolean("isActive", false);
|
||||
}
|
||||
}
|
||||
if (!par3EntityPlayer.onGround && !par3EntityPlayer.isSneaking())
|
||||
|
@ -130,13 +181,13 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
for (int iz = posZ - range; iz <= posZ + range; iz++)
|
||||
{
|
||||
{
|
||||
IBlockState block = par2World.getBlockState(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
Block block = par2World.getBlock(ix, posY + verticalOffset, iz);
|
||||
|
||||
if (par2World.isAirBlock(new BlockPos(ix, posY + verticalOffset, iz)))
|
||||
if (par2World.isAirBlock(ix, posY + verticalOffset, iz))
|
||||
{
|
||||
par2World.setBlockState(new BlockPos(ix, posY + verticalOffset, iz), ModBlocks.spectralBlock.getDefaultState(), 3);
|
||||
par2World.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3);
|
||||
|
||||
TileEntity tile = par2World.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
|
@ -148,7 +199,7 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
} else if (block == ModBlocks.spectralBlock)
|
||||
{
|
||||
TileEntity tile = par2World.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
|
@ -201,7 +252,7 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
}
|
||||
|
||||
int range = 2;
|
||||
int verticalOffset = -1;
|
||||
int verticalOffset = -2;
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
|
@ -215,20 +266,20 @@ public class SigilOfTheBridge extends SigilToggleable implements ArmourUpgrade,
|
|||
{
|
||||
for (int iz = posZ - range; iz <= posZ + range; iz++)
|
||||
{
|
||||
IBlockState block = world.getBlockState(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
Block block = world.getBlock(ix, posY + verticalOffset, iz);
|
||||
|
||||
if (world.isAirBlock(new BlockPos(ix, posY + verticalOffset, iz)))
|
||||
if (world.isAirBlock(ix, posY + verticalOffset, iz))
|
||||
{
|
||||
world.setBlockState(new BlockPos(ix, posY + verticalOffset, iz), ModBlocks.spectralBlock.getDefaultState(), 3);
|
||||
world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3);
|
||||
|
||||
TileEntity tile = world.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
}
|
||||
} else if (block == ModBlocks.spectralBlock)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(new BlockPos(ix, posY + verticalOffset, iz));
|
||||
TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if (tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue