mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-27 23:33:20 +00:00
SA
This commit is contained in:
1 parent
29b6a51d03
commit
32dc71f8b3
68 files changed
+5635
-5587
No files matched your search
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
@@ -19,55 +20,51 @@ import thaumcraft.common.lib.research.ResearchManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMagicFunguar extends ItemFood
|
||||
{
|
||||
Aspect[] aspects = new Aspect[]{
|
||||
Aspect.AIR,
|
||||
Aspect.EARTH,
|
||||
Aspect.FIRE,
|
||||
Aspect.WATER,
|
||||
Aspect.ORDER,
|
||||
Aspect.ENTROPY };
|
||||
public class ItemMagicFunguar extends ItemFood {
|
||||
|
||||
public ItemMagicFunguar (int i, float j, boolean k)
|
||||
{
|
||||
super(i, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemMagicFunguar");
|
||||
this.setAlwaysEdible();
|
||||
this.setUnlocalizedName("ItemMagicFunguar");
|
||||
}
|
||||
Aspect[] aspects = new Aspect[] { Aspect.AIR, Aspect.EARTH, Aspect.FIRE, Aspect.WATER, Aspect.ORDER,
|
||||
Aspect.ENTROPY };
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (ItemStack s, World w, EntityPlayer p)
|
||||
{
|
||||
super.onFoodEaten(s, w, p);
|
||||
public ItemMagicFunguar(int i, float j, boolean k) {
|
||||
super(i, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemMagicFunguar");
|
||||
this.setAlwaysEdible();
|
||||
this.setUnlocalizedName("ItemMagicFunguar");
|
||||
}
|
||||
|
||||
Random r = new Random();
|
||||
try
|
||||
{
|
||||
p.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 2));
|
||||
p.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 100, 2));
|
||||
p.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 2));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
@Override
|
||||
protected void onFoodEaten(ItemStack s, World w, EntityPlayer p) {
|
||||
super.onFoodEaten(s, w, p);
|
||||
|
||||
int i = r.nextInt(aspects.length);
|
||||
Random r = new Random();
|
||||
try {
|
||||
p.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 2));
|
||||
p.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 100, 2));
|
||||
p.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 2));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (!w.isRemote)
|
||||
{
|
||||
Thaumcraft.proxy.playerKnowledge.addAspectPool(p.getCommandSenderName(), aspects[i], Short.valueOf((short) (1)));
|
||||
ResearchManager.scheduleSave(p);
|
||||
PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspects[i].getTag(), Short.valueOf((short) 1), Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(p.getCommandSenderName(), aspects[i]))), (EntityPlayerMP) p);
|
||||
}
|
||||
}
|
||||
int i = r.nextInt(aspects.length);
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (ItemStack itemstack)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
if (!w.isRemote) {
|
||||
Thaumcraft.proxy.playerKnowledge
|
||||
.addAspectPool(p.getCommandSenderName(), aspects[i], Short.valueOf((short) (1)));
|
||||
ResearchManager.scheduleSave(p);
|
||||
PacketHandler.INSTANCE.sendTo(
|
||||
new PacketAspectPool(
|
||||
aspects[i].getTag(),
|
||||
Short.valueOf((short) 1),
|
||||
Short.valueOf(
|
||||
Thaumcraft.proxy.playerKnowledge
|
||||
.getAspectPoolFor(p.getCommandSenderName(), aspects[i]))),
|
||||
(EntityPlayerMP) p);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack itemstack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -2,85 +2,73 @@ package taintedmagic.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMaterial extends Item
|
||||
{
|
||||
public int SUBTYPES = 9;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
public class ItemMaterial extends Item {
|
||||
|
||||
public ItemMaterial ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemMaterial");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
public int SUBTYPES = 9;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
int m = s.getItemDamage();
|
||||
switch (m)
|
||||
{
|
||||
case 0 :
|
||||
return EnumRarity.uncommon;
|
||||
case 1 :
|
||||
return EnumRarity.uncommon;
|
||||
case 2 :
|
||||
return EnumRarity.uncommon;
|
||||
case 3 :
|
||||
return EnumRarity.common;
|
||||
case 4 :
|
||||
return EnumRarity.common;
|
||||
case 5 :
|
||||
return TaintedMagic.rarityCreation;
|
||||
case 6 :
|
||||
return EnumRarity.uncommon;
|
||||
case 7 :
|
||||
return EnumRarity.uncommon;
|
||||
case 8 :
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
return EnumRarity.common;
|
||||
}
|
||||
public ItemMaterial() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemMaterial");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
this.icons[i] = ir.registerIcon("taintedmagic:ItemMaterial" + i);
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
int m = s.getItemDamage();
|
||||
switch (m) {
|
||||
case 0:
|
||||
return EnumRarity.uncommon;
|
||||
case 1:
|
||||
return EnumRarity.uncommon;
|
||||
case 2:
|
||||
return EnumRarity.uncommon;
|
||||
case 3:
|
||||
return EnumRarity.common;
|
||||
case 4:
|
||||
return EnumRarity.common;
|
||||
case 5:
|
||||
return TaintedMagic.rarityCreation;
|
||||
case 6:
|
||||
return EnumRarity.uncommon;
|
||||
case 7:
|
||||
return EnumRarity.uncommon;
|
||||
case 8:
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
return EnumRarity.common;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int i)
|
||||
{
|
||||
return this.icons[i];
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) this.icons[i] = ir.registerIcon("taintedmagic:ItemMaterial" + i);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (Item item, CreativeTabs c, List l)
|
||||
{
|
||||
/**
|
||||
* 0: Shadowmetal 1: Shadow Cloth 2: Crimson Cloth 3: Warped Shard 4:
|
||||
* Fluxed Shard 5: Creation Shard 6: Thaumic Alloy 7: Crystal Blood 8:
|
||||
* Crimson Plating
|
||||
*/
|
||||
for (int i = 0; i < SUBTYPES; i++)
|
||||
l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int i) {
|
||||
return this.icons[i];
|
||||
}
|
||||
|
||||
public String getUnlocalizedName (ItemStack s)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs c, List l) {
|
||||
/**
|
||||
* 0: Shadowmetal 1: Shadow Cloth 2: Crimson Cloth 3: Warped Shard 4: Fluxed Shard 5: Creation Shard 6: Thaumic
|
||||
* Alloy 7: Crystal Blood 8: Crimson Plating
|
||||
*/
|
||||
for (int i = 0; i < SUBTYPES; i++) l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack s) {
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,30 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import taintedmagic.api.RecipeVoidsentBlood;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidsentBlood extends Item
|
||||
{
|
||||
public ItemVoidsentBlood ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemVoidsentBlood");
|
||||
this.setUnlocalizedName("ItemVoidsentBlood");
|
||||
public class ItemVoidsentBlood extends Item {
|
||||
|
||||
GameRegistry.addRecipe(new RecipeVoidsentBlood());
|
||||
RecipeSorter.register("taintedmagic:ItemVoidsentBlood", RecipeVoidsentBlood.class, Category.SHAPELESS, "");
|
||||
}
|
||||
public ItemVoidsentBlood() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemVoidsentBlood");
|
||||
this.setUnlocalizedName("ItemVoidsentBlood");
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
GameRegistry.addRecipe(new RecipeVoidsentBlood());
|
||||
RecipeSorter.register("taintedmagic:ItemVoidsentBlood", RecipeVoidsentBlood.class, Category.SHAPELESS, "");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -4,19 +4,18 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBlockShadowOre extends ItemBlock
|
||||
{
|
||||
public ItemBlockShadowOre (Block b)
|
||||
{
|
||||
super(b);
|
||||
}
|
||||
public class ItemBlockShadowOre extends ItemBlock {
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public ItemBlockShadowOre(Block b) {
|
||||
super(b);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,21 @@
|
||||
package taintedmagic.common.items.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemBlockWarpwoodSapling extends ItemBlock
|
||||
{
|
||||
public ItemBlockWarpwoodSapling (Block b)
|
||||
{
|
||||
super(b);
|
||||
}
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public class ItemBlockWarpwoodSapling extends ItemBlock {
|
||||
|
||||
public ItemBlockWarpwoodSapling(Block b) {
|
||||
super(b);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.items.equipment;
|
||||
|
||||
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.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -14,113 +12,102 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.ItemApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.items.armor.ItemFortressArmor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemShadowFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear, ISpecialArmor
|
||||
{
|
||||
public ItemShadowFortressArmor (ArmorMaterial m, int j, int k)
|
||||
{
|
||||
super(m, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
}
|
||||
public class ItemShadowFortressArmor extends ItemFortressArmor
|
||||
implements IWarpingGear, IVisDiscountGear, ISpecialArmor {
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.iconHelm = ir.registerIcon("taintedmagic:ItemShadowFortressHelmet");
|
||||
this.iconChest = ir.registerIcon("taintedmagic:ItemShadowFortressChestplate");
|
||||
this.iconLegs = ir.registerIcon("taintedmagic:ItemShadowFortressLeggings");
|
||||
}
|
||||
public ItemShadowFortressArmor(ArmorMaterial m, int j, int k) {
|
||||
super(m, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
}
|
||||
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
l.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + getVisDiscount(s, p, null) + "%");
|
||||
super.addInformation(s, p, l, b);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.iconHelm = ir.registerIcon("taintedmagic:ItemShadowFortressHelmet");
|
||||
this.iconChest = ir.registerIcon("taintedmagic:ItemShadowFortressChestplate");
|
||||
this.iconLegs = ir.registerIcon("taintedmagic:ItemShadowFortressLeggings");
|
||||
}
|
||||
|
||||
public String getArmorTexture (ItemStack s, Entity e, int slot, String t)
|
||||
{
|
||||
return "taintedmagic:textures/models/ModelShadowFortressArmor.png";
|
||||
}
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
l.add(
|
||||
EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount")
|
||||
+ ": "
|
||||
+ getVisDiscount(s, p, null)
|
||||
+ "%");
|
||||
super.addInformation(s, p, l, b);
|
||||
}
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
public String getArmorTexture(ItemStack s, Entity e, int slot, String t) {
|
||||
return "taintedmagic:textures/models/ModelShadowFortressArmor.png";
|
||||
}
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack s, EntityPlayer p, Aspect a) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase p, ItemStack s, DamageSource source, double dmg, int slot)
|
||||
{
|
||||
int priority = 0;
|
||||
double ratio = this.damageReduceAmount / 25.0D;
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
if (source.isMagicDamage() == true)
|
||||
{
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 35.0D;
|
||||
}
|
||||
else if ( (source.isFireDamage() == true) || (source.isExplosion()))
|
||||
{
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 20.0D;
|
||||
}
|
||||
else if (source.isUnblockable())
|
||||
{
|
||||
priority = 0;
|
||||
ratio = 0.0D;
|
||||
}
|
||||
@Override
|
||||
public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase p, ItemStack s, DamageSource source, double dmg,
|
||||
int slot) {
|
||||
int priority = 0;
|
||||
double ratio = this.damageReduceAmount / 25.0D;
|
||||
|
||||
if ( (p instanceof EntityPlayer))
|
||||
{
|
||||
double set = 0.875D;
|
||||
for (int a = 1; a < 4; a++)
|
||||
{
|
||||
ItemStack piece = ((EntityPlayer) p).inventory.armorInventory[a];
|
||||
if ( (piece != null) && ( (piece.getItem() instanceof ItemFortressArmor)))
|
||||
{
|
||||
set += 0.250D;
|
||||
if ( (piece.hasTagCompound()) && (piece.stackTagCompound.hasKey("mask")))
|
||||
{
|
||||
set += 0.05D;
|
||||
}
|
||||
}
|
||||
}
|
||||
ratio *= set;
|
||||
}
|
||||
if (source.isMagicDamage() == true) {
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 35.0D;
|
||||
} else if ((source.isFireDamage() == true) || (source.isExplosion())) {
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 20.0D;
|
||||
} else if (source.isUnblockable()) {
|
||||
priority = 0;
|
||||
ratio = 0.0D;
|
||||
}
|
||||
|
||||
return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage());
|
||||
}
|
||||
if ((p instanceof EntityPlayer)) {
|
||||
double set = 0.875D;
|
||||
for (int a = 1; a < 4; a++) {
|
||||
ItemStack piece = ((EntityPlayer) p).inventory.armorInventory[a];
|
||||
if ((piece != null) && ((piece.getItem() instanceof ItemFortressArmor))) {
|
||||
set += 0.250D;
|
||||
if ((piece.hasTagCompound()) && (piece.stackTagCompound.hasKey("mask"))) {
|
||||
set += 0.05D;
|
||||
}
|
||||
}
|
||||
}
|
||||
ratio *= set;
|
||||
}
|
||||
|
||||
public int getArmorDisplay (EntityPlayer p, ItemStack s, int slot)
|
||||
{
|
||||
return this.damageReduceAmount;
|
||||
}
|
||||
return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage());
|
||||
}
|
||||
|
||||
public void damageArmor (EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot)
|
||||
{
|
||||
if (source != DamageSource.fall) s.damageItem(dmg, e);
|
||||
}
|
||||
}
|
||||
public int getArmorDisplay(EntityPlayer p, ItemStack s, int slot) {
|
||||
return this.damageReduceAmount;
|
||||
}
|
||||
|
||||
public void damageArmor(EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) {
|
||||
if (source != DamageSource.fall) s.damageItem(dmg, e);
|
||||
}
|
||||
}
|
||||
@@ -2,81 +2,75 @@ package taintedmagic.common.items.equipment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.ItemApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.items.armor.ItemFortressArmor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.items.armor.ItemFortressArmor;
|
||||
|
||||
public class ItemVoidFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear
|
||||
{
|
||||
public ItemVoidFortressArmor (ArmorMaterial m, int j, int k)
|
||||
{
|
||||
super(m, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
}
|
||||
public class ItemVoidFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear {
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.iconHelm = ir.registerIcon("taintedmagic:ItemVoidFortressHelmet");
|
||||
this.iconChest = ir.registerIcon("taintedmagic:ItemVoidFortressChestplate");
|
||||
this.iconLegs = ir.registerIcon("taintedmagic:ItemVoidFortressLeggings");
|
||||
}
|
||||
public ItemVoidFortressArmor(ArmorMaterial m, int j, int k) {
|
||||
super(m, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
}
|
||||
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
l.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + getVisDiscount(s, p, null) + "%");
|
||||
super.addInformation(s, p, l, b);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.iconHelm = ir.registerIcon("taintedmagic:ItemVoidFortressHelmet");
|
||||
this.iconChest = ir.registerIcon("taintedmagic:ItemVoidFortressChestplate");
|
||||
this.iconLegs = ir.registerIcon("taintedmagic:ItemVoidFortressLeggings");
|
||||
}
|
||||
|
||||
public String getArmorTexture (ItemStack s, Entity e, int slot, String t)
|
||||
{
|
||||
return "taintedmagic:textures/models/ModelVoidFortressArmor.png";
|
||||
}
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
l.add(
|
||||
EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount")
|
||||
+ ": "
|
||||
+ getVisDiscount(s, p, null)
|
||||
+ "%");
|
||||
super.addInformation(s, p, l, b);
|
||||
}
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return s2.isItemEqual(ItemApi.getItem("itemResource", 16)) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public String getArmorTexture(ItemStack s, Entity e, int slot, String t) {
|
||||
return "taintedmagic:textures/models/ModelVoidFortressArmor.png";
|
||||
}
|
||||
|
||||
public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k)
|
||||
{
|
||||
super.onUpdate(s, w, e, j, k);
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return s2.isItemEqual(ItemApi.getItem("itemResource", 16)) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ( (e instanceof EntityLivingBase))) s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
public void onUpdate(ItemStack s, World w, Entity e, int j, boolean k) {
|
||||
super.onUpdate(s, w, e, j, k);
|
||||
|
||||
public void onArmorTick (World w, EntityPlayer p, ItemStack s)
|
||||
{
|
||||
super.onArmorTick(w, p, s);
|
||||
if ( (!w.isRemote) && (s.getItemDamage() > 0) && (p.ticksExisted % 20 == 0)) s.damageItem(-1, p);
|
||||
}
|
||||
if ((!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ((e instanceof EntityLivingBase)))
|
||||
s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
public void onArmorTick(World w, EntityPlayer p, ItemStack s) {
|
||||
super.onArmorTick(w, p, s);
|
||||
if ((!w.isRemote) && (s.getItemDamage() > 0) && (p.ticksExisted % 20 == 0)) s.damageItem(-1, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack s, EntityPlayer p, Aspect a) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -15,53 +16,46 @@ import thaumcraft.common.items.armor.ItemGoggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidmetalGoggles extends ItemGoggles implements IWarpingGear
|
||||
{
|
||||
public ItemVoidmetalGoggles (ArmorMaterial m, int j, int k)
|
||||
{
|
||||
super(m, j, k);
|
||||
this.setMaxDamage(250);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemVoidmetalGoggles");
|
||||
}
|
||||
public class ItemVoidmetalGoggles extends ItemGoggles implements IWarpingGear {
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles");
|
||||
}
|
||||
public ItemVoidmetalGoggles(ArmorMaterial m, int j, int k) {
|
||||
super(m, j, k);
|
||||
this.setMaxDamage(250);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemVoidmetalGoggles");
|
||||
}
|
||||
|
||||
public String getArmorTexture (ItemStack s, Entity e, int slot, String type)
|
||||
{
|
||||
return "taintedmagic:textures/models/ModelVoidmetalGoggles.png";
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles");
|
||||
}
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
public String getArmorTexture(ItemStack s, Entity e, int slot, String type) {
|
||||
return "taintedmagic:textures/models/ModelVoidmetalGoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k)
|
||||
{
|
||||
super.onUpdate(s, w, e, j, k);
|
||||
if (!w.isRemote && s.isItemDamaged() && e.ticksExisted % 20 == 0 && e instanceof EntityLivingBase) s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public void onArmorTick (World w, EntityPlayer p, ItemStack s)
|
||||
{
|
||||
super.onArmorTick(w, p, s);
|
||||
if (!w.isRemote && s.getItemDamage() > 0 && p.ticksExisted % 20 == 0) s.damageItem(-1, p);
|
||||
}
|
||||
public void onUpdate(ItemStack s, World w, Entity e, int j, boolean k) {
|
||||
super.onUpdate(s, w, e, j, k);
|
||||
if (!w.isRemote && s.isItemDamaged() && e.ticksExisted % 20 == 0 && e instanceof EntityLivingBase)
|
||||
s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
|
||||
public void onArmorTick(World w, EntityPlayer p, ItemStack s) {
|
||||
super.onArmorTick(w, p, s);
|
||||
if (!w.isRemote && s.getItemDamage() > 0 && p.ticksExisted % 20 == 0) s.damageItem(-1, p);
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
@@ -26,140 +25,116 @@ import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.armor.Hover;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemVoidwalkerBoots extends ItemArmor implements IVisDiscountGear, IWarpingGear, IRunicArmor, IRepairable, ISpecialArmor
|
||||
{
|
||||
public ItemVoidwalkerBoots (ArmorMaterial m, int j, int k)
|
||||
{
|
||||
super(m, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
this.setTextureName("taintedmagic:ItemVoidwalkerBoots");
|
||||
public class ItemVoidwalkerBoots extends ItemArmor
|
||||
implements IVisDiscountGear, IWarpingGear, IRunicArmor, IRepairable, ISpecialArmor {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
public ItemVoidwalkerBoots(ArmorMaterial m, int j, int k) {
|
||||
super(m, j, k);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
this.setTextureName("taintedmagic:ItemVoidwalkerBoots");
|
||||
|
||||
public String getArmorTexture (ItemStack s, Entity e, int slot, String t)
|
||||
{
|
||||
return "taintedmagic:textures/models/ModelVoidwalkerBoots.png";
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
public String getArmorTexture(ItemStack s, Entity e, int slot, String t) {
|
||||
return "taintedmagic:textures/models/ModelVoidwalkerBoots.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge (ItemStack s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack s) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase e, ItemStack s, DamageSource source, double dmg, int slot)
|
||||
{
|
||||
int priority = 0;
|
||||
double ratio = this.damageReduceAmount / 90.0D;
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack s, EntityPlayer p, Aspect a) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
if (source.isMagicDamage() == true)
|
||||
{
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 80.0D;
|
||||
}
|
||||
else if ( (source.isFireDamage() == true) || (source.isExplosion()))
|
||||
{
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 80.0D;
|
||||
}
|
||||
else if (source.isUnblockable())
|
||||
{
|
||||
priority = 0;
|
||||
ratio = 0.0D;
|
||||
}
|
||||
return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage());
|
||||
}
|
||||
@Override
|
||||
public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase e, ItemStack s, DamageSource source, double dmg,
|
||||
int slot) {
|
||||
int priority = 0;
|
||||
double ratio = this.damageReduceAmount / 90.0D;
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay (EntityPlayer p, ItemStack s, int slot)
|
||||
{
|
||||
return this.damageReduceAmount;
|
||||
}
|
||||
if (source.isMagicDamage() == true) {
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 80.0D;
|
||||
} else if ((source.isFireDamage() == true) || (source.isExplosion())) {
|
||||
priority = 1;
|
||||
ratio = this.damageReduceAmount / 80.0D;
|
||||
} else if (source.isUnblockable()) {
|
||||
priority = 0;
|
||||
ratio = 0.0D;
|
||||
}
|
||||
return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor (EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot)
|
||||
{
|
||||
if (source != DamageSource.fall) s.damageItem(dmg, e);
|
||||
}
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer p, ItemStack s, int slot) {
|
||||
return this.damageReduceAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) {
|
||||
if (source != DamageSource.fall) s.damageItem(dmg, e);
|
||||
}
|
||||
|
||||
public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k)
|
||||
{
|
||||
super.onUpdate(s, w, e, j, k);
|
||||
@Override
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {}
|
||||
|
||||
if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ( (e instanceof EntityLivingBase))) s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
public void onUpdate(ItemStack s, World w, Entity e, int j, boolean k) {
|
||||
super.onUpdate(s, w, e, j, k);
|
||||
|
||||
public void onArmorTick (World w, EntityPlayer p, ItemStack s)
|
||||
{
|
||||
super.onArmorTick(w, p, s);
|
||||
if ( (!w.isRemote) && (s.getItemDamage() > 0) && (p.ticksExisted % 20 == 0)) s.damageItem(-1, p);
|
||||
if ((!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ((e instanceof EntityLivingBase)))
|
||||
s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
|
||||
if (p.moveForward > 0.0F)
|
||||
{
|
||||
if ( (p.worldObj.isRemote) && (!p.isSneaking()))
|
||||
{
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(p.getEntityId())))
|
||||
{
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(p.getEntityId()), Float.valueOf(p.stepHeight));
|
||||
}
|
||||
p.stepHeight = 1.0F;
|
||||
}
|
||||
public void onArmorTick(World w, EntityPlayer p, ItemStack s) {
|
||||
super.onArmorTick(w, p, s);
|
||||
if ((!w.isRemote) && (s.getItemDamage() > 0) && (p.ticksExisted % 20 == 0)) s.damageItem(-1, p);
|
||||
|
||||
if (p.onGround || p.capabilities.isFlying)
|
||||
{
|
||||
float bonus = 0.20F;
|
||||
p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.075F) : bonus);
|
||||
p.jumpMovementFactor = 0.00002F;
|
||||
}
|
||||
else if (Hover.getHover(p.getEntityId()))
|
||||
{
|
||||
p.jumpMovementFactor = 0.03F;
|
||||
if (p.moveForward > 0.0F) {
|
||||
if ((p.worldObj.isRemote) && (!p.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(p.getEntityId()))) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep
|
||||
.put(Integer.valueOf(p.getEntityId()), Float.valueOf(p.stepHeight));
|
||||
}
|
||||
p.stepHeight = 1.0F;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
p.jumpMovementFactor = 0.05F;
|
||||
}
|
||||
}
|
||||
if (p.fallDistance > 0.0F) p.fallDistance = 0.0F;
|
||||
}
|
||||
if (p.onGround || p.capabilities.isFlying) {
|
||||
float bonus = 0.20F;
|
||||
p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.075F) : bonus);
|
||||
p.jumpMovementFactor = 0.00002F;
|
||||
} else if (Hover.getHover(p.getEntityId())) {
|
||||
p.jumpMovementFactor = 0.03F;
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerJumps (LivingEvent.LivingJumpEvent event)
|
||||
{
|
||||
if (event.entity instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entity;
|
||||
} else {
|
||||
p.jumpMovementFactor = 0.05F;
|
||||
}
|
||||
}
|
||||
if (p.fallDistance > 0.0F) p.fallDistance = 0.0F;
|
||||
}
|
||||
|
||||
if (player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == ItemRegistry.ItemVoidwalkerBoots)
|
||||
{
|
||||
event.entityLiving.motionY += 0.35D;
|
||||
}
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void playerJumps(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entity;
|
||||
|
||||
if (player.inventory.armorItemInSlot(0) != null
|
||||
&& player.inventory.armorItemInSlot(0).getItem() == ItemRegistry.ItemVoidwalkerBoots) {
|
||||
event.entityLiving.motionY += 0.35D;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
@@ -24,157 +23,132 @@ import baubles.api.IBauble;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpingGear, IBauble
|
||||
{
|
||||
public static final String TAG_MODE = "mode";
|
||||
public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpingGear, IBauble {
|
||||
|
||||
public ItemVoidwalkerSash ()
|
||||
{
|
||||
super(20);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemVoidwalkerSash");
|
||||
this.setMaxDamage(-1);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("ItemVoidwalkerSash");
|
||||
public static final String TAG_MODE = "mode";
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
public ItemVoidwalkerSash() {
|
||||
super(20);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemVoidwalkerSash");
|
||||
this.setMaxDamage(-1);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("ItemVoidwalkerSash");
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge (ItemStack s)
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEquip (ItemStack s, EntityLivingBase e)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack s) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUnequip (ItemStack s, EntityLivingBase e)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canEquip(ItemStack s, EntityLivingBase e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType (ItemStack s)
|
||||
{
|
||||
return BaubleType.BELT;
|
||||
}
|
||||
@Override
|
||||
public boolean canUnequip(ItemStack s, EntityLivingBase e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEquipped (ItemStack s, EntityLivingBase e)
|
||||
{
|
||||
Thaumcraft.instance.runicEventHandler.isDirty = true;
|
||||
}
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack s) {
|
||||
return BaubleType.BELT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnequipped (ItemStack s, EntityLivingBase e)
|
||||
{
|
||||
Thaumcraft.instance.runicEventHandler.isDirty = true;
|
||||
}
|
||||
@Override
|
||||
public void onEquipped(ItemStack s, EntityLivingBase e) {
|
||||
Thaumcraft.instance.runicEventHandler.isDirty = true;
|
||||
}
|
||||
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
l.add("\u00A78" + StatCollector.translateToLocal("text.sash.mode") + (hasSpeedBoost(s) ? " \u00A7a" : " \u00A7c") + StatCollector.translateToLocal(hasSpeedBoost(s) ? "text.sash.on" : "text.sash.off"));
|
||||
}
|
||||
@Override
|
||||
public void onUnequipped(ItemStack s, EntityLivingBase e) {
|
||||
Thaumcraft.instance.runicEventHandler.isDirty = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWornTick (ItemStack s, EntityLivingBase e)
|
||||
{
|
||||
EntityPlayer p = (EntityPlayer) e;
|
||||
if ( (p.inventory.armorItemInSlot(0) != null) && (p.inventory.armorItemInSlot(0).getItem() instanceof ItemVoidwalkerBoots))
|
||||
{
|
||||
if (hasSpeedBoost(s))
|
||||
{
|
||||
if (p.moveForward > 0.0F)
|
||||
{
|
||||
if ( (p.worldObj.isRemote) && (!p.isSneaking()))
|
||||
{
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(p.getEntityId())))
|
||||
{
|
||||
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(p.getEntityId()), Float.valueOf(p.stepHeight));
|
||||
}
|
||||
p.stepHeight = 1.0F;
|
||||
}
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
l.add(
|
||||
"\u00A78" + StatCollector.translateToLocal("text.sash.mode")
|
||||
+ (hasSpeedBoost(s) ? " \u00A7a" : " \u00A7c")
|
||||
+ StatCollector.translateToLocal(hasSpeedBoost(s) ? "text.sash.on" : "text.sash.off"));
|
||||
}
|
||||
|
||||
if (p.onGround || p.capabilities.isFlying)
|
||||
{
|
||||
float bonus = 0.4F;
|
||||
p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.050F) : bonus);
|
||||
}
|
||||
else if (Hover.getHover(p.getEntityId()))
|
||||
{
|
||||
p.jumpMovementFactor = 0.015F;
|
||||
@Override
|
||||
public void onWornTick(ItemStack s, EntityLivingBase e) {
|
||||
EntityPlayer p = (EntityPlayer) e;
|
||||
if ((p.inventory.armorItemInSlot(0) != null)
|
||||
&& (p.inventory.armorItemInSlot(0).getItem() instanceof ItemVoidwalkerBoots)) {
|
||||
if (hasSpeedBoost(s)) {
|
||||
if (p.moveForward > 0.0F) {
|
||||
if ((p.worldObj.isRemote) && (!p.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep
|
||||
.containsKey(Integer.valueOf(p.getEntityId()))) {
|
||||
Thaumcraft.instance.entityEventHandler.prevStep
|
||||
.put(Integer.valueOf(p.getEntityId()), Float.valueOf(p.stepHeight));
|
||||
}
|
||||
p.stepHeight = 1.0F;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
p.jumpMovementFactor = 0.025F;
|
||||
}
|
||||
}
|
||||
if (p.fallDistance > 0.0F) p.fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (p.onGround || p.capabilities.isFlying) {
|
||||
float bonus = 0.4F;
|
||||
p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.050F) : bonus);
|
||||
} else if (Hover.getHover(p.getEntityId())) {
|
||||
p.jumpMovementFactor = 0.015F;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump (LivingEvent.LivingJumpEvent event)
|
||||
{
|
||||
if ( (event.entityLiving instanceof EntityPlayer))
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3);
|
||||
ItemStack boots = player.inventory.armorItemInSlot(0);
|
||||
if ( (sash != null) && ( (sash.getItem() instanceof ItemVoidwalkerSash)))
|
||||
{
|
||||
if ( (boots != null) && ( (boots.getItem() instanceof ItemVoidwalkerBoots)))
|
||||
{
|
||||
if (hasSpeedBoost(sash))
|
||||
{
|
||||
player.motionY += 0.15F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
p.jumpMovementFactor = 0.025F;
|
||||
}
|
||||
}
|
||||
if (p.fallDistance > 0.0F) p.fallDistance = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p)
|
||||
{
|
||||
if (!w.isRemote && p.isSneaking())
|
||||
{
|
||||
if (s.stackTagCompound == null)
|
||||
{
|
||||
s.setTagCompound(new NBTTagCompound());
|
||||
s.stackTagCompound.setBoolean(TAG_MODE, false);
|
||||
}
|
||||
if (s.stackTagCompound != null) s.stackTagCompound.setBoolean(TAG_MODE, !s.stackTagCompound.getBoolean(TAG_MODE));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
|
||||
if ((event.entityLiving instanceof EntityPlayer)) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3);
|
||||
ItemStack boots = player.inventory.armorItemInSlot(0);
|
||||
if ((sash != null) && ((sash.getItem() instanceof ItemVoidwalkerSash))) {
|
||||
if ((boots != null) && ((boots.getItem() instanceof ItemVoidwalkerBoots))) {
|
||||
if (hasSpeedBoost(sash)) {
|
||||
player.motionY += 0.15F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasSpeedBoost (ItemStack s)
|
||||
{
|
||||
if (s.stackTagCompound == null) return true;
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) {
|
||||
if (!w.isRemote && p.isSneaking()) {
|
||||
if (s.stackTagCompound == null) {
|
||||
s.setTagCompound(new NBTTagCompound());
|
||||
s.stackTagCompound.setBoolean(TAG_MODE, false);
|
||||
}
|
||||
if (s.stackTagCompound != null)
|
||||
s.stackTagCompound.setBoolean(TAG_MODE, !s.stackTagCompound.getBoolean(TAG_MODE));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
else return s.stackTagCompound.getBoolean(TAG_MODE);
|
||||
}
|
||||
public boolean hasSpeedBoost(ItemStack s) {
|
||||
if (s.stackTagCompound == null) return true;
|
||||
|
||||
else return s.stackTagCompound.getBoolean(TAG_MODE);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +1,47 @@
|
||||
package taintedmagic.common.items.equipment;
|
||||
|
||||
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.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.items.armor.ItemGoggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWarpedGoggles extends ItemGoggles implements IWarpingGear
|
||||
{
|
||||
public ItemWarpedGoggles (ArmorMaterial m, int j, int k)
|
||||
{
|
||||
super(m, j, k);
|
||||
this.setMaxDamage(500);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWarpedGoggles");
|
||||
}
|
||||
public class ItemWarpedGoggles extends ItemGoggles implements IWarpingGear {
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles");
|
||||
}
|
||||
public ItemWarpedGoggles(ArmorMaterial m, int j, int k) {
|
||||
super(m, j, k);
|
||||
this.setMaxDamage(500);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWarpedGoggles");
|
||||
}
|
||||
|
||||
public String getArmorTexture (ItemStack s, Entity e, int slot, String type)
|
||||
{
|
||||
return "taintedmagic:textures/models/ModelWarpedGoggles.png";
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles");
|
||||
}
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
public String getArmorTexture(ItemStack s, Entity e, int slot, String type) {
|
||||
return "taintedmagic:textures/models/ModelWarpedGoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,25 @@
|
||||
package taintedmagic.common.items.tools;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
import taintedmagic.api.IBloodlust;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemCrystalDagger extends ItemSword implements IBloodlust, IRepairable
|
||||
{
|
||||
public ItemCrystalDagger (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemCrystalDagger");
|
||||
this.setMaxStackSize(1);
|
||||
this.setTextureName("taintedmagic:ItemCrystalDagger");
|
||||
}
|
||||
public class ItemCrystalDagger extends ItemSword implements IBloodlust, IRepairable {
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public ItemCrystalDagger(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemCrystalDagger");
|
||||
this.setMaxStackSize(1);
|
||||
this.setTextureName("taintedmagic:ItemCrystalDagger");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -36,8 +35,8 @@ import taintedmagic.client.model.ModelKatana;
|
||||
import taintedmagic.client.model.ModelSaya;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityTaintBubble;
|
||||
import taintedmagic.common.network.PacketKatanaAttack;
|
||||
import taintedmagic.common.network.PacketHandler;
|
||||
import taintedmagic.common.network.PacketKatanaAttack;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.common.config.Config;
|
||||
@@ -46,420 +45,381 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
{
|
||||
public static final int SUBTYPES = 3;
|
||||
|
||||
public static final ResourceLocation textureThaumium = new ResourceLocation("taintedmagic:textures/models/ModelKatanaThaumium.png");
|
||||
public static final ResourceLocation textureVoidmetal = new ResourceLocation("taintedmagic:textures/models/ModelKatanaVoidmetal.png");
|
||||
public static final ResourceLocation textureShadowmetal = new ResourceLocation("taintedmagic:textures/models/ModelKatanaShadowmetal.png");
|
||||
|
||||
public static final ModelKatana katana = new ModelKatana();
|
||||
public static final ModelSaya saya = new ModelSaya();
|
||||
|
||||
public static boolean equipped = false;
|
||||
public static float ticksEquipped = 0F;
|
||||
|
||||
public int ticksInUse = 0;
|
||||
|
||||
public ItemKatana ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemKatana");
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p)
|
||||
{
|
||||
if (!e.worldObj.isRemote && (! (e instanceof EntityPlayer) || ! (p instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled()))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (s.getItemDamage() == 1)
|
||||
{
|
||||
e.addPotionEffect(new PotionEffect(Potion.weakness.getId(), 60));
|
||||
e.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 120));
|
||||
}
|
||||
if (s.getItemDamage() == 2)
|
||||
{
|
||||
e.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 120, 2));
|
||||
e.addPotionEffect(new PotionEffect(Config.potionBlurredID, 120));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
if (hasAnyInscription(s))
|
||||
{
|
||||
switch (getInscription(s))
|
||||
{
|
||||
case 0 :
|
||||
{
|
||||
e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p).setFireDamage().setDamageBypassesArmor(), getAttackDamage(s));
|
||||
e.setFire(5);
|
||||
break;
|
||||
}
|
||||
case 1 :
|
||||
{
|
||||
e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p).setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s));
|
||||
|
||||
try
|
||||
{
|
||||
e.addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 100));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2 :
|
||||
{
|
||||
e.attackEntityFrom(DamageSource.wither.setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s));
|
||||
|
||||
try
|
||||
{
|
||||
e.addPotionEffect(new PotionEffect(Potion.wither.id, 60));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), getAttackDamage(s));
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random());
|
||||
|
||||
return super.hitEntity(s, e, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock (Block b, ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction (ItemStack s)
|
||||
{
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (Item i, CreativeTabs c, List l)
|
||||
{
|
||||
for (int a = 0; a < SUBTYPES; a++)
|
||||
l.add(new ItemStack(this, 1, a));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName (ItemStack s)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
if (s.getItemDamage() == 1) l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("enchantment.special.sapgreat"));
|
||||
l.add(" ");
|
||||
l.add("\u00A79+" + getAttackDamage(s) + " " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
|
||||
if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription"))
|
||||
{
|
||||
l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.katana.inscription." + s.stackTagCompound.getInteger("inscription")));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
public float getAttackDamage (ItemStack s)
|
||||
{
|
||||
switch (s.getItemDamage())
|
||||
{
|
||||
case 0 :
|
||||
return 14.25F;
|
||||
case 1 :
|
||||
return 17.55F;
|
||||
case 2 :
|
||||
return 20.75F;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration (ItemStack s)
|
||||
{
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p)
|
||||
{
|
||||
p.setItemInUse(s, getMaxItemUseDuration(s));
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick (ItemStack s, EntityPlayer p, int i)
|
||||
{
|
||||
super.onUsingTick(s, p, i);
|
||||
|
||||
this.ticksInUse = getMaxItemUseDuration(s) - i;
|
||||
|
||||
float j = 1.0F + ((float) Math.random() * 0.25F);
|
||||
if (p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:wind", j * 0.1F, j);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing (ItemStack s, World w, EntityPlayer p, int i)
|
||||
{
|
||||
super.onPlayerStoppedUsing(s, w, p, i);
|
||||
Random r = new Random();
|
||||
|
||||
if (!hasAnyInscription(s) || !isFullyCharged(p) || p.isSneaking() || getInscription(s) == 2)
|
||||
{
|
||||
boolean leech = (getInscription(s) == 2 && isFullyCharged(p));
|
||||
boolean b = false;
|
||||
|
||||
if (w.isRemote)
|
||||
{
|
||||
MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver;
|
||||
float mul = Math.min(1.0F + (float) this.ticksInUse / 40.0F, 2.0F);
|
||||
|
||||
if (mop.entityHit != null)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketKatanaAttack(mop.entityHit, p, this.getAttackDamage(s) * mul, leech));
|
||||
}
|
||||
p.swingItem();
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random());
|
||||
}
|
||||
else if (hasAnyInscription(s) && isFullyCharged(p) && !p.isSneaking())
|
||||
{
|
||||
switch (getInscription(s))
|
||||
{
|
||||
case 0 :
|
||||
{
|
||||
EntityExplosiveOrb proj = new EntityExplosiveOrb(w, p);
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
if (!w.isRemote) w.spawnEntityInWorld(proj);
|
||||
p.swingItem();
|
||||
break;
|
||||
}
|
||||
case 1 :
|
||||
{
|
||||
for (int a = 0; a < 50; a++)
|
||||
{
|
||||
EntityTaintBubble proj = new EntityTaintBubble(w, p, 5.0F, false);
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
proj.damage = getAttackDamage(s) * 0.2F;
|
||||
if (!w.isRemote) w.spawnEntityInWorld(proj);
|
||||
p.swingItem();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isFullyCharged (EntityPlayer p)
|
||||
{
|
||||
float f = Math.min((float) this.ticksInUse / 15.0F, 2.0F);
|
||||
|
||||
if (f == 2.0F) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlayerRender (RenderPlayerEvent.Specials.Post event)
|
||||
{
|
||||
if (event.entityLiving.getActivePotionEffect(Potion.invisibility) != null) return;
|
||||
|
||||
EntityPlayer p = event.entityPlayer;
|
||||
|
||||
for (int i = 0; i < p.inventory.getSizeInventory(); i++)
|
||||
{
|
||||
if (p.inventory.getStackInSlot(i) != null && p.inventory.getStackInSlot(i).getItem() instanceof ItemKatana)
|
||||
{
|
||||
ItemStack s = p.inventory.getStackInSlot(i);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
int light = p.getBrightnessForRender(0);
|
||||
int lightmapX = light % 65536;
|
||||
int lightmapY = light / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef(55, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(-0.6F, 2.25F, 1.25F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(s));
|
||||
saya.render(0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if (p.getHeldItem() == null || p.getHeldItem() != s)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef(55, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(-0.6F, 2.25F, 1.25F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(s));
|
||||
katana.render(0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void renderHUD (ScaledResolution r, EntityPlayer p, float pt)
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ItemStack s = mc.thePlayer.getCurrentEquippedItem();
|
||||
Tessellator t = Tessellator.instance;
|
||||
|
||||
boolean b = false;
|
||||
|
||||
if (s != null && s.getItem() instanceof ItemKatana) b = true;
|
||||
else b = false;
|
||||
|
||||
float time = 30F;
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + pt);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - pt);
|
||||
|
||||
float defAlpha = 0F;
|
||||
float fract = ticksEquipped / time;
|
||||
float a = fract;
|
||||
|
||||
if (b || ticksEquipped != 0)
|
||||
{
|
||||
float tickFract = Math.min((float) p.getItemInUseDuration() / 30.0F, 1.0F);
|
||||
|
||||
int x = r.getScaledWidth() / 2 + 725;
|
||||
int x2 = x + 16;
|
||||
int y = r.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 805 : 755);
|
||||
int y2 = y + 16;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
float sc = 0.315F;
|
||||
|
||||
GL11.glScalef(sc, sc, sc);
|
||||
|
||||
mc.renderEngine.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png"));
|
||||
|
||||
for (int rune = 0; rune < 16; rune++)
|
||||
{
|
||||
float red = MathHelper.sin( (p.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F;
|
||||
float green = MathHelper.sin( (p.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F;
|
||||
float alpha = MathHelper.sin( (p.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
|
||||
float f = 0.0625F * rune;
|
||||
float f1 = f + 0.0625F;
|
||||
float f2 = 0.0F;
|
||||
float f3 = 1.0F;
|
||||
|
||||
t.startDrawingQuads();
|
||||
|
||||
t.setBrightness(240);
|
||||
t.setColorRGBA_F(red, green, 0.4F, (alpha + 0.7F) * a);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2);
|
||||
|
||||
t.draw();
|
||||
|
||||
if ((int) (16 * tickFract) > rune)
|
||||
{
|
||||
t.startDrawingQuads();
|
||||
|
||||
t.setBrightness(240);
|
||||
t.setColorRGBA_F(1.0F - (0.0625F * rune), 0.0F + (0.0625F * rune), 0.0F, 0.9F + alpha);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2);
|
||||
|
||||
t.draw();
|
||||
}
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasAnyInscription (ItemStack s)
|
||||
{
|
||||
return s.hasTagCompound() && s.stackTagCompound.hasKey("inscription");
|
||||
}
|
||||
|
||||
public static int getInscription (ItemStack s)
|
||||
{
|
||||
if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) return s.stackTagCompound.getInteger("inscription");
|
||||
else return 0;
|
||||
}
|
||||
|
||||
public static ResourceLocation getTexture (ItemStack s)
|
||||
{
|
||||
switch (s.getItemDamage())
|
||||
{
|
||||
case 0 :
|
||||
return textureThaumium;
|
||||
case 1 :
|
||||
return textureVoidmetal;
|
||||
case 2 :
|
||||
return textureShadowmetal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return s.getItemDamage() == 0 ? 0 : s.getItemDamage() == 1 ? 3 : 7;
|
||||
}
|
||||
public class ItemKatana extends Item implements IWarpingGear, IRepairable {
|
||||
|
||||
public static final int SUBTYPES = 3;
|
||||
|
||||
public static final ResourceLocation textureThaumium = new ResourceLocation(
|
||||
"taintedmagic:textures/models/ModelKatanaThaumium.png");
|
||||
public static final ResourceLocation textureVoidmetal = new ResourceLocation(
|
||||
"taintedmagic:textures/models/ModelKatanaVoidmetal.png");
|
||||
public static final ResourceLocation textureShadowmetal = new ResourceLocation(
|
||||
"taintedmagic:textures/models/ModelKatanaShadowmetal.png");
|
||||
|
||||
public static final ModelKatana katana = new ModelKatana();
|
||||
public static final ModelSaya saya = new ModelSaya();
|
||||
|
||||
public static boolean equipped = false;
|
||||
public static float ticksEquipped = 0F;
|
||||
|
||||
public int ticksInUse = 0;
|
||||
|
||||
public ItemKatana() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemKatana");
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack s, EntityLivingBase e, EntityLivingBase p) {
|
||||
if (!e.worldObj.isRemote && (!(e instanceof EntityPlayer) || !(p instanceof EntityPlayer)
|
||||
|| MinecraftServer.getServer().isPVPEnabled())) {
|
||||
try {
|
||||
if (s.getItemDamage() == 1) {
|
||||
e.addPotionEffect(new PotionEffect(Potion.weakness.getId(), 60));
|
||||
e.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 120));
|
||||
}
|
||||
if (s.getItemDamage() == 2) {
|
||||
e.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 120, 2));
|
||||
e.addPotionEffect(new PotionEffect(Config.potionBlurredID, 120));
|
||||
}
|
||||
} catch (Exception ex) {}
|
||||
if (hasAnyInscription(s)) {
|
||||
switch (getInscription(s)) {
|
||||
case 0: {
|
||||
e.attackEntityFrom(
|
||||
DamageSource.causePlayerDamage((EntityPlayer) p).setFireDamage()
|
||||
.setDamageBypassesArmor(),
|
||||
getAttackDamage(s));
|
||||
e.setFire(5);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
e.attackEntityFrom(
|
||||
DamageSource.causePlayerDamage((EntityPlayer) p).setMagicDamage()
|
||||
.setDamageBypassesArmor(),
|
||||
getAttackDamage(s));
|
||||
|
||||
try {
|
||||
e.addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 100));
|
||||
} catch (Exception ex) {}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
e.attackEntityFrom(
|
||||
DamageSource.wither.setMagicDamage().setDamageBypassesArmor(),
|
||||
getAttackDamage(s));
|
||||
|
||||
try {
|
||||
e.addPotionEffect(new PotionEffect(Potion.wither.id, 60));
|
||||
} catch (Exception ex) {}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), getAttackDamage(s));
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random());
|
||||
|
||||
return super.hitEntity(s, e, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block b, ItemStack s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack s) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item i, CreativeTabs c, List l) {
|
||||
for (int a = 0; a < SUBTYPES; a++) l.add(new ItemStack(this, 1, a));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack s) {
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
if (s.getItemDamage() == 1)
|
||||
l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("enchantment.special.sapgreat"));
|
||||
l.add(" ");
|
||||
l.add("\u00A79+" + getAttackDamage(s) + " " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
|
||||
if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) {
|
||||
l.add(
|
||||
EnumChatFormatting.GOLD + StatCollector.translateToLocal(
|
||||
"text.katana.inscription." + s.stackTagCompound.getInteger("inscription")));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
public float getAttackDamage(ItemStack s) {
|
||||
switch (s.getItemDamage()) {
|
||||
case 0:
|
||||
return 14.25F;
|
||||
case 1:
|
||||
return 17.55F;
|
||||
case 2:
|
||||
return 20.75F;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack s) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) {
|
||||
p.setItemInUse(s, getMaxItemUseDuration(s));
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack s, EntityPlayer p, int i) {
|
||||
super.onUsingTick(s, p, i);
|
||||
|
||||
this.ticksInUse = getMaxItemUseDuration(s) - i;
|
||||
|
||||
float j = 1.0F + ((float) Math.random() * 0.25F);
|
||||
if (p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:wind", j * 0.1F, j);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack s, World w, EntityPlayer p, int i) {
|
||||
super.onPlayerStoppedUsing(s, w, p, i);
|
||||
Random r = new Random();
|
||||
|
||||
if (!hasAnyInscription(s) || !isFullyCharged(p) || p.isSneaking() || getInscription(s) == 2) {
|
||||
boolean leech = (getInscription(s) == 2 && isFullyCharged(p));
|
||||
boolean b = false;
|
||||
|
||||
if (w.isRemote) {
|
||||
MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver;
|
||||
float mul = Math.min(1.0F + (float) this.ticksInUse / 40.0F, 2.0F);
|
||||
|
||||
if (mop.entityHit != null) {
|
||||
PacketHandler.INSTANCE.sendToServer(
|
||||
new PacketKatanaAttack(mop.entityHit, p, this.getAttackDamage(s) * mul, leech));
|
||||
}
|
||||
p.swingItem();
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(
|
||||
p,
|
||||
"thaumcraft:swing",
|
||||
0.5F + (float) Math.random(),
|
||||
0.5F + (float) Math.random());
|
||||
} else if (hasAnyInscription(s) && isFullyCharged(p) && !p.isSneaking()) {
|
||||
switch (getInscription(s)) {
|
||||
case 0: {
|
||||
EntityExplosiveOrb proj = new EntityExplosiveOrb(w, p);
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
if (!w.isRemote) w.spawnEntityInWorld(proj);
|
||||
p.swingItem();
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
for (int a = 0; a < 50; a++) {
|
||||
EntityTaintBubble proj = new EntityTaintBubble(w, p, 5.0F, false);
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
proj.damage = getAttackDamage(s) * 0.2F;
|
||||
if (!w.isRemote) w.spawnEntityInWorld(proj);
|
||||
p.swingItem();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isFullyCharged(EntityPlayer p) {
|
||||
float f = Math.min((float) this.ticksInUse / 15.0F, 2.0F);
|
||||
|
||||
if (f == 2.0F) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlayerRender(RenderPlayerEvent.Specials.Post event) {
|
||||
if (event.entityLiving.getActivePotionEffect(Potion.invisibility) != null) return;
|
||||
|
||||
EntityPlayer p = event.entityPlayer;
|
||||
|
||||
for (int i = 0; i < p.inventory.getSizeInventory(); i++) {
|
||||
if (p.inventory.getStackInSlot(i) != null
|
||||
&& p.inventory.getStackInSlot(i).getItem() instanceof ItemKatana) {
|
||||
ItemStack s = p.inventory.getStackInSlot(i);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
int light = p.getBrightnessForRender(0);
|
||||
int lightmapX = light % 65536;
|
||||
int lightmapY = light / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef(55, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(-0.6F, 2.25F, 1.25F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(s));
|
||||
saya.render(0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if (p.getHeldItem() == null || p.getHeldItem() != s) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glRotatef(55, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GL11.glTranslatef(-0.6F, 2.25F, 1.25F);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(s));
|
||||
katana.render(0.0625F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUD(ScaledResolution r, EntityPlayer p, float pt) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ItemStack s = mc.thePlayer.getCurrentEquippedItem();
|
||||
Tessellator t = Tessellator.instance;
|
||||
|
||||
boolean b = false;
|
||||
|
||||
if (s != null && s.getItem() instanceof ItemKatana) b = true;
|
||||
else b = false;
|
||||
|
||||
float time = 30F;
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + pt);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - pt);
|
||||
|
||||
float defAlpha = 0F;
|
||||
float fract = ticksEquipped / time;
|
||||
float a = fract;
|
||||
|
||||
if (b || ticksEquipped != 0) {
|
||||
float tickFract = Math.min((float) p.getItemInUseDuration() / 30.0F, 1.0F);
|
||||
|
||||
int x = r.getScaledWidth() / 2 + 725;
|
||||
int x2 = x + 16;
|
||||
int y = r.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 805 : 755);
|
||||
int y2 = y + 16;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
float sc = 0.315F;
|
||||
|
||||
GL11.glScalef(sc, sc, sc);
|
||||
|
||||
mc.renderEngine.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png"));
|
||||
|
||||
for (int rune = 0; rune < 16; rune++) {
|
||||
float red = MathHelper.sin((p.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F;
|
||||
float green = MathHelper.sin((p.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F;
|
||||
float alpha = MathHelper.sin((p.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
|
||||
float f = 0.0625F * rune;
|
||||
float f1 = f + 0.0625F;
|
||||
float f2 = 0.0F;
|
||||
float f3 = 1.0F;
|
||||
|
||||
t.startDrawingQuads();
|
||||
|
||||
t.setBrightness(240);
|
||||
t.setColorRGBA_F(red, green, 0.4F, (alpha + 0.7F) * a);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2);
|
||||
|
||||
t.draw();
|
||||
|
||||
if ((int) (16 * tickFract) > rune) {
|
||||
t.startDrawingQuads();
|
||||
|
||||
t.setBrightness(240);
|
||||
t.setColorRGBA_F(1.0F - (0.0625F * rune), 0.0F + (0.0625F * rune), 0.0F, 0.9F + alpha);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3);
|
||||
t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2);
|
||||
t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2);
|
||||
|
||||
t.draw();
|
||||
}
|
||||
}
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasAnyInscription(ItemStack s) {
|
||||
return s.hasTagCompound() && s.stackTagCompound.hasKey("inscription");
|
||||
}
|
||||
|
||||
public static int getInscription(ItemStack s) {
|
||||
if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription"))
|
||||
return s.stackTagCompound.getInteger("inscription");
|
||||
else return 0;
|
||||
}
|
||||
|
||||
public static ResourceLocation getTexture(ItemStack s) {
|
||||
switch (s.getItemDamage()) {
|
||||
case 0:
|
||||
return textureThaumium;
|
||||
case 1:
|
||||
return textureVoidmetal;
|
||||
case 2:
|
||||
return textureShadowmetal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return s.getItemDamage() == 0 ? 0 : s.getItemDamage() == 1 ? 3 : 7;
|
||||
}
|
||||
}
|
||||
@@ -17,122 +17,106 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.api.IBloodlust;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemPrimordialEdge extends ItemSword implements IWarpingGear, IRepairable
|
||||
{
|
||||
public ItemPrimordialEdge (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setTextureName("taintedmagic:ItemPrimordialEdge");
|
||||
this.setUnlocalizedName("ItemPrimordialEdge");
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
}
|
||||
public class ItemPrimordialEdge extends ItemSword implements IWarpingGear, IRepairable {
|
||||
|
||||
public EnumAction getItemUseAction (ItemStack s)
|
||||
{
|
||||
return EnumAction.block;
|
||||
}
|
||||
public ItemPrimordialEdge(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setTextureName("taintedmagic:ItemPrimordialEdge");
|
||||
this.setUnlocalizedName("ItemPrimordialEdge");
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
}
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
public EnumAction getItemUseAction(ItemStack s) {
|
||||
return EnumAction.block;
|
||||
}
|
||||
|
||||
public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p)
|
||||
{
|
||||
super.hitEntity(s, e, p);
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
e.addPotionEffect(new PotionEffect(Potion.wither.id, 5, 1));
|
||||
e.addPotionEffect(new PotionEffect(Potion.weakness.id, 5, 1));
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 1.0F, 1.0F);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean hitEntity(ItemStack s, EntityLivingBase e, EntityLivingBase p) {
|
||||
super.hitEntity(s, e, p);
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p)
|
||||
{
|
||||
p.setItemInUse(s, this.getMaxItemUseDuration(s));
|
||||
return s;
|
||||
}
|
||||
try {
|
||||
e.addPotionEffect(new PotionEffect(Potion.wither.id, 5, 1));
|
||||
e.addPotionEffect(new PotionEffect(Potion.weakness.id, 5, 1));
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 1.0F, 1.0F);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick (ItemStack s, EntityPlayer p, int count)
|
||||
{
|
||||
Iterator i$;
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) {
|
||||
p.setItemInUse(s, this.getMaxItemUseDuration(s));
|
||||
return s;
|
||||
}
|
||||
|
||||
List ents = p.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(15.0D, 15.0D, 15.0D));
|
||||
@Override
|
||||
public void onUsingTick(ItemStack s, EntityPlayer p, int count) {
|
||||
Iterator i$;
|
||||
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:brain", 0.05F, 0.5F);
|
||||
if ( (ents != null) && (ents.size() > 0)) for (i$ = ents.iterator(); i$.hasNext();)
|
||||
{
|
||||
Object ent = i$.next();
|
||||
Entity eo = (Entity) ent;
|
||||
List ents = p.worldObj.getEntitiesWithinAABB(
|
||||
Entity.class,
|
||||
AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1)
|
||||
.expand(15.0D, 15.0D, 15.0D));
|
||||
|
||||
if (eo != p)
|
||||
{
|
||||
if ( (eo.isEntityAlive()) && (!eo.isEntityInvulnerable()))
|
||||
{
|
||||
double d = pointDistanceSpace(eo.posX, eo.posY, eo.posZ, p);
|
||||
if (d < 2.0D)
|
||||
{
|
||||
eo.attackEntityFrom(DamageSource.magic, 1.0F);
|
||||
}
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:brain", 0.05F, 0.5F);
|
||||
if ((ents != null) && (ents.size() > 0)) for (i$ = ents.iterator(); i$.hasNext();) {
|
||||
Object ent = i$.next();
|
||||
Entity eo = (Entity) ent;
|
||||
|
||||
}
|
||||
double var3 = (p.posX + 0.5D - eo.posX) / 20.0D;
|
||||
double var5 = (p.posY + 0.5D - eo.posY) / 20.0D;
|
||||
double var7 = (p.posZ + 0.5D - eo.posZ) / 20.0D;
|
||||
double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7);
|
||||
double var11 = 1.0D - var9;
|
||||
if (eo != p) {
|
||||
if ((eo.isEntityAlive()) && (!eo.isEntityInvulnerable())) {
|
||||
double d = pointDistanceSpace(eo.posX, eo.posY, eo.posZ, p);
|
||||
if (d < 2.0D) {
|
||||
eo.attackEntityFrom(DamageSource.magic, 1.0F);
|
||||
}
|
||||
|
||||
if (var11 > 0.0D)
|
||||
{
|
||||
var11 *= var11;
|
||||
eo.motionX += var3 / var9 * var11 * 0.20D;
|
||||
eo.motionY += var5 / var9 * var11 * 0.30D;
|
||||
eo.motionZ += var7 / var9 * var11 * 0.20D;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
double var3 = (p.posX + 0.5D - eo.posX) / 20.0D;
|
||||
double var5 = (p.posY + 0.5D - eo.posY) / 20.0D;
|
||||
double var7 = (p.posZ + 0.5D - eo.posZ) / 20.0D;
|
||||
double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7);
|
||||
double var11 = 1.0D - var9;
|
||||
|
||||
@Override
|
||||
public void onUpdate (ItemStack s, World w, Entity e, int i, boolean b)
|
||||
{
|
||||
if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0))
|
||||
{
|
||||
s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
}
|
||||
if (var11 > 0.0D) {
|
||||
var11 *= var11;
|
||||
eo.motionX += var3 / var9 * var11 * 0.20D;
|
||||
eo.motionY += var5 / var9 * var11 * 0.30D;
|
||||
eo.motionZ += var7 / var9 * var11 * 0.20D;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public double pointDistanceSpace (double x, double y, double z, EntityPlayer p)
|
||||
{
|
||||
double xvar = p.posX + 0.5D - x;
|
||||
double yvar = p.posY + 0.5D - y;
|
||||
double zvar = p.posZ + 0.5D - z;
|
||||
return xvar * xvar + yvar * yvar + zvar * zvar;
|
||||
}
|
||||
@Override
|
||||
public void onUpdate(ItemStack s, World w, Entity e, int i, boolean b) {
|
||||
if ((!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0)) {
|
||||
s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.eldritchsapping"));
|
||||
}
|
||||
public double pointDistanceSpace(double x, double y, double z, EntityPlayer p) {
|
||||
double xvar = p.posX + 0.5D - x;
|
||||
double yvar = p.posY + 0.5D - y;
|
||||
double zvar = p.posZ + 0.5D - z;
|
||||
return xvar * xvar + yvar * yvar + zvar * zvar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (ItemStack s, EntityPlayer p)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.eldritchsapping"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp(ItemStack s, EntityPlayer p) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,29 @@
|
||||
package taintedmagic.common.items.tools;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemShadowmetalAxe extends ItemAxe implements IRepairable
|
||||
{
|
||||
public ItemShadowmetalAxe (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalAxe");
|
||||
this.setUnlocalizedName("ItemShadowmetalAxe");
|
||||
}
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public class ItemShadowmetalAxe extends ItemAxe implements IRepairable {
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public ItemShadowmetalAxe(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalAxe");
|
||||
this.setUnlocalizedName("ItemShadowmetalAxe");
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -9,66 +9,73 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemShadowmetalHoe extends ItemHoe implements IRepairable
|
||||
{
|
||||
public ItemShadowmetalHoe (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalHoe");
|
||||
this.setUnlocalizedName("ItemShadowmetalHoe");
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
public class ItemShadowmetalHoe extends ItemHoe implements IRepairable {
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public ItemShadowmetalHoe(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalHoe");
|
||||
this.setUnlocalizedName("ItemShadowmetalHoe");
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack s, EntityPlayer p, World w, int x, int y, int z, int i, float a, float b, float c)
|
||||
{
|
||||
super.onItemUse(s, p, w, x, y, z, i, a, b, c);
|
||||
if (!p.worldObj.isRemote)
|
||||
{
|
||||
Block block = Blocks.dirt;
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
if (p.worldObj.getBlock(x, y, z) == Blocks.farmland)
|
||||
{
|
||||
p.worldObj.setBlock(x, y, z, Blocks.dirt);
|
||||
s.damageItem(1, p);
|
||||
w.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getStepResourcePath(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
else if (p.worldObj.getBlock(x, y, z) == Blocks.dirt || p.worldObj.getBlock(x, y, z) == Blocks.grass)
|
||||
{
|
||||
p.worldObj.setBlock(x, y, z, Blocks.farmland);
|
||||
s.damageItem(1, p);
|
||||
w.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getStepResourcePath(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
}
|
||||
if (p.worldObj.getBlock(x, y, z) == Blocks.dirt || p.worldObj.getBlock(x, y, z) == Blocks.grass || p.worldObj.getBlock(x, y, z) == Blocks.farmland) p.swingItem();
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack s, EntityPlayer p, World w, int x, int y, int z, int i, float a, float b,
|
||||
float c) {
|
||||
super.onItemUse(s, p, w, x, y, z, i, a, b, c);
|
||||
if (!p.worldObj.isRemote) {
|
||||
Block block = Blocks.dirt;
|
||||
|
||||
@SubscribeEvent
|
||||
public void useHoe (UseHoeEvent event)
|
||||
{
|
||||
if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
if (p.worldObj.getBlock(x, y, z) == Blocks.farmland) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.dirt);
|
||||
s.damageItem(1, p);
|
||||
w.playSoundEffect(
|
||||
(double) ((float) x + 0.5F),
|
||||
(double) ((float) y + 0.5F),
|
||||
(double) ((float) z + 0.5F),
|
||||
block.stepSound.getStepResourcePath(),
|
||||
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
block.stepSound.getPitch() * 0.8F);
|
||||
} else if (p.worldObj.getBlock(x, y, z) == Blocks.dirt || p.worldObj.getBlock(x, y, z) == Blocks.grass) {
|
||||
p.worldObj.setBlock(x, y, z, Blocks.farmland);
|
||||
s.damageItem(1, p);
|
||||
w.playSoundEffect(
|
||||
(double) ((float) x + 0.5F),
|
||||
(double) ((float) y + 0.5F),
|
||||
(double) ((float) z + 0.5F),
|
||||
block.stepSound.getStepResourcePath(),
|
||||
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
block.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
}
|
||||
if (p.worldObj.getBlock(x, y, z) == Blocks.dirt || p.worldObj.getBlock(x, y, z) == Blocks.grass
|
||||
|| p.worldObj.getBlock(x, y, z) == Blocks.farmland)
|
||||
p.swingItem();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void useHoe(UseHoeEvent event) {
|
||||
if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -3,28 +3,27 @@ package taintedmagic.common.items.tools;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemShadowmetalPick extends ItemPickaxe implements IRepairable
|
||||
{
|
||||
public ItemShadowmetalPick (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalPick");
|
||||
this.setUnlocalizedName("ItemShadowmetalPick");
|
||||
}
|
||||
public class ItemShadowmetalPick extends ItemPickaxe implements IRepairable {
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public ItemShadowmetalPick(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalPick");
|
||||
this.setUnlocalizedName("ItemShadowmetalPick");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,29 @@
|
||||
package taintedmagic.common.items.tools;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemShadowmetalSpade extends ItemSpade implements IRepairable
|
||||
{
|
||||
public ItemShadowmetalSpade (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalSpade");
|
||||
this.setUnlocalizedName("ItemShadowmetalSpade");
|
||||
}
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public class ItemShadowmetalSpade extends ItemSpade implements IRepairable {
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public ItemShadowmetalSpade(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalSpade");
|
||||
this.setUnlocalizedName("ItemShadowmetalSpade");
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,29 @@
|
||||
package taintedmagic.common.items.tools;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
public class ItemShadowmetalSword extends ItemSword implements IRepairable
|
||||
{
|
||||
public ItemShadowmetalSword (ToolMaterial m)
|
||||
{
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalSword");
|
||||
this.setUnlocalizedName("ItemShadowmetalSword");
|
||||
}
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public boolean getIsRepairable (ItemStack s, ItemStack s2)
|
||||
{
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2);
|
||||
}
|
||||
public class ItemShadowmetalSword extends ItemSword implements IRepairable {
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public ItemShadowmetalSword(ToolMaterial m) {
|
||||
super(m);
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setTextureName("taintedmagic:ItemShadowmetalSword");
|
||||
this.setUnlocalizedName("ItemShadowmetalSword");
|
||||
}
|
||||
|
||||
public boolean getIsRepairable(ItemStack s, ItemStack s2) {
|
||||
return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true
|
||||
: super.getIsRepairable(s, s2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -28,178 +28,171 @@ import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemThaumicDisassembler extends Item
|
||||
{
|
||||
public static final String TAG_MODE = "mode";
|
||||
public class ItemThaumicDisassembler extends Item {
|
||||
|
||||
public ItemThaumicDisassembler ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setMaxDamage(500);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("ItemThaumicDisassembler");
|
||||
this.setTextureName("taintedmagic:ItemThaumicDisassembler");
|
||||
}
|
||||
public static final String TAG_MODE = "mode";
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock (Block b, ItemStack s)
|
||||
{
|
||||
return b != Blocks.bedrock;
|
||||
}
|
||||
public ItemThaumicDisassembler() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setMaxDamage(500);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("ItemThaumicDisassembler");
|
||||
this.setTextureName("taintedmagic:ItemThaumicDisassembler");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
super.addInformation(s, p, l, b);
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block b, ItemStack s) {
|
||||
return b != Blocks.bedrock;
|
||||
}
|
||||
|
||||
l.add("\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s));
|
||||
l.add("\u00A78" + StatCollector.translateToLocal("text.efficiency") + ": " + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + getEfficiency(s));
|
||||
l.add(" ");
|
||||
l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
super.addInformation(s, p, l, b);
|
||||
|
||||
@Override
|
||||
public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p)
|
||||
{
|
||||
e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), 20);
|
||||
s.damageItem(2, p);
|
||||
return false;
|
||||
}
|
||||
l.add("\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s));
|
||||
l.add(
|
||||
"\u00A78" + StatCollector.translateToLocal("text.efficiency")
|
||||
+ ": "
|
||||
+ (getMode(s) == 3 ? "\u00A7c" : "\u00A7a")
|
||||
+ getEfficiency(s));
|
||||
l.add(" ");
|
||||
l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed (ItemStack s, Block b, int meta)
|
||||
{
|
||||
return getEfficiency(s);
|
||||
}
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack s, EntityLivingBase e, EntityLivingBase p) {
|
||||
e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), 20);
|
||||
s.damageItem(2, p);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (ItemStack s, World w, Block b, int x, int y, int z, EntityLivingBase e)
|
||||
{
|
||||
if (b.getBlockHardness(w, x, y, z) != 0.0D) s.damageItem(1, e);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack s, Block b, int meta) {
|
||||
return getEfficiency(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak (ItemStack s, int x, int y, int z, EntityPlayer p)
|
||||
{
|
||||
super.onBlockStartBreak(s, x, y, z, p);
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack s, World w, Block b, int x, int y, int z, EntityLivingBase e) {
|
||||
if (b.getBlockHardness(w, x, y, z) != 0.0D) s.damageItem(1, e);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!p.worldObj.isRemote)
|
||||
{
|
||||
Block block = p.worldObj.getBlock(x, y, z);
|
||||
int meta = p.worldObj.getBlockMetadata(x, y, z);
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack s, int x, int y, int z, EntityPlayer p) {
|
||||
super.onBlockStartBreak(s, x, y, z, p);
|
||||
|
||||
if (block == Blocks.lit_redstone_ore) block = Blocks.redstone_ore;
|
||||
if (!p.worldObj.isRemote) {
|
||||
Block block = p.worldObj.getBlock(x, y, z);
|
||||
int meta = p.worldObj.getBlockMetadata(x, y, z);
|
||||
|
||||
ItemStack stack = new ItemStack(block, 1, meta);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (block == Blocks.lit_redstone_ore) block = Blocks.redstone_ore;
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
ItemStack stack = new ItemStack(block, 1, meta);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p)
|
||||
{
|
||||
if (!w.isRemote && p.isSneaking()) toggleMode(s);
|
||||
@Override
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) {
|
||||
if (!w.isRemote && p.isSneaking()) toggleMode(s);
|
||||
|
||||
public static int getEfficiency (ItemStack s)
|
||||
{
|
||||
switch (getMode(s))
|
||||
{
|
||||
case 0 :
|
||||
return 20;
|
||||
case 1 :
|
||||
return 8;
|
||||
case 2 :
|
||||
return 128;
|
||||
case 3 :
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static int getMode (ItemStack s)
|
||||
{
|
||||
if (s.stackTagCompound == null) return 0;
|
||||
return s.stackTagCompound.getInteger(TAG_MODE);
|
||||
}
|
||||
public static int getEfficiency(ItemStack s) {
|
||||
switch (getMode(s)) {
|
||||
case 0:
|
||||
return 20;
|
||||
case 1:
|
||||
return 8;
|
||||
case 2:
|
||||
return 128;
|
||||
case 3:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static String getModeName (ItemStack s)
|
||||
{
|
||||
int mode = getMode(s);
|
||||
public static int getMode(ItemStack s) {
|
||||
if (s.stackTagCompound == null) return 0;
|
||||
return s.stackTagCompound.getInteger(TAG_MODE);
|
||||
}
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case 0 :
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal");
|
||||
case 1 :
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow");
|
||||
case 2 :
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast");
|
||||
case 3 :
|
||||
return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getModeName(ItemStack s) {
|
||||
int mode = getMode(s);
|
||||
|
||||
public void toggleMode (ItemStack s)
|
||||
{
|
||||
if (s.stackTagCompound == null) s.setTagCompound(new NBTTagCompound());
|
||||
s.stackTagCompound.setInteger(TAG_MODE, getMode(s) < 3 ? getMode(s) + 1 : 0);
|
||||
}
|
||||
switch (mode) {
|
||||
case 0:
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal");
|
||||
case 1:
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow");
|
||||
case 2:
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast");
|
||||
case 3:
|
||||
return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void onUpdate (ItemStack s, World w, Entity e, int i, boolean b)
|
||||
{
|
||||
super.onUpdate(s, w, e, i, b);
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer p = (EntityPlayer) e;
|
||||
if (!w.isRemote && s.isItemDamaged() && e.ticksExisted % 20 == 0)
|
||||
{
|
||||
if (WandManager.consumeVisFromInventory(p, new AspectList().add(Aspect.ENTROPY, 5))) s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void toggleMode(ItemStack s) {
|
||||
if (s.stackTagCompound == null) s.setTagCompound(new NBTTagCompound());
|
||||
s.stackTagCompound.setInteger(TAG_MODE, getMode(s) < 3 ? getMode(s) + 1 : 0);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void renderHUD (ScaledResolution resolution, EntityPlayer player, float partialTicks)
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
ItemStack s = mc.thePlayer.getCurrentEquippedItem();
|
||||
FontRenderer f = mc.fontRenderer;
|
||||
public void onUpdate(ItemStack s, World w, Entity e, int i, boolean b) {
|
||||
super.onUpdate(s, w, e, i, b);
|
||||
if (e instanceof EntityPlayer) {
|
||||
EntityPlayer p = (EntityPlayer) e;
|
||||
if (!w.isRemote && s.isItemDamaged() && e.ticksExisted % 20 == 0) {
|
||||
if (WandManager.consumeVisFromInventory(p, new AspectList().add(Aspect.ENTROPY, 5)))
|
||||
s.damageItem(-1, (EntityLivingBase) e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null && s.getItem() instanceof ItemThaumicDisassembler)
|
||||
{
|
||||
String str = "\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s) + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(s) + ")";
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, float partialTicks) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
ItemStack s = mc.thePlayer.getCurrentEquippedItem();
|
||||
FontRenderer f = mc.fontRenderer;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glTranslated(0, -15, 0);
|
||||
if (s != null && s.getItem() instanceof ItemThaumicDisassembler) {
|
||||
String str = "\u00A78" + StatCollector.translateToLocal("text.mode")
|
||||
+ ": "
|
||||
+ getModeName(s)
|
||||
+ (getMode(s) == 3 ? "\u00A7c" : "\u00A7a")
|
||||
+ " ("
|
||||
+ getEfficiency(s)
|
||||
+ ")";
|
||||
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glTranslated(0, -15, 0);
|
||||
|
||||
f.drawStringWithShadow(str, resolution.getScaledWidth() / 2 + 100, resolution.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 230 : 212), 0xFFFFFF);
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
f.drawStringWithShadow(
|
||||
str,
|
||||
resolution.getScaledWidth() / 2 + 100,
|
||||
resolution.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 230 : 212),
|
||||
0xFFFFFF);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,49 +8,42 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWandCap extends Item
|
||||
{
|
||||
public int SUBTYPES = 4;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
public class ItemWandCap extends Item {
|
||||
|
||||
public ItemWandCap ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWandCap");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
public int SUBTYPES = 4;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public ItemWandCap() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWandCap");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
this.icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i);
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int i)
|
||||
{
|
||||
return this.icons[i];
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) this.icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (Item item, CreativeTabs c, List l)
|
||||
{
|
||||
for (int i = 0; i < SUBTYPES; i++)
|
||||
l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int i) {
|
||||
return this.icons[i];
|
||||
}
|
||||
|
||||
public String getUnlocalizedName (ItemStack s)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs c, List l) {
|
||||
for (int i = 0; i < SUBTYPES; i++) l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack s) {
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -2,58 +2,48 @@ package taintedmagic.common.items.wand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
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.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemWandRod extends Item
|
||||
{
|
||||
public int SUBTYPES = 2;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public ItemWandRod ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWandRod");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
public class ItemWandRod extends Item {
|
||||
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
public int SUBTYPES = 2;
|
||||
public IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
this.icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i);
|
||||
}
|
||||
public ItemWandRod() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemWandRod");
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int i)
|
||||
{
|
||||
return this.icons[i];
|
||||
}
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (Item item, CreativeTabs c, List l)
|
||||
{
|
||||
for (int i = 0; i < SUBTYPES; i++)
|
||||
l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) this.icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName (ItemStack s)
|
||||
{
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int i) {
|
||||
return this.icons[i];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs c, List l) {
|
||||
for (int i = 0; i < SUBTYPES; i++) l.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack s) {
|
||||
return super.getUnlocalizedName() + "." + s.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -4,149 +4,119 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityEldritchOrbAttack;
|
||||
import taintedmagic.common.entities.EntityTaintBubble;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.monster.EntityEldritchGuardian;
|
||||
import thaumcraft.common.entities.projectile.EntityEldritchOrb;
|
||||
import thaumcraft.common.entities.projectile.EntityEmber;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.items.wands.WandManager;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.misc.PacketMiscEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusEldritch extends ItemFocusBasic
|
||||
{
|
||||
public static FocusUpgradeType sanity = new FocusUpgradeType(57, new ResourceLocation("taintedmagic", "textures/foci/IconSanity.png"), "focus.upgrade.sanity.name", "focus.upgrade.sanity.text", new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1));
|
||||
IIcon depthIcon = null;
|
||||
public class ItemFocusEldritch extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20);
|
||||
private static final AspectList costSane = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50).add(Aspect.ORDER, 20);
|
||||
private static final AspectList costCorrosive = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.FIRE, 20).add(Aspect.WATER, 20);
|
||||
public static FocusUpgradeType sanity = new FocusUpgradeType(
|
||||
57,
|
||||
new ResourceLocation("taintedmagic", "textures/foci/IconSanity.png"),
|
||||
"focus.upgrade.sanity.name",
|
||||
"focus.upgrade.sanity.text",
|
||||
new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1));
|
||||
IIcon depthIcon = null;
|
||||
|
||||
long soundDelay = 0L;
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20);
|
||||
private static final AspectList costSane = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50)
|
||||
.add(Aspect.ORDER, 20);
|
||||
private static final AspectList costCorrosive = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.FIRE, 20)
|
||||
.add(Aspect.WATER, 20);
|
||||
|
||||
public ItemFocusEldritch ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusEldritch");
|
||||
}
|
||||
long soundDelay = 0L;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusEldritch");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusEldritch_depth");
|
||||
}
|
||||
public ItemFocusEldritch() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusEldritch");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusEldritch");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusEldritch_depth");
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "ELDRITCH" + super.getSortingHelper(s);
|
||||
}
|
||||
public IIcon getFocusDepthLayerIcon(ItemStack s) {
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 0x000018;
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "ELDRITCH" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, ItemFocusTaint.corrosive) ? costCorrosive : isUpgradedWith(s, sanity) ? costSane : costBase;
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
return 0x000018;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 600;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return isUpgradedWith(s, ItemFocusTaint.corrosive) ? costCorrosive
|
||||
: isUpgradedWith(s, sanity) ? costSane : costBase;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return 600;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
public boolean isVisCostPerTick(ItemStack s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
if (!w.isRemote)
|
||||
{
|
||||
int potency = wand.getFocusPotency(s);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
EntityEldritchOrbAttack orb = null;
|
||||
orb = new EntityEldritchOrbAttack(w, p, isUpgradedWith(wand.getFocusItem(s), ItemFocusTaint.corrosive));
|
||||
orb.dmg = (10F + potency);
|
||||
w.spawnEntityInWorld(orb);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), sanity))
|
||||
{
|
||||
Random rand = new Random();
|
||||
int randomInt = rand.nextInt(10);
|
||||
if (randomInt == 5)
|
||||
{
|
||||
Thaumcraft.addStickyWarpToPlayer(p, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "thaumcraft:egattack", 0.4F, 1.0F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
p.swingItem();
|
||||
return s;
|
||||
}
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
ItemFocusTaint.corrosive };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
this.sanity };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (!w.isRemote) {
|
||||
int potency = wand.getFocusPotency(s);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) {
|
||||
EntityEldritchOrbAttack orb = null;
|
||||
orb = new EntityEldritchOrbAttack(w, p, isUpgradedWith(wand.getFocusItem(s), ItemFocusTaint.corrosive));
|
||||
orb.dmg = (10F + potency);
|
||||
w.spawnEntityInWorld(orb);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), sanity)) {
|
||||
Random rand = new Random();
|
||||
int randomInt = rand.nextInt(10);
|
||||
if (randomInt == 5) {
|
||||
Thaumcraft.addStickyWarpToPlayer(p, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "thaumcraft:egattack", 0.4F, 1.0F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
p.swingItem();
|
||||
return s;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) {
|
||||
switch (rank) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
ItemFocusTaint.corrosive };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, this.sanity };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -11,127 +11,113 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusMageMace extends ItemFocusBasic
|
||||
{
|
||||
public IIcon depthIcon = null;
|
||||
public IIcon ornIcon = null;
|
||||
public class ItemFocusMageMace extends ItemFocusBasic {
|
||||
|
||||
public int dmg;
|
||||
public IIcon depthIcon = null;
|
||||
public IIcon ornIcon = null;
|
||||
|
||||
public static FocusUpgradeType bloodlust = new FocusUpgradeType(58, new ResourceLocation("taintedmagic", "textures/misc/IconBloodlust.png"), "focus.upgrade.bloodlust.name", "focus.upgrade.bloodlust.text", new AspectList().add(Aspect.WEAPON, 1).add(Aspect.HEAL, 1));
|
||||
public static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 50);
|
||||
public static final AspectList costBloodlust = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.ORDER, 20).add(Aspect.FIRE, 50);
|
||||
public int dmg;
|
||||
|
||||
public ItemFocusMageMace ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusMageMace");
|
||||
}
|
||||
public static FocusUpgradeType bloodlust = new FocusUpgradeType(
|
||||
58,
|
||||
new ResourceLocation("taintedmagic", "textures/misc/IconBloodlust.png"),
|
||||
"focus.upgrade.bloodlust.name",
|
||||
"focus.upgrade.bloodlust.text",
|
||||
new AspectList().add(Aspect.WEAPON, 1).add(Aspect.HEAL, 1));
|
||||
public static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 50);
|
||||
public static final AspectList costBloodlust = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.ORDER, 20)
|
||||
.add(Aspect.FIRE, 50);
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusMageMace");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_depth");
|
||||
this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_orn");
|
||||
}
|
||||
public ItemFocusMageMace() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusMageMace");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusMageMace");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_depth");
|
||||
this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_orn");
|
||||
}
|
||||
|
||||
public IIcon getOrnament (ItemStack s)
|
||||
{
|
||||
return this.ornIcon;
|
||||
}
|
||||
public IIcon getFocusDepthLayerIcon(ItemStack s) {
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "MACE" + super.getSortingHelper(s);
|
||||
}
|
||||
public IIcon getOrnament(ItemStack s) {
|
||||
return this.ornIcon;
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 3289650;
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "MACE" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return this.isUpgradedWith(s, bloodlust) ? this.costBloodlust : this.costBase;
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
return 3289650;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return this.isUpgradedWith(s, bloodlust) ? this.costBloodlust : this.costBase;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
public boolean isVisCostPerTick(ItemStack s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
super.addInformation(s, p, l, b);
|
||||
l.add(" ");
|
||||
l.add(EnumChatFormatting.BLUE + "+" + new String(this.isUpgradedWith(s, FocusUpgradeType.potency) ? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.potency)) : "15") + " " + StatCollector.translateToLocal("text.attackdamageequipped"));
|
||||
}
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
return s;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
this.bloodlust };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
super.addInformation(s, p, l, b);
|
||||
l.add(" ");
|
||||
l.add(
|
||||
EnumChatFormatting.BLUE + "+"
|
||||
+ new String(
|
||||
this.isUpgradedWith(s, FocusUpgradeType.potency)
|
||||
? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.potency))
|
||||
: "15")
|
||||
+ " "
|
||||
+ StatCollector.translateToLocal("text.attackdamageequipped"));
|
||||
}
|
||||
|
||||
public boolean canApplyUpgrade (ItemStack s, EntityPlayer p, FocusUpgradeType t, int rank)
|
||||
{
|
||||
return (!t.equals(this.bloodlust)) || (ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), "BLOODLUSTUPGRADE"));
|
||||
}
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) {
|
||||
switch (rank) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, this.bloodlust };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canApplyUpgrade(ItemStack s, EntityPlayer p, FocusUpgradeType t, int rank) {
|
||||
return (!t.equals(this.bloodlust))
|
||||
|| (ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), "BLOODLUSTUPGRADE"));
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -16,76 +17,67 @@ import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusMeteorology extends ItemFocusBasic
|
||||
{
|
||||
IIcon depthIcon = null;
|
||||
public class ItemFocusMeteorology extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
IIcon depthIcon = null;
|
||||
|
||||
public ItemFocusMeteorology ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusMeteorology");
|
||||
}
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000)
|
||||
.add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusMeteorology");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth");
|
||||
}
|
||||
public ItemFocusMeteorology() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusMeteorology");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusMeteorology");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth");
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "RAIN" + super.getSortingHelper(s);
|
||||
}
|
||||
public IIcon getFocusDepthLayerIcon(ItemStack s) {
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 0x23D9EA;
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "RAIN" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
return 0x23D9EA;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000)
|
||||
.add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
public boolean isVisCostPerTick(ItemStack s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
WandManager.setCooldown(p, 30000);
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
wand.consumeAllVis(s, p, getVisCost(s), true, false);
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0);
|
||||
w.getWorldInfo().setRaining(!w.isRaining());
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
WandManager.setCooldown(p, 30000);
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
wand.consumeAllVis(s, p, getVisCost(s), true, false);
|
||||
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
return s;
|
||||
}
|
||||
w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0);
|
||||
w.getWorldInfo().setRaining(!w.isRaining());
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
return s;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
}
|
||||
@@ -11,157 +11,139 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityTaintBubble;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.entities.projectile.EntityEmber;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusTaint extends ItemFocusBasic
|
||||
{
|
||||
public static FocusUpgradeType tainturgy = new FocusUpgradeType(55, new ResourceLocation("taintedmagic", "textures/foci/IconTainturgy.png"), "focus.upgrade.tainturgy.name", "focus.upgrade.tainturgy.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1));
|
||||
public static FocusUpgradeType corrosive = new FocusUpgradeType(56, new ResourceLocation("taintedmagic", "textures/foci/IconCorrosive.png"), "focus.upgrade.corrosive.name", "focus.upgrade.corrosive.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1));
|
||||
IIcon depthIcon = null;
|
||||
public class ItemFocusTaint extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10);
|
||||
private static final AspectList costTainturgist = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10).add(Aspect.ORDER, 10);
|
||||
public static FocusUpgradeType tainturgy = new FocusUpgradeType(
|
||||
55,
|
||||
new ResourceLocation("taintedmagic", "textures/foci/IconTainturgy.png"),
|
||||
"focus.upgrade.tainturgy.name",
|
||||
"focus.upgrade.tainturgy.text",
|
||||
new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1));
|
||||
public static FocusUpgradeType corrosive = new FocusUpgradeType(
|
||||
56,
|
||||
new ResourceLocation("taintedmagic", "textures/foci/IconCorrosive.png"),
|
||||
"focus.upgrade.corrosive.name",
|
||||
"focus.upgrade.corrosive.text",
|
||||
new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1));
|
||||
IIcon depthIcon = null;
|
||||
|
||||
public ItemFocusTaint ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTaint");
|
||||
}
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10);
|
||||
private static final AspectList costTainturgist = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10)
|
||||
.add(Aspect.ORDER, 10);
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTaint");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth");
|
||||
}
|
||||
public ItemFocusTaint() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTaint");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTaint");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth");
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "TAINT" + super.getSortingHelper(s);
|
||||
}
|
||||
public IIcon getFocusDepthLayerIcon(ItemStack s) {
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 8073200;
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "TAINT" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, tainturgy) ? costTainturgist : costBase;
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
return 8073200;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return isUpgradedWith(s, tainturgy) ? costTainturgist : costBase;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.CHARGE;
|
||||
}
|
||||
public boolean isVisCostPerTick(ItemStack s) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
p.setItemInUse(s, 2147483647);
|
||||
WandManager.setCooldown(p, -1);
|
||||
return s;
|
||||
}
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return ItemFocusBasic.WandFocusAnimation.CHARGE;
|
||||
}
|
||||
|
||||
public void onUsingFocusTick (ItemStack s, EntityPlayer p, int count)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
if (!wand.consumeAllVis(s, p, getVisCost(s), false, false))
|
||||
{
|
||||
p.stopUsingItem();
|
||||
return;
|
||||
}
|
||||
int range = 8;
|
||||
Vec3 vec3d = p.getLook(range);
|
||||
if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 5.0F * (float) Math.random());
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
p.setItemInUse(s, 2147483647);
|
||||
WandManager.setCooldown(p, -1);
|
||||
return s;
|
||||
}
|
||||
|
||||
int potency = wand.getFocusPotency(s);
|
||||
if ( (!p.worldObj.isRemote) && (wand.consumeAllVis(s, p, getVisCost(s), true, false)))
|
||||
{
|
||||
float scatter = isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F;
|
||||
for (int a = 0; a < 2 + wand.getFocusPotency(s); a++)
|
||||
{
|
||||
EntityTaintBubble orb = new EntityTaintBubble(p.worldObj, p, scatter, isUpgradedWith(wand.getFocusItem(s), this.corrosive));
|
||||
orb.posX += orb.motionX;
|
||||
orb.posY += orb.motionY;
|
||||
orb.posZ += orb.motionZ;
|
||||
orb.damage = 5F + potency;
|
||||
p.worldObj.spawnEntityInWorld(orb);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), tainturgy))
|
||||
{
|
||||
Random rand = new Random();
|
||||
int randomInt = rand.nextInt(150);
|
||||
if (randomInt == 9)
|
||||
{
|
||||
try
|
||||
{
|
||||
p.addPotionEffect(new PotionEffect(Config.potionVisExhaustID, 1000, 2));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void onUsingFocusTick(ItemStack s, EntityPlayer p, int count) {
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
if (!wand.consumeAllVis(s, p, getVisCost(s), false, false)) {
|
||||
p.stopUsingItem();
|
||||
return;
|
||||
}
|
||||
int range = 8;
|
||||
Vec3 vec3d = p.getLook(range);
|
||||
if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0)
|
||||
p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 5.0F * (float) Math.random());
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
tainturgy };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
corrosive };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
int potency = wand.getFocusPotency(s);
|
||||
if ((!p.worldObj.isRemote) && (wand.consumeAllVis(s, p, getVisCost(s), true, false))) {
|
||||
float scatter = isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F;
|
||||
for (int a = 0; a < 2 + wand.getFocusPotency(s); a++) {
|
||||
EntityTaintBubble orb = new EntityTaintBubble(
|
||||
p.worldObj,
|
||||
p,
|
||||
scatter,
|
||||
isUpgradedWith(wand.getFocusItem(s), this.corrosive));
|
||||
orb.posX += orb.motionX;
|
||||
orb.posY += orb.motionY;
|
||||
orb.posZ += orb.motionZ;
|
||||
orb.damage = 5F + potency;
|
||||
p.worldObj.spawnEntityInWorld(orb);
|
||||
if (!isUpgradedWith(wand.getFocusItem(s), tainturgy)) {
|
||||
Random rand = new Random();
|
||||
int randomInt = rand.nextInt(150);
|
||||
if (randomInt == 9) {
|
||||
try {
|
||||
p.addPotionEffect(new PotionEffect(Config.potionVisExhaustID, 1000, 2));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) {
|
||||
switch (rank) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, tainturgy };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, corrosive };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -24,130 +25,115 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusTaintedBlast extends ItemFocusBasic
|
||||
{
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.EARTH, 500).add(Aspect.WATER, 500);
|
||||
public class ItemFocusTaintedBlast extends ItemFocusBasic {
|
||||
|
||||
public static IIcon depthIcon;
|
||||
public static IIcon ornIcon;
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.EARTH, 500)
|
||||
.add(Aspect.WATER, 500);
|
||||
|
||||
public ItemFocusTaintedBlast ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTaintedBlast");
|
||||
}
|
||||
public static IIcon depthIcon;
|
||||
public static IIcon ornIcon;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth");
|
||||
this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast_orn");
|
||||
}
|
||||
public ItemFocusTaintedBlast() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTaintedBlast");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth");
|
||||
this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast_orn");
|
||||
}
|
||||
|
||||
public IIcon getOrnament (ItemStack s)
|
||||
{
|
||||
return this.ornIcon;
|
||||
}
|
||||
public IIcon getFocusDepthLayerIcon(ItemStack s) {
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "SHOCKWAVE" + super.getSortingHelper(s);
|
||||
}
|
||||
public IIcon getOrnament(ItemStack s) {
|
||||
return this.ornIcon;
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 13107455;
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "SHOCKWAVE" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return costBase;
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
return 13107455;
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 15000;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return costBase;
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return 15000;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
public boolean isVisCostPerTick(ItemStack s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b)
|
||||
{
|
||||
super.addInformation(s, p, l, b);
|
||||
l.add(" ");
|
||||
l.add(EnumChatFormatting.BLUE + "+" + new String(this.isUpgradedWith(s, FocusUpgradeType.enlarge) ? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.enlarge)) : "15") + " " + StatCollector.translateToLocal("text.radius"));
|
||||
}
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
@Override
|
||||
public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {
|
||||
super.addInformation(s, p, l, b);
|
||||
l.add(" ");
|
||||
l.add(
|
||||
EnumChatFormatting.BLUE + "+"
|
||||
+ new String(
|
||||
this.isUpgradedWith(s, FocusUpgradeType.enlarge)
|
||||
? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.enlarge))
|
||||
: "15")
|
||||
+ " "
|
||||
+ StatCollector.translateToLocal("text.radius"));
|
||||
}
|
||||
|
||||
int pot = wand.getFocusPotency(s);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
List<EntityLivingBase> ents = w.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge), 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge), 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge)));
|
||||
if (ents != null && ents.size() > 0)
|
||||
{
|
||||
for (int a = 0; a < ents.size(); a++)
|
||||
{
|
||||
EntityLivingBase e = ents.get(a);
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
if (e != p && e.isEntityAlive() && !e.isEntityInvulnerable())
|
||||
{
|
||||
double dist = TaintedMagicHelper.getDistanceTo(e.posX, e.posY, e.posZ, p);
|
||||
if (dist < 7.0D) e.attackEntityFrom(DamageSource.magic, 2.0F);
|
||||
Vector3 movement = TaintedMagicHelper.getDistanceBetween(e, p);
|
||||
e.addVelocity(movement.x * 3, 0.8, movement.z * 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "taintedmagic:shockwave", 5.0F, 1.0F * (float) Math.random());
|
||||
TaintedMagic.proxy.spawnShockwaveParticles(p.worldObj);
|
||||
return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
int pot = wand.getFocusPotency(s);
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) {
|
||||
List<EntityLivingBase> ents = w.getEntitiesWithinAABB(
|
||||
EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(
|
||||
15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge),
|
||||
15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge),
|
||||
15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge)));
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (int a = 0; a < ents.size(); a++) {
|
||||
EntityLivingBase e = ents.get(a);
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank)
|
||||
{
|
||||
switch (rank)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.enlarge };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (e != p && e.isEntityAlive() && !e.isEntityInvulnerable()) {
|
||||
double dist = TaintedMagicHelper.getDistanceTo(e.posX, e.posY, e.posZ, p);
|
||||
if (dist < 7.0D) e.attackEntityFrom(DamageSource.magic, 2.0F);
|
||||
Vector3 movement = TaintedMagicHelper.getDistanceBetween(e, p);
|
||||
e.addVelocity(movement.x * 3, 0.8, movement.z * 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
w.playSoundAtEntity(p, "taintedmagic:shockwave", 5.0F, 1.0F * (float) Math.random());
|
||||
TaintedMagic.proxy.spawnShockwaveParticles(p.worldObj);
|
||||
return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) {
|
||||
switch (rank) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -18,84 +19,73 @@ import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusTime extends ItemFocusBasic
|
||||
{
|
||||
IIcon depthIcon = null;
|
||||
public class ItemFocusTime extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
IIcon depthIcon = null;
|
||||
|
||||
public ItemFocusTime ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTime");
|
||||
}
|
||||
private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000)
|
||||
.add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTime");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth");
|
||||
}
|
||||
public ItemFocusTime() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusTime");
|
||||
}
|
||||
|
||||
public IIcon getFocusDepthLayerIcon (ItemStack s)
|
||||
{
|
||||
return this.depthIcon;
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusTime");
|
||||
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth");
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "TIME" + super.getSortingHelper(s);
|
||||
}
|
||||
public IIcon getFocusDepthLayerIcon(ItemStack s) {
|
||||
return this.depthIcon;
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
return player == null ? 0xFFFFFF : Color.HSBtoRGB(player.ticksExisted * 16 % 360 / 360F, 1F, 1F);
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "TIME" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
return player == null ? 0xFFFFFF : Color.HSBtoRGB(player.ticksExisted * 16 % 360 / 360F, 1F, 1F);
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000)
|
||||
.add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
|
||||
}
|
||||
|
||||
public boolean isVisCostPerTick (ItemStack s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
public boolean isVisCostPerTick(ItemStack s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
WandManager.setCooldown(p, 30000);
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
w.setWorldTime(w.isDaytime() ? 14000 : 0);
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
WandManager.setCooldown(p, 30000);
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack (ItemStack s, int i)
|
||||
{
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
return p == null ? 0xFFFFFF : Color.HSBtoRGB(p.ticksExisted * 16 % 360 / 360F, 1F, 1F);
|
||||
}
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) {
|
||||
w.setWorldTime(w.isDaytime() ? 14000 : 0);
|
||||
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (ItemStack s)
|
||||
{
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
@Override
|
||||
public int getColorFromItemStack(ItemStack s, int i) {
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
return p == null ? 0xFFFFFF : Color.HSBtoRGB(p.ticksExisted * 16 % 360 / 360F, 1F, 1F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack s) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -10,6 +8,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityHomingShard;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -18,99 +17,89 @@ import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.utils.EntityUtils;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* this class is based off of ItemFocusShard.class created by <Azanor> as part
|
||||
* of Thaumcraft 5
|
||||
* this class is based off of ItemFocusShard.class created by <Azanor> as part of Thaumcraft 5
|
||||
*/
|
||||
public class ItemFocusVisShard extends ItemFocusBasic
|
||||
{
|
||||
private static final AspectList cost = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.AIR, 1);
|
||||
private static final AspectList costPersistant = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.WATER, 1).add(Aspect.AIR, 1);
|
||||
public class ItemFocusVisShard extends ItemFocusBasic {
|
||||
|
||||
public static FocusUpgradeType persistant = new FocusUpgradeType(69, new ResourceLocation("taintedmagic:textures/foci/IconPersistant.png"), "focus.upgrade.persistant.name", "focus.upgrade.persistant.text", new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1));
|
||||
private static final AspectList cost = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1)
|
||||
.add(Aspect.AIR, 1);
|
||||
private static final AspectList costPersistant = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1)
|
||||
.add(Aspect.WATER, 1).add(Aspect.AIR, 1);
|
||||
|
||||
public ItemFocusVisShard ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusVisShard");
|
||||
}
|
||||
public static FocusUpgradeType persistant = new FocusUpgradeType(
|
||||
69,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconPersistant.png"),
|
||||
"focus.upgrade.persistant.name",
|
||||
"focus.upgrade.persistant.text",
|
||||
new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1));
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (IIconRegister ir)
|
||||
{
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusVisShard");
|
||||
}
|
||||
public ItemFocusVisShard() {
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
this.setUnlocalizedName("ItemFocusVisShard");
|
||||
}
|
||||
|
||||
public String getSortingHelper (ItemStack s)
|
||||
{
|
||||
return "SHARD" + super.getSortingHelper(s);
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon("taintedmagic:ItemFocusVisShard");
|
||||
}
|
||||
|
||||
public int getFocusColor (ItemStack s)
|
||||
{
|
||||
return 10037693;
|
||||
}
|
||||
public String getSortingHelper(ItemStack s) {
|
||||
return "SHARD" + super.getSortingHelper(s);
|
||||
}
|
||||
|
||||
public int getActivationCooldown (ItemStack s)
|
||||
{
|
||||
return 300;
|
||||
}
|
||||
public int getFocusColor(ItemStack s) {
|
||||
return 10037693;
|
||||
}
|
||||
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s)
|
||||
{
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
public int getActivationCooldown(ItemStack s) {
|
||||
return 300;
|
||||
}
|
||||
|
||||
public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop)
|
||||
{
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
Entity look = EntityUtils.getPointedEntity(p.worldObj, p, 0.0D, 32.0D, 1.1F);
|
||||
if (look != null && look instanceof EntityLivingBase)
|
||||
{
|
||||
if (!w.isRemote)
|
||||
{
|
||||
EntityHomingShard blast = new EntityHomingShard(w, p, (EntityLivingBase) look, wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), persistant));
|
||||
w.spawnEntityInWorld(blast);
|
||||
w.playSoundAtEntity(blast, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
p.swingItem();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) {
|
||||
ItemWandCasting wand = (ItemWandCasting) s.getItem();
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, persistant) ? costPersistant : cost;
|
||||
}
|
||||
Entity look = EntityUtils.getPointedEntity(p.worldObj, p, 0.0D, 32.0D, 1.1F);
|
||||
if (look != null && look instanceof EntityLivingBase) {
|
||||
if (!w.isRemote) {
|
||||
EntityHomingShard blast = new EntityHomingShard(
|
||||
w,
|
||||
p,
|
||||
(EntityLivingBase) look,
|
||||
wand.getFocusPotency(s),
|
||||
isUpgradedWith(wand.getFocusItem(s), persistant));
|
||||
w.spawnEntityInWorld(blast);
|
||||
w.playSoundAtEntity(blast, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
|
||||
}
|
||||
p.swingItem();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int r)
|
||||
{
|
||||
switch (r)
|
||||
{
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{
|
||||
FocusUpgradeType.frugal,
|
||||
FocusUpgradeType.potency,
|
||||
persistant };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public AspectList getVisCost(ItemStack s) {
|
||||
return isUpgradedWith(s, persistant) ? costPersistant : cost;
|
||||
}
|
||||
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int r) {
|
||||
switch (r) {
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, persistant };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user