Finished all porting

This commit is contained in:
Arcaratus committed 2015-07-31 11:35:05 -04:00
1 parent 93e5e6cca6
commit d528bdbbf8
30 files changed
+393 -1045

No files matched your search

@@ -1,36 +1,24 @@
package WayofTime.alchemicalWizardry.common.items.sigil;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
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.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 BindableItems implements ISigil
public class SigilOfElementalAffinity extends SigilToggleable 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
@@ -41,7 +29,7 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
if (!(par1ItemStack.getTagCompound() == null))
{
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
if (this.getActivated(par1ItemStack))
{
par3List.add(StatCollector.translateToLocal("tooltip.sigil.state.activated"));
} else
@@ -53,47 +41,6 @@ public class SigilOfElementalAffinity extends BindableItems 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)
{
@@ -108,14 +55,14 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
}
NBTTagCompound tag = par1ItemStack.getTagCompound();
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
this.setActivated(par1ItemStack, !(this.getActivated(par1ItemStack)));
if (tag.getBoolean("isActive") && BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
if (this.getActivated(par1ItemStack) && BindableItems.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));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false));
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@@ -139,20 +86,20 @@ public class SigilOfElementalAffinity extends BindableItems implements ISigil
par1ItemStack.setTagCompound(new NBTTagCompound());
}
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
if (this.getActivated(par1ItemStack))
{
par3EntityPlayer.fallDistance = 0;
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 2, 0, true, false));
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2, 0, true, false));
}
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par1ItemStack.getTagCompound().getBoolean("isActive"))
if (par2World.getWorldTime() % 200 == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && this.getActivated(par1ItemStack))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if (!BindableItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed()))
{
par1ItemStack.getTagCompound().setBoolean("isActive", false);
this.setActivated(par1ItemStack, false);
}
}
}