diff --git a/dependencies.gradle b/dependencies.gradle index c773c51..c454348 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1 +1,7 @@ -dependencies {} +repositories { + mavenLocal() +} + +dependencies { + compileOnlyApi('mods.flammpfeil.slashblade:SlashBlade:mc1.7.10-r87') +} diff --git a/src/main/java/com/moe/allweapon/AllWeaponLimits.java b/src/main/java/com/moe/allweapon/AllWeaponLimits.java index ba9db6d..ab7e7ae 100644 --- a/src/main/java/com/moe/allweapon/AllWeaponLimits.java +++ b/src/main/java/com/moe/allweapon/AllWeaponLimits.java @@ -10,11 +10,11 @@ public final class AllWeaponLimits { } public static boolean isOnCooldown(NBTTagCompound tag, World world, String key, long ticks) { - long now = world.func_82737_E(); - if (tag.func_74763_f(key) > now) { + long now = world.getTotalWorldTime(); + if (tag.getLong(key) > now) { return true; } - tag.func_74772_a(key, now + ticks); + tag.setLong(key, now + ticks); return false; } diff --git a/src/main/java/com/moe/allweapon/Blade/BaiLan.java b/src/main/java/com/moe/allweapon/Blade/BaiLan.java index 0a298a6..2da52bd 100644 --- a/src/main/java/com/moe/allweapon/Blade/BaiLan.java +++ b/src/main/java/com/moe/allweapon/Blade/BaiLan.java @@ -38,9 +38,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.bailan"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1704, new SAhuanyingdie()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1704)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -50,7 +50,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/BaiQiYue.java b/src/main/java/com/moe/allweapon/Blade/BaiQiYue.java index b054f3d..ce18f7d 100644 --- a/src/main/java/com/moe/allweapon/Blade/BaiQiYue.java +++ b/src/main/java/com/moe/allweapon/Blade/BaiQiYue.java @@ -40,9 +40,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.baishiyue"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(120)); ItemSlashBladeNamed.IsDefaultBewitched.set(tag, Boolean.valueOf(true)); @@ -51,10 +51,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/baiqiyue/texture"); ItemSlashBlade.ModelName.set(tag, "named/baiqiyue/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77332_c, 6); + customblade.addEnchantment(Enchantment.fireAspect, 6); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/BaiShouJianWang.java b/src/main/java/com/moe/allweapon/Blade/BaiShouJianWang.java index 1a2c419..22afb4a 100644 --- a/src/main/java/com/moe/allweapon/Blade/BaiShouJianWang.java +++ b/src/main/java/com/moe/allweapon/Blade/BaiShouJianWang.java @@ -40,9 +40,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.baishoujianwang"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1706, new SAliedi()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1706)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -51,10 +51,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/baishoujianwang/texture"); ItemSlashBlade.ModelName.set(tag, "named/baishoujianwang/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77338_j, 10); + customblade.addEnchantment(Enchantment.silkTouch, 10); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/BaiYueDing.java b/src/main/java/com/moe/allweapon/Blade/BaiYueDing.java index ca469f4..d2bbe4e 100644 --- a/src/main/java/com/moe/allweapon/Blade/BaiYueDing.java +++ b/src/main/java/com/moe/allweapon/Blade/BaiYueDing.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.baiyueding"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1709, new SAweizhan()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1709)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -52,10 +52,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/baiyueding/texture"); ItemSlashBlade.ModelName.set(tag, "named/baiyueding/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77332_c, 6); + customblade.addEnchantment(Enchantment.fireAspect, 6); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/ChanShiZhe.java b/src/main/java/com/moe/allweapon/Blade/ChanShiZhe.java index 29c600d..4f20c2a 100644 --- a/src/main/java/com/moe/allweapon/Blade/ChanShiZhe.java +++ b/src/main/java/com/moe/allweapon/Blade/ChanShiZhe.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.chanshizhe"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1710, new SAxingbao()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1710)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -52,12 +52,12 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/chanshizhe/texture"); ItemSlashBlade.ModelName.set(tag, "named/chanshizhe/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77337_m, 6); - customblade.func_77966_a(Enchantment.field_77344_u, 6); - customblade.func_77966_a(Enchantment.field_77342_w, 20); + customblade.addEnchantment(Enchantment.looting, 6); + customblade.addEnchantment(Enchantment.unbreaking, 6); + customblade.addEnchantment(Enchantment.featherFalling, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/FengShen.java b/src/main/java/com/moe/allweapon/Blade/FengShen.java index 722c285..3c667ff 100644 --- a/src/main/java/com/moe/allweapon/Blade/FengShen.java +++ b/src/main/java/com/moe/allweapon/Blade/FengShen.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.fengshen"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1701, new SAbaoku()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1701)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -53,12 +53,12 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/fengshen/texture"); ItemSlashBlade.ModelName.set(tag, "named/fengshen/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77342_w, 20); - customblade.func_77966_a(Enchantment.field_77338_j, 20); - customblade.func_77966_a(Enchantment.field_77335_o, 20); + customblade.addEnchantment(Enchantment.featherFalling, 20); + customblade.addEnchantment(Enchantment.silkTouch, 20); + customblade.addEnchantment(Enchantment.respiration, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/FengZhiYing.java b/src/main/java/com/moe/allweapon/Blade/FengZhiYing.java index 6844cc9..c05917d 100644 --- a/src/main/java/com/moe/allweapon/Blade/FengZhiYing.java +++ b/src/main/java/com/moe/allweapon/Blade/FengZhiYing.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.fengzhiying"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1702, new SAfengxuan()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1702)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -52,10 +52,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/fengzhiying/texture"); ItemSlashBlade.ModelName.set(tag, "named/fengzhiying/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77330_e, 20); + customblade.addEnchantment(Enchantment.fortune, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/GuangJian.java b/src/main/java/com/moe/allweapon/Blade/GuangJian.java index cd90682..66f43b3 100644 --- a/src/main/java/com/moe/allweapon/Blade/GuangJian.java +++ b/src/main/java/com/moe/allweapon/Blade/GuangJian.java @@ -40,9 +40,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.guangjian"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1708, new SAqicai()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1708)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -51,10 +51,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/guangjian/texture"); ItemSlashBlade.ModelName.set(tag, "named/guangjian/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77342_w, 20); + customblade.addEnchantment(Enchantment.featherFalling, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/HuaMi.java b/src/main/java/com/moe/allweapon/Blade/HuaMi.java index 04d87cd..da2c3db 100644 --- a/src/main/java/com/moe/allweapon/Blade/HuaMi.java +++ b/src/main/java/com/moe/allweapon/Blade/HuaMi.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.huami"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1705, new SAhuanyingdie2()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1705)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -52,10 +52,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/huami/texture"); ItemSlashBlade.ModelName.set(tag, "named/huami/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77327_f, 20); + customblade.addEnchantment(Enchantment.protection, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/HuaTianKuangGu.java b/src/main/java/com/moe/allweapon/Blade/HuaTianKuangGu.java index f392577..d351d9c 100644 --- a/src/main/java/com/moe/allweapon/Blade/HuaTianKuangGu.java +++ b/src/main/java/com/moe/allweapon/Blade/HuaTianKuangGu.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.htkg"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1709, new SAweizhan()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1709)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -52,10 +52,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/htkg/texture"); ItemSlashBlade.ModelName.set(tag, "named/htkg/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77336_l, 20); + customblade.addEnchantment(Enchantment.baneOfArthropods, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/JiYi.java b/src/main/java/com/moe/allweapon/Blade/JiYi.java index 6d36bfe..f1656cb 100644 --- a/src/main/java/com/moe/allweapon/Blade/JiYi.java +++ b/src/main/java/com/moe/allweapon/Blade/JiYi.java @@ -41,11 +41,11 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.jiyi"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1703, new SAfuzhan()); - customblade.func_77966_a(Enchantment.field_77347_r, 20); + customblade.addEnchantment(Enchantment.blastProtection, 20); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1703)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(120)); @@ -55,7 +55,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/Jie.java b/src/main/java/com/moe/allweapon/Blade/Jie.java index 330d1fb..09d2f7c 100644 --- a/src/main/java/com/moe/allweapon/Blade/Jie.java +++ b/src/main/java/com/moe/allweapon/Blade/Jie.java @@ -41,9 +41,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.jie"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1709, new SAweizhan()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1709)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -52,10 +52,10 @@ extends ItemShears { ItemSlashBlade.TextureName.set(tag, "named/jie/texture"); ItemSlashBlade.ModelName.set(tag, "named/jie/model"); ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); - customblade.func_77966_a(Enchantment.field_77339_k, 20); + customblade.addEnchantment(Enchantment.smite, 20); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/LiuRenRuoHuo.java b/src/main/java/com/moe/allweapon/Blade/LiuRenRuoHuo.java index 2769b70..a7b4fff 100644 --- a/src/main/java/com/moe/allweapon/Blade/LiuRenRuoHuo.java +++ b/src/main/java/com/moe/allweapon/Blade/LiuRenRuoHuo.java @@ -42,13 +42,13 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.lrrh"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1703, new SAfuzhan()); - customblade.func_77966_a(Enchantment.field_77329_d, 20); - customblade.func_77966_a(Enchantment.field_77334_n, 20); - customblade.func_77966_a(Enchantment.field_77343_v, 20); + customblade.addEnchantment(Enchantment.efficiency, 20); + customblade.addEnchantment(Enchantment.aquaAffinity, 20); + customblade.addEnchantment(Enchantment.projectileProtection, 20); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1703)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(100)); @@ -58,7 +58,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/LvLuo.java b/src/main/java/com/moe/allweapon/Blade/LvLuo.java index 7ff17d8..9a4e949 100644 --- a/src/main/java/com/moe/allweapon/Blade/LvLuo.java +++ b/src/main/java/com/moe/allweapon/Blade/LvLuo.java @@ -38,9 +38,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.lvluo"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(120)); @@ -50,7 +50,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/QingGui.java b/src/main/java/com/moe/allweapon/Blade/QingGui.java index f22ccf0..7187c5d 100644 --- a/src/main/java/com/moe/allweapon/Blade/QingGui.java +++ b/src/main/java/com/moe/allweapon/Blade/QingGui.java @@ -37,9 +37,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.qinggui"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(120)); @@ -49,7 +49,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/SA.java b/src/main/java/com/moe/allweapon/Blade/SA.java index 198ebc3..6f68f26 100644 --- a/src/main/java/com/moe/allweapon/Blade/SA.java +++ b/src/main/java/com/moe/allweapon/Blade/SA.java @@ -1,6 +1,6 @@ /* * Decompiled with CFR 0.152. - * + * * Could not load the following classes: * mods.flammpfeil.slashblade.ItemSlashBlade * mods.flammpfeil.slashblade.ItemSlashBlade$ComboSequence @@ -15,7 +15,6 @@ package com.moe.allweapon.Blade; import java.util.Random; import mods.flammpfeil.slashblade.ItemSlashBlade; -import mods.flammpfeil.slashblade.specialattack.IJustSpecialAttack; import mods.flammpfeil.slashblade.specialattack.SpecialAttackBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -29,22 +28,17 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { Random random; - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); Integer[] Key = ItemSlashBlade.specialAttacks.keySet().toArray(new Integer[0]); Integer randomKey = Key[(random = new Random()).nextInt(Key.length)]; SpecialAttackBase randomValue = (SpecialAttackBase)ItemSlashBlade.specialAttacks.get(randomKey); SpecialAttackBase sa = randomValue; - if (sa instanceof IJustSpecialAttack) { - ((IJustSpecialAttack)sa).doJustSpacialAttack(stack, player); - } else { - sa.doSpacialAttack(stack, player); - } + sa.doSpacialAttack(stack, player); } ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); } } - diff --git a/src/main/java/com/moe/allweapon/Blade/XiaoYue.java b/src/main/java/com/moe/allweapon/Blade/XiaoYue.java index 10fb201..a6fa8e7 100644 --- a/src/main/java/com/moe/allweapon/Blade/XiaoYue.java +++ b/src/main/java/com/moe/allweapon/Blade/XiaoYue.java @@ -37,9 +37,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.xiaoyue"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(120)); @@ -49,7 +49,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/XueZou.java b/src/main/java/com/moe/allweapon/Blade/XueZou.java index 9a55822..aa375bd 100644 --- a/src/main/java/com/moe/allweapon/Blade/XueZou.java +++ b/src/main/java/com/moe/allweapon/Blade/XueZou.java @@ -41,14 +41,14 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.xuezou"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1711, new SAxuepo()); - customblade.func_77966_a(Enchantment.field_77340_h, 20); - customblade.func_77966_a(Enchantment.field_77341_i, 20); - customblade.func_77966_a(Enchantment.field_151370_z, 20); - customblade.func_77978_p().func_74778_a("NamedBlades", "flammpfeil.slashblade:" + this.name); + customblade.addEnchantment(Enchantment.sharpness, 20); + customblade.addEnchantment(Enchantment.power, 20); + customblade.addEnchantment(Enchantment.field_151370_z, 20); + customblade.getTagCompound().setString("NamedBlades", "flammpfeil.slashblade:" + this.name); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1711)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); ItemSlashBladeNamed.CustomMaxDamage.set(tag, Integer.valueOf(120)); @@ -58,7 +58,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/YingYue.java b/src/main/java/com/moe/allweapon/Blade/YingYue.java index 30e8850..d0a667b 100644 --- a/src/main/java/com/moe/allweapon/Blade/YingYue.java +++ b/src/main/java/com/moe/allweapon/Blade/YingYue.java @@ -38,9 +38,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.yingyue"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1810, new SA()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1810)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -51,7 +51,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/YouMing.java b/src/main/java/com/moe/allweapon/Blade/YouMing.java index 3ea419c..a2c16c1 100644 --- a/src/main/java/com/moe/allweapon/Blade/YouMing.java +++ b/src/main/java/com/moe/allweapon/Blade/YouMing.java @@ -40,12 +40,12 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.youming"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); - customblade.func_77966_a(Enchantment.field_77335_o, 5); - customblade.func_77966_a(Enchantment.field_77339_k, 20); - customblade.func_77978_p().func_74778_a("NamedBlades", "flammpfeil.slashblade:" + this.name); + customblade.setTagCompound(tag); + customblade.addEnchantment(Enchantment.respiration, 5); + customblade.addEnchantment(Enchantment.smite, 20); + customblade.getTagCompound().setString("NamedBlades", "flammpfeil.slashblade:" + this.name); ItemSlashBlade.TextureName.set(tag, "named/youming/texture"); ItemSlashBlade.ModelName.set(tag, "named/youming/model"); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1)); @@ -55,7 +55,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Blade/ZhanYue.java b/src/main/java/com/moe/allweapon/Blade/ZhanYue.java index 3409cf8..9de083c 100644 --- a/src/main/java/com/moe/allweapon/Blade/ZhanYue.java +++ b/src/main/java/com/moe/allweapon/Blade/ZhanYue.java @@ -38,9 +38,9 @@ extends ItemShears { @SubscribeEvent public void init(LoadEvent.InitEvent event) { String name = "flammpfeil.slashblade.named.zhanyue"; - ItemStack customblade = new ItemStack((Item)SlashBlade.bladeNamed, 1, 0); + ItemStack customblade = new ItemStack(SlashBlade.bladeNamed,1,0); NBTTagCompound tag = new NBTTagCompound(); - customblade.func_77982_d(tag); + customblade.setTagCompound(tag); ItemSlashBlade.specialAttacks.put(1712, new SAyueyatianchong()); ItemSlashBlade.SpecialAttackType.set(tag, Integer.valueOf(1712)); ItemSlashBladeNamed.CurrentItemName.set(tag, name); @@ -51,7 +51,7 @@ extends ItemShears { ItemSlashBlade.StandbyRenderType.set(tag, Integer.valueOf(2)); GameRegistry.registerCustomItemStack((String)name, (ItemStack)customblade); ItemSlashBladeNamed.NamedBlades.add("flammpfeil.slashblade:" + name); - AchievementList.registerAchievement((String)name, (ItemStack)customblade, (Achievement)null); + AchievementList.registerCraftingAchievement(name, customblade, (Achievement)null); } } diff --git a/src/main/java/com/moe/allweapon/Entityadd/EntityDriveAdd.java b/src/main/java/com/moe/allweapon/Entityadd/EntityDriveAdd.java index dde45b7..8ddb9df 100644 --- a/src/main/java/com/moe/allweapon/Entityadd/EntityDriveAdd.java +++ b/src/main/java/com/moe/allweapon/Entityadd/EntityDriveAdd.java @@ -80,225 +80,222 @@ implements IThrowableEntity { public EntityDriveAdd(World par1World, EntityLivingBase entityLiving, float AttackLevel) { this(par1World); this.AttackLevel = AttackLevel; - this.field_70129_M = entityLiving.func_70047_e() / 2.0f; + this.width = entityLiving.getEyeHeight() / 2.0f; this.thrower = entityLiving; - if (this.blade != null && !(this.blade.func_77973_b() instanceof ItemSlashBlade)) { + if (this.blade != null && !(this.blade.getItem() instanceof ItemSlashBlade)) { this.blade = null; } this.alreadyHitEntity.clear(); this.alreadyHitEntity.add(this.thrower); - this.alreadyHitEntity.add(this.thrower.field_70154_o); - this.alreadyHitEntity.add(this.thrower.field_70153_n); - this.field_70173_aa = 0; - this.func_70105_a(2.0f, 4.0f); - this.func_70012_b(this.thrower.field_70165_t, this.thrower.field_70163_u + (double)this.thrower.func_70047_e() / 2.0, this.thrower.field_70161_v, this.thrower.field_70177_z, this.thrower.field_70125_A); + this.alreadyHitEntity.add(this.thrower.riddenByEntity); + this.alreadyHitEntity.add(this.thrower.ridingEntity); + this.ticksExisted = 0; + this.setSize(2.0f, 4.0f); + this.setLocationAndAngles(this.thrower.posX, this.thrower.posY + (double)this.thrower.getEyeHeight() / 2.0, this.thrower.posZ, this.thrower.rotationYaw, this.thrower.rotationPitch); this.setDriveVector(0.75f); - this.func_70107_b(this.field_70165_t + this.field_70159_w, this.field_70163_u + this.field_70181_x, this.field_70161_v + this.field_70179_y); + this.setPosition(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); } - protected void func_70088_a() { - this.func_70096_w().func_75682_a(4, (Object)0); - this.func_70096_w().func_75682_a(5, (Object)Float.valueOf(0.0f)); - this.func_70096_w().func_75682_a(10, (Object)0x3333FF); - this.func_70096_w().func_75682_a(11, (Object)Float.valueOf(1.0f)); - this.func_70096_w().func_75682_a(12, (Object)Float.valueOf(0.25f)); - this.func_70096_w().func_75682_a(13, (Object)Float.valueOf(1.0f)); - this.func_70096_w().func_75682_a(6, (Object)20); - this.func_70096_w().func_75682_a(21, (Object)Float.valueOf(1.05f)); - this.func_70096_w().func_75682_a(22, (Object)Float.valueOf(0.0f)); - this.func_70096_w().func_75682_a(23, (Object)0); - this.func_70096_w().func_75682_a(24, (Object)String.valueOf("")); - this.func_70096_w().func_75682_a(25, (Object)String.valueOf("")); - this.func_70096_w().func_75682_a(7, (Object)0); - this.func_70096_w().func_75682_a(26, (Object)1); + protected void entityInit() { + this.dataWatcher.addObject(4, (Object)0); + this.dataWatcher.addObject(5, (Object)Float.valueOf(0.0f)); + this.dataWatcher.addObject(10, (Object)0x3333FF); + this.dataWatcher.addObject(11, (Object)Float.valueOf(1.0f)); + this.dataWatcher.addObject(12, (Object)Float.valueOf(0.25f)); + this.dataWatcher.addObject(13, (Object)Float.valueOf(1.0f)); + this.dataWatcher.addObject(6, (Object)20); + this.dataWatcher.addObject(21, (Object)Float.valueOf(1.05f)); + this.dataWatcher.addObject(22, (Object)Float.valueOf(0.0f)); + this.dataWatcher.addObject(23, (Object)0); + this.dataWatcher.addObject(24, (Object)String.valueOf("")); + this.dataWatcher.addObject(25, (Object)String.valueOf("")); + this.dataWatcher.addObject(7, (Object)0); + this.dataWatcher.addObject(26, (Object)1); } public boolean getIsPlayerSound() { - return this.func_70096_w().func_75683_a(26) == 0; + return this.dataWatcher.getWatchableObjectInt(26) == 0; } public void setIsPlayerSound(boolean isPlaySound) { - this.func_70096_w().func_75692_b(26, (Object)((byte)(!isPlaySound ? 1 : 0))); + this.dataWatcher.updateObject(26, (Object)((byte)(!isPlaySound ? 1 : 0))); } public float getInitSpeed() { - return this.func_70096_w().func_111145_d(21); + return this.dataWatcher.getWatchableObjectFloat(21); } public void setInitSpeed(float value) { - this.func_70096_w().func_75692_b(21, (Object)Float.valueOf(value)); + this.dataWatcher.updateObject(21, (Object)Float.valueOf(value)); } public float getNextSpeed() { - return this.func_70096_w().func_111145_d(22); + return this.dataWatcher.getWatchableObjectFloat(22); } public void setNextSpeed(float value) { - this.func_70096_w().func_75692_b(22, (Object)Float.valueOf(value)); + this.dataWatcher.updateObject(22, (Object)Float.valueOf(value)); } public int getChangeTime() { - return this.func_70096_w().func_75679_c(23); + return this.dataWatcher.getWatchableObjectInt(23); } public void setChangeTime(int value) { - this.func_70096_w().func_75692_b(23, (Object)value); + this.dataWatcher.updateObject(23, (Object)value); } public String getSound() { - return this.func_70096_w().func_75681_e(24); + return this.dataWatcher.getWatchableObjectString(24); } public void setSound(String value) { - this.func_70096_w().func_75692_b(24, (Object)String.valueOf(value)); + this.dataWatcher.updateObject(24, (Object)String.valueOf(value)); } public String getParticle() { - return this.func_70096_w().func_75681_e(25); + return this.dataWatcher.getWatchableObjectString(25); } public void setParticle(String value) { - this.func_70096_w().func_75692_b(25, (Object)String.valueOf(value)); + this.dataWatcher.updateObject(25, (Object)String.valueOf(value)); } public float getc() { - return this.func_70096_w().func_111145_d(11); + return this.dataWatcher.getWatchableObjectFloat(11); } public void setc(Float value) { - this.func_70096_w().func_75692_b(11, (Object)Float.valueOf(value.floatValue())); + this.dataWatcher.updateObject(11, (Object)Float.valueOf(value.floatValue())); } public float getk() { - return this.func_70096_w().func_111145_d(12); + return this.dataWatcher.getWatchableObjectFloat(12); } public void setk(Float value) { - this.func_70096_w().func_75692_b(12, (Object)Float.valueOf(value.floatValue())); + this.dataWatcher.updateObject(12, (Object)Float.valueOf(value.floatValue())); } public float getg() { - return this.func_70096_w().func_111145_d(13); + return this.dataWatcher.getWatchableObjectFloat(13); } public void setg(Float value) { - this.func_70096_w().func_75692_b(13, (Object)Float.valueOf(value.floatValue())); + this.dataWatcher.updateObject(13, (Object)Float.valueOf(value.floatValue())); } public int getColor() { - return this.func_70096_w().func_75679_c(10); + return this.dataWatcher.getWatchableObjectInt(10); } public void setColor(int value) { - this.func_70096_w().func_75692_b(10, (Object)value); + this.dataWatcher.updateObject(10, (Object)value); } public boolean getIsMultiHit() { - return this.func_70096_w().func_75683_a(4) == 0; + return this.dataWatcher.getWatchableObjectInt(4) == 0; } public void setIsMultiHit(boolean isMultiHit) { - this.func_70096_w().func_75692_b(4, (Object)((byte)(isMultiHit ? 1 : 0))); + this.dataWatcher.updateObject(4, (Object)((byte)(isMultiHit ? 1 : 0))); } public float getRoll() { - return this.func_70096_w().func_111145_d(5); + return this.dataWatcher.getWatchableObjectFloat(5); } public void setRoll(float roll) { - this.func_70096_w().func_75692_b(5, (Object)Float.valueOf(roll)); + this.dataWatcher.updateObject(5, (Object)Float.valueOf(roll)); } public int getLifeTime() { - return this.func_70096_w().func_75679_c(6); + return this.dataWatcher.getWatchableObjectInt(6); } public void setLifeTime(int lifetime) { - this.func_70096_w().func_75692_b(6, (Object)lifetime); + this.dataWatcher.updateObject(6, (Object)lifetime); } public boolean getIsSlashDimension() { - return this.func_70096_w().func_75683_a(7) == 1; + return this.dataWatcher.getWatchableObjectInt(7) == 1; } public void setIsSlashDimension(boolean isSlashDimension) { - this.func_70096_w().func_75692_b(7, (Object)((byte)(isSlashDimension ? 1 : 0))); + this.dataWatcher.updateObject(7, (Object)((byte)(isSlashDimension ? 1 : 0))); } public void setInitialSpeed(float f) { - this.func_70012_b(this.thrower.field_70165_t, this.thrower.field_70163_u + (double)this.thrower.func_70047_e() / 2.0, this.thrower.field_70161_v, this.thrower.field_70177_z, this.thrower.field_70125_A); + this.setLocationAndAngles(this.thrower.posX, this.thrower.posY + (double)this.thrower.getEyeHeight() / 2.0, this.thrower.posZ, this.thrower.rotationYaw, this.thrower.rotationPitch); this.setDriveVector(f); } public void setDriveVector(float fYVecOfst) { - float fYawDtoR = this.field_70177_z / 180.0f * 3.141593f; - float fPitDtoR = this.field_70125_A / 180.0f * 3.141593f; - this.field_70159_w = -MathHelper.func_76126_a((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst; - this.field_70181_x = -MathHelper.func_76126_a((float)fPitDtoR) * fYVecOfst; - this.field_70179_y = MathHelper.func_76134_b((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst; - float f3 = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70126_B = this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70127_C = this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f3) * 180.0 / Math.PI); + float fYawDtoR = this.rotationYaw / 180.0f * 3.141593f; + float fPitDtoR = this.rotationPitch / 180.0f * 3.141593f; + this.motionX = -MathHelper.sin((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst; + this.motionY = -MathHelper.sin((float)fPitDtoR) * fYVecOfst; + this.motionZ = MathHelper.cos((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst; + float f3 = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.prevRotationPitch = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.prevRotationYaw = this.rotationPitch = (float)(Math.atan2(this.motionY, f3) * 180.0 / Math.PI); } - public void func_70071_h_() { + public void onUpdate() { long time = new Date().getTime(); long time_2 = (time - this.startTime) / 1000L; if (time_2 >= 3L) { this.alreadyHitEntity.clear(); this.alreadyHitEntity = null; - this.func_70106_y(); + this.setDead(); return; } - this.field_70142_S = this.field_70165_t; - this.field_70137_T = this.field_70163_u; - this.field_70136_U = this.field_70161_v; - if (!this.field_70170_p.field_72995_K) { + if (!this.worldObj.isRemote) { int nPosZ; int nPosY; int nPosX; Block nBlock; double dAmbit = 1.5; - AxisAlignedBB bb = AxisAlignedBB.func_72330_a((double)(this.field_70165_t - dAmbit), (double)(this.field_70163_u - dAmbit), (double)(this.field_70161_v - dAmbit), (double)(this.field_70165_t + dAmbit), (double)(this.field_70163_u + dAmbit), (double)(this.field_70161_v + dAmbit)); + AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(this.posX - dAmbit, this.posY - dAmbit, this.posZ - dAmbit, this.posX + dAmbit, this.posY + dAmbit, this.posZ + dAmbit); if (this.getThrower() instanceof EntityLivingBase) { EntityLivingBase entityLiving = (EntityLivingBase)this.getThrower(); - List list = this.field_70170_p.func_94576_a(this.getThrower(), bb, ItemSlashBlade.DestructableSelector); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.getThrower(), bb, ItemSlashBlade.DestructableSelector); StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.DestructObject); list.removeAll(this.alreadyHitEntity); this.alreadyHitEntity.addAll(list); for (Entity curEntity : (java.util.List)(java.util.List)list) { boolean isDestruction = true; if (curEntity instanceof EntityFireball) { - isDestruction = ((EntityFireball)curEntity).field_70235_a != null && ((EntityFireball)curEntity).field_70235_a.func_145782_y() == entityLiving.func_145782_y() ? false : !curEntity.func_70097_a(DamageSource.func_76358_a((EntityLivingBase)entityLiving), this.AttackLevel / 5.0f); + isDestruction = ((EntityFireball)curEntity).shootingEntity != null && ((EntityFireball)curEntity).shootingEntity.getEntityId() == entityLiving.getEntityId() ? false : !curEntity.attackEntityFrom(DamageSource.causeMobDamage(entityLiving), this.AttackLevel / 5.0f); } else if (curEntity instanceof EntityArrow) { - if (((EntityArrow)curEntity).field_70250_c != null && ((EntityArrow)curEntity).field_70250_c.func_145782_y() == entityLiving.func_145782_y()) { + if (((EntityArrow)curEntity).shootingEntity != null && ((EntityArrow)curEntity).shootingEntity.getEntityId() == entityLiving.getEntityId()) { isDestruction = false; } } else if (curEntity instanceof IThrowableEntity) { - if (((IThrowableEntity)curEntity).getThrower() != null && ((IThrowableEntity)curEntity).getThrower().func_145782_y() == entityLiving.func_145782_y()) { + if (((IThrowableEntity)curEntity).getThrower() != null && ((IThrowableEntity)curEntity).getThrower().getEntityId() == entityLiving.getEntityId()) { isDestruction = false; } - } else if (curEntity instanceof EntityThrowable && ((EntityThrowable)curEntity).func_85052_h() != null && ((EntityThrowable)curEntity).func_85052_h().func_145782_y() == entityLiving.func_145782_y()) { + } else if (curEntity instanceof EntityThrowable && ((EntityThrowable)curEntity).getThrower() != null && ((EntityThrowable)curEntity).getThrower().getEntityId() == entityLiving.getEntityId()) { isDestruction = false; } if (!isDestruction) continue; - curEntity.field_70159_w = 0.0; - curEntity.field_70181_x = 0.0; - curEntity.field_70179_y = 0.0; - curEntity.func_70106_y(); + curEntity.motionX = 0.0; + curEntity.motionY = 0.0; + curEntity.motionZ = 0.0; + curEntity.setDead(); for (int var1 = 0; var1 < 10; ++var1) { Random rand = this.getRand(); double var2 = rand.nextGaussian() * 0.02; double var4 = rand.nextGaussian() * 0.02; double var6 = rand.nextGaussian() * 0.02; double var8 = 10.0; - this.field_70170_p.func_72869_a("explode", curEntity.field_70165_t + (double)(rand.nextFloat() * curEntity.field_70130_N * 2.0f) - (double)curEntity.field_70130_N - var2 * var8, curEntity.field_70163_u + (double)(rand.nextFloat() * curEntity.field_70131_O) - var4 * var8, curEntity.field_70161_v + (double)(rand.nextFloat() * curEntity.field_70130_N * 2.0f) - (double)curEntity.field_70130_N - var6 * var8, var2, var4, var6); + this.worldObj.spawnParticle("explode", curEntity.posX + (double)(rand.nextFloat() * curEntity.width * 2.0f) - (double)curEntity.width - var2 * var8, curEntity.posY + (double)(rand.nextFloat() * curEntity.height) - var4 * var8, curEntity.posZ + (double)(rand.nextFloat() * curEntity.width * 2.0f) - (double)curEntity.width - var6 * var8, var2, var4, var6); } StylishRankManager.doAttack((Entity)this.thrower); } } - if (!this.getIsMultiHit() || this.field_70173_aa % 2 == 0) { - List list = this.field_70170_p.func_94576_a(this.getThrower(), bb, ItemSlashBlade.AttackableSelector); + if (!this.getIsMultiHit() || this.ticksExisted % 2 == 0) { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.getThrower(), bb, ItemSlashBlade.AttackableSelector); list.removeAll(this.alreadyHitEntity); if (!this.getIsMultiHit()) { this.alreadyHitEntity.addAll(list); @@ -311,93 +308,93 @@ implements IThrowableEntity { } for (Entity curEntity : (java.util.List)(java.util.List)list) { float health; - if (this.getIsSlashDimension() && curEntity instanceof EntityLivingBase && 0.0f < (health = ((EntityLivingBase)curEntity).func_110143_aJ())) { + if (this.getIsSlashDimension() && curEntity instanceof EntityLivingBase && 0.0f < (health = ((EntityLivingBase)curEntity).getHealth())) { health = Math.max(1.0f, health - magicDamage); - ((EntityLivingBase)curEntity).func_70606_j(health); + ((EntityLivingBase)curEntity).setHealth(health); } - curEntity.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - curEntity.func_70097_a(ds, magicDamage / 5.0f); + curEntity.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + curEntity.attackEntityFrom(ds, magicDamage / 5.0f); if (this.blade == null || !(curEntity instanceof EntityLivingBase)) continue; - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)curEntity, (EntityLivingBase)this.thrower); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)curEntity, (EntityLivingBase)this.thrower); } } - if ((nBlock = this.field_70170_p.func_147439_a(nPosX = MathHelper.func_76128_c((double)this.field_70165_t), nPosY = MathHelper.func_76128_c((double)this.field_70163_u), nPosZ = MathHelper.func_76128_c((double)this.field_70161_v))).func_149668_a(this.field_70170_p, nPosX, nPosY, nPosZ) != null) { - this.func_70106_y(); + if ((nBlock = this.worldObj.getBlock(nPosX = MathHelper.floor_double((double)this.posX), nPosY = MathHelper.floor_double((double)this.posY), nPosZ = MathHelper.floor_double((double)this.posZ))).getCollisionBoundingBoxFromPool(this.worldObj, nPosX, nPosY, nPosZ) != null && !nBlock.isAir(this.worldObj, nPosX, nPosY, nPosZ)) { + this.setDead(); } } - this.field_70159_w *= 1.049999952316284; - this.field_70181_x *= 1.049999952316284; - this.field_70179_y *= 1.049999952316284; - double m_x = this.field_70159_w; - double m_y = this.field_70181_x; - double m_z = this.field_70179_y; - this.field_70165_t += this.field_70159_w; - this.field_70163_u += this.field_70181_x; - this.field_70161_v += this.field_70179_y; - this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.motionX *= 1.049999952316284; + this.motionY *= 1.049999952316284; + this.motionZ *= 1.049999952316284; + double m_x = this.motionX; + double m_y = this.motionY; + double m_z = this.motionZ; + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + this.setPosition(this.posX, this.posY, this.posZ); int changeTime = this.getChangeTime(); - if (changeTime != 0 && this.field_70173_aa >= changeTime) { + if (changeTime != 0 && this.ticksExisted >= changeTime) { float nextSpeed = this.getNextSpeed(); this.playSound(); - this.field_70159_w = m_x *= (double)nextSpeed; - this.field_70181_x = m_y *= (double)nextSpeed; - this.field_70179_y = m_z *= (double)nextSpeed; - this.field_70165_t += m_x; - this.field_70163_u += m_y; - this.field_70161_v += m_z; + this.motionX = m_x *= (double)nextSpeed; + this.motionY = m_y *= (double)nextSpeed; + this.motionZ = m_z *= (double)nextSpeed; + this.posX += m_x; + this.posY += m_y; + this.posZ += m_z; } else { float initSpeed = this.getInitSpeed(); if (initSpeed >= 1.05f) { - this.field_70159_w = m_x *= (double)initSpeed; - this.field_70181_x = m_y *= (double)initSpeed; - this.field_70179_y = m_z *= (double)initSpeed; - this.field_70165_t += m_x; - this.field_70163_u += m_y; - this.field_70161_v += m_z; + this.motionX = m_x *= (double)initSpeed; + this.motionY = m_y *= (double)initSpeed; + this.motionZ = m_z *= (double)initSpeed; + this.posX += m_x; + this.posY += m_y; + this.posZ += m_z; } else { - this.field_70165_t += this.field_70159_w * 0.1; - this.field_70163_u += this.field_70181_x * 0.1; - this.field_70161_v += this.field_70179_y * 0.1; + this.posX += this.motionX * 0.1; + this.posY += this.motionY * 0.1; + this.posZ += this.motionZ * 0.1; } } this.playParticle(); - this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); - if (this.field_70173_aa >= this.getLifeTime()) { + this.setPosition(this.posX, this.posY, this.posZ); + if (this.ticksExisted >= this.getLifeTime()) { this.alreadyHitEntity.clear(); this.alreadyHitEntity = null; - this.func_70106_y(); + this.setDead(); } } public Random getRand() { - return this.field_70146_Z; + return this.rand; } - public boolean func_70038_c(double par1, double par3, double par5) { + public boolean canBePushed(double par1, double par3, double par5) { return false; } - public void func_70091_d(double par1, double par3, double par5) { + public void moveEntity(double par1, double par3, double par5) { } - protected void func_70081_e(int par1) { + protected void fall(int par1) { } - public boolean func_70072_I() { + public boolean isInWater() { return false; } - public boolean func_70055_a(Material par1Material) { + public boolean isInsideOfMaterial(Material par1Material) { return false; } - public boolean func_70058_J() { + public boolean handleWaterMovement() { return false; } @SideOnly(value=Side.CLIENT) - public int func_70070_b(float par1) { + public int getBrightnessForRender(float par1) { float f1 = 0.5f; if (f1 < 0.0f) { f1 = 0.0f; @@ -405,7 +402,7 @@ implements IThrowableEntity { if (f1 > 1.0f) { f1 = 1.0f; } - int i = super.func_70070_b(par1); + int i = super.getBrightnessForRender(par1); int j = i & 0xFF; int k = i >> 16 & 0xFF; if ((j += (int)(f1 * 15.0f * 16.0f)) > 240) { @@ -414,35 +411,35 @@ implements IThrowableEntity { return j | k << 16; } - public float func_70013_c(float par1) { - float f1 = super.func_70013_c(par1); + public float getBrightness(float par1) { + float f1 = super.getBrightness(par1); float f2 = 0.9f; f2 = f2 * f2 * f2 * f2; return f1 * (1.0f - f2) + f2; } - protected void func_70037_a(NBTTagCompound nbttagcompound) { + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { } - protected void func_70014_b(NBTTagCompound nbttagcompound) { + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { } @SideOnly(value=Side.CLIENT) - public float func_70053_R() { + public float getShadowSize() { return 0.0f; } - public void func_70078_a(Entity par1Entity) { + public void setInWeb(Entity par1Entity) { } @SideOnly(value=Side.CLIENT) - public void func_70056_a(double par1, double par3, double par5, float par7, float par8, int par9) { + public void setVelocity(double par1, double par3, double par5, float par7, float par8, int par9) { } - public void func_70063_aa() { + public void onKillEntity() { } - public boolean func_70027_ad() { + public boolean isInRangeToRenderDist() { return false; } @@ -450,7 +447,7 @@ implements IThrowableEntity { return pass == 1; } - public void func_70110_aj() { + public void playLivingSound() { } public Entity getThrower() { @@ -471,7 +468,7 @@ implements IThrowableEntity { double var4 = rand.nextGaussian() * 0.12; double var6 = rand.nextGaussian() * 0.12; double var8 = 10.0; - this.field_70170_p.func_72869_a(particle, this.field_70165_t + (double)(rand.nextFloat() * this.field_70130_N * 2.0f) - (double)this.field_70130_N - var2 * var8, this.field_70163_u + (double)(rand.nextFloat() * this.field_70131_O) - var4 * var8, this.field_70161_v + (double)(rand.nextFloat() * this.field_70130_N * 2.0f) - (double)this.field_70130_N - var6 * var8, var2, var4, var6); + this.worldObj.spawnParticle(particle, this.posX + (double)(rand.nextFloat() * this.width * 2.0f) - (double)this.width - var2 * var8, this.posY + (double)(rand.nextFloat() * this.height) - var4 * var8, this.posZ + (double)(rand.nextFloat() * this.width * 2.0f) - (double)this.width - var6 * var8, var2, var4, var6); } ++this.i; } @@ -481,7 +478,7 @@ implements IThrowableEntity { if (!this.getIsPlayerSound()) { String sound = this.getSound(); if (sound != null && !sound.equals("") && this.thrower instanceof EntityPlayer) { - this.thrower.func_85030_a(sound, 1.0f, 1.5f); + this.thrower.playSound(sound, 1.0f, 1.5f); } this.setIsPlayerSound(true); } diff --git a/src/main/java/com/moe/allweapon/Entityadd/EntitySlashDimensionAdd.java b/src/main/java/com/moe/allweapon/Entityadd/EntitySlashDimensionAdd.java index 8f43103..06c5f11 100644 --- a/src/main/java/com/moe/allweapon/Entityadd/EntitySlashDimensionAdd.java +++ b/src/main/java/com/moe/allweapon/Entityadd/EntitySlashDimensionAdd.java @@ -69,7 +69,7 @@ implements IThrowableEntity { public EntitySlashDimensionAdd(World par1World) { super(par1World); - this.field_70173_aa = 0; + this.ticksExisted = 0; } public EntitySlashDimensionAdd(World par1World, EntityLivingBase entityLiving, float AttackLevel, boolean multiHit) { @@ -81,147 +81,144 @@ implements IThrowableEntity { this(par1World); this.AttackLevel = AttackLevel; this.thrower = entityLiving; - this.blade = entityLiving.func_70694_bm(); - if (this.blade != null && !(this.blade.func_77973_b() instanceof ItemSlashBlade)) { + this.blade = entityLiving.getHeldItem(); + if (this.blade != null && !(this.blade.getItem() instanceof ItemSlashBlade)) { this.blade = null; } this.alreadyHitEntity.clear(); this.alreadyHitEntity.add(this.thrower); - this.alreadyHitEntity.add(this.thrower.field_70154_o); - this.alreadyHitEntity.add(this.thrower.field_70153_n); - this.field_70173_aa = 0; - this.func_70105_a(4.0f, 4.0f); + this.alreadyHitEntity.add(this.thrower.riddenByEntity); + this.alreadyHitEntity.add(this.thrower.ridingEntity); + this.ticksExisted = 0; + this.setSize(4.0f, 4.0f); } - protected void func_70088_a() { - this.func_70096_w().func_75682_a(3, (Object)20); - this.func_70096_w().func_75682_a(4, (Object)0); - this.func_70096_w().func_75682_a(5, (Object)0); - this.func_70096_w().func_75682_a(6, (Object)0); - this.func_70096_w().func_75682_a(7, (Object)7); - this.func_70096_w().func_75682_a(24, (Object)String.valueOf("model/util/SAhuixuanqiu/texture.png")); - this.func_70096_w().func_75682_a(25, (Object)String.valueOf("model/util/SAhuixuanqiu/model.obj")); - this.func_70096_w().func_75682_a(8, (Object)0x3333FF); - this.func_70096_w().func_75682_a(9, (Object)this.field_70146_Z.nextInt(50)); + protected void entityInit() { + this.getDataWatcher().addObject(3, (Object)20); + this.getDataWatcher().addObject(4, (Object)0); + this.getDataWatcher().addObject(5, (Object)0); + this.getDataWatcher().addObject(6, (Object)0); + this.getDataWatcher().addObject(7, (Object)7); + this.getDataWatcher().addObject(24, (Object)String.valueOf("model/util/SAhuixuanqiu/texture.png")); + this.getDataWatcher().addObject(25, (Object)String.valueOf("model/util/SAhuixuanqiu/model.obj")); + this.getDataWatcher().addObject(8, (Object)0x3333FF); + this.getDataWatcher().addObject(9, (Object)this.rand.nextInt(50)); } public int getSeed() { - return this.func_70096_w().func_75679_c(SEED); + return this.getDataWatcher().getWatchableObjectInt(SEED); } public String getTexture() { - return this.func_70096_w().func_75681_e(24); + return this.getDataWatcher().getWatchableObjectString(24); } public void setTexture(String value) { - this.func_70096_w().func_75692_b(24, (Object)String.valueOf(value)); + this.getDataWatcher().updateObject(24, (Object)String.valueOf(value)); } public String getModel() { - return this.func_70096_w().func_75681_e(25); + return this.getDataWatcher().getWatchableObjectString(25); } public void setModel(String value) { - this.func_70096_w().func_75692_b(25, (Object)String.valueOf(value)); + this.getDataWatcher().updateObject(25, (Object)String.valueOf(value)); } public boolean getIsSingleHit() { - return this.func_70096_w().func_75683_a(4) != 0; + return this.getDataWatcher().getWatchableObjectInt(4) != 0; } public void setIsSingleHit(boolean isSingleHit) { - this.func_70096_w().func_75692_b(4, (Object)((byte)(isSingleHit ? 1 : 0))); + this.getDataWatcher().updateObject(4, (Object)((byte)(isSingleHit ? 1 : 0))); } public int getLifeTime() { - return this.func_70096_w().func_75679_c(3); + return this.getDataWatcher().getWatchableObjectInt(3); } public void setLifeTime(int lifetime) { - this.func_70096_w().func_75692_b(3, (Object)lifetime); + this.getDataWatcher().updateObject(3, (Object)lifetime); } public boolean getIsSlashDimension() { - return this.func_70096_w().func_75683_a(5) != 0; + return this.getDataWatcher().getWatchableObjectInt(5) != 0; } public void setIsSlashDimension(boolean isSlashDimension) { - this.func_70096_w().func_75692_b(5, (Object)((byte)(isSlashDimension ? 1 : 0))); + this.getDataWatcher().updateObject(5, (Object)((byte)(isSlashDimension ? 1 : 0))); } public int getInterval() { - return this.func_70096_w().func_75679_c(7); + return this.getDataWatcher().getWatchableObjectInt(7); } public void setInterval(int value) { - this.func_70096_w().func_75692_b(7, (Object)value); + this.getDataWatcher().updateObject(7, (Object)value); } public int getColor() { - return this.func_70096_w().func_75679_c(8); + return this.getDataWatcher().getWatchableObjectInt(8); } public void setColor(int value) { - this.func_70096_w().func_75692_b(8, (Object)value); + this.getDataWatcher().updateObject(8, (Object)value); } public int getThrowerEntityId() { - return this.func_70096_w().func_75679_c(6); + return this.getDataWatcher().getWatchableObjectInt(6); } public void setThrowerEntityId(int entityid) { - this.func_70096_w().func_75692_b(6, (Object)entityid); + this.getDataWatcher().updateObject(6, (Object)entityid); } - public void func_70071_h_() { - super.func_70071_h_(); - this.field_70142_S = this.field_70165_t; - this.field_70137_T = this.field_70163_u; - this.field_70136_U = this.field_70161_v; - if (!this.field_70170_p.field_72995_K) { - if (this.field_70173_aa < 8 && this.field_70173_aa % 2 == 0) { - this.func_85030_a("allweapon:yanfuzhan", 0.2f, 0.5f + 0.25f * this.field_70146_Z.nextFloat()); + public void onUpdate() { + super.onUpdate(); + if (!this.worldObj.isRemote) { + if (this.ticksExisted < 8 && this.ticksExisted % 2 == 0) { + this.playSound("allweapon:yanfuzhan", 0.2f, 0.5f + 0.25f * this.rand.nextFloat()); } - AxisAlignedBB bb = this.field_70121_D; + AxisAlignedBB bb = this.boundingBox; if (this.getThrower() instanceof EntityLivingBase) { EntityLivingBase entityLiving = (EntityLivingBase)this.getThrower(); - List list = this.field_70170_p.func_94576_a(this.getThrower(), bb, ItemSlashBlade.DestructableSelector); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.getThrower(), bb, ItemSlashBlade.DestructableSelector); StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.DestructObject); list.removeAll(this.alreadyHitEntity); this.alreadyHitEntity.addAll(list); for (Entity curEntity : (java.util.List)(java.util.List)list) { boolean isDestruction = true; if (curEntity instanceof EntityFireball) { - isDestruction = ((EntityFireball)curEntity).field_70235_a != null && ((EntityFireball)curEntity).field_70235_a.func_145782_y() == entityLiving.func_145782_y() ? false : !curEntity.func_70097_a(DamageSource.func_76358_a((EntityLivingBase)entityLiving), this.AttackLevel); + isDestruction = ((EntityFireball)curEntity).shootingEntity != null && ((EntityFireball)curEntity).shootingEntity.getEntityId() == entityLiving.getEntityId() ? false : !curEntity.attackEntityFrom(DamageSource.causeMobDamage(entityLiving), this.AttackLevel); } else if (curEntity instanceof EntityArrow) { - if (((EntityArrow)curEntity).field_70250_c != null && ((EntityArrow)curEntity).field_70250_c.func_145782_y() == entityLiving.func_145782_y()) { + if (((EntityArrow)curEntity).shootingEntity != null && ((EntityArrow)curEntity).shootingEntity.getEntityId() == entityLiving.getEntityId()) { isDestruction = false; } } else if (curEntity instanceof IThrowableEntity) { - if (((IThrowableEntity)curEntity).getThrower() != null && ((IThrowableEntity)curEntity).getThrower().func_145782_y() == entityLiving.func_145782_y()) { + if (((IThrowableEntity)curEntity).getThrower() != null && ((IThrowableEntity)curEntity).getThrower().getEntityId() == entityLiving.getEntityId()) { isDestruction = false; } - } else if (curEntity instanceof EntityThrowable && ((EntityThrowable)curEntity).func_85052_h() != null && ((EntityThrowable)curEntity).func_85052_h().func_145782_y() == entityLiving.func_145782_y()) { + } else if (curEntity instanceof EntityThrowable && ((EntityThrowable)curEntity).getThrower() != null && ((EntityThrowable)curEntity).getThrower().getEntityId() == entityLiving.getEntityId()) { isDestruction = false; } if (!isDestruction) continue; - curEntity.field_70159_w = 0.0; - curEntity.field_70181_x = 0.0; - curEntity.field_70179_y = 0.0; - curEntity.func_70106_y(); + curEntity.motionX = 0.0; + curEntity.motionY = 0.0; + curEntity.motionZ = 0.0; + curEntity.setDead(); for (int var1 = 0; var1 < 10; ++var1) { Random rand = this.getRand(); double var2 = rand.nextGaussian() * 0.02; double var4 = rand.nextGaussian() * 0.02; double var6 = rand.nextGaussian() * 0.02; double var8 = 10.0; - this.field_70170_p.func_72869_a("explode", curEntity.field_70165_t + (double)(rand.nextFloat() * curEntity.field_70130_N * 2.0f) - (double)curEntity.field_70130_N - var2 * var8, curEntity.field_70163_u + (double)(rand.nextFloat() * curEntity.field_70131_O) - var4 * var8, curEntity.field_70161_v + (double)(rand.nextFloat() * curEntity.field_70130_N * 2.0f) - (double)curEntity.field_70130_N - var6 * var8, var2, var4, var6); + this.worldObj.spawnParticle("explode", curEntity.posX + (double)(rand.nextFloat() * curEntity.width * 2.0f) - (double)curEntity.width - var2 * var8, curEntity.posY + (double)(rand.nextFloat() * curEntity.height) - var4 * var8, curEntity.posZ + (double)(rand.nextFloat() * curEntity.width * 2.0f) - (double)curEntity.width - var6 * var8, var2, var4, var6); } StylishRankManager.doAttack((Entity)this.thrower); } } - if (this.getIsSingleHit() || this.field_70173_aa % 2 == 0) { - List list = this.field_70170_p.func_94576_a(this.getThrower(), bb, ItemSlashBlade.AttackableSelector); + if (this.getIsSingleHit() || this.ticksExisted % 2 == 0) { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.getThrower(), bb, ItemSlashBlade.AttackableSelector); list.removeAll(this.alreadyHitEntity); if (this.getIsSingleHit()) { this.alreadyHitEntity.addAll(list); @@ -230,65 +227,65 @@ implements IThrowableEntity { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.SlashDimMagic); for (Entity curEntity : (java.util.List)(java.util.List)list) { float health; - if (this.getIsSlashDimension() && curEntity instanceof EntityLivingBase && 0.0f < (health = ((EntityLivingBase)curEntity).func_110143_aJ())) { + if (this.getIsSlashDimension() && curEntity instanceof EntityLivingBase && 0.0f < (health = ((EntityLivingBase)curEntity).getHealth())) { health = Math.max(1.0f, health - magicDamage); - ((EntityLivingBase)curEntity).func_70606_j(health); + ((EntityLivingBase)curEntity).setHealth(health); } - Vec3 pos = Vec3.func_72443_a((double)curEntity.field_70165_t, (double)curEntity.field_70163_u, (double)curEntity.field_70161_v); + Vec3 pos = Vec3.createVectorHelper((double)curEntity.posX, (double)curEntity.posY, (double)curEntity.posZ); TeleportCanceller.setCancel((Entity)curEntity); - curEntity.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p().func_76349_b(); + curEntity.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); if (this.blade != null && curEntity instanceof EntityLivingBase) { - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)curEntity, (EntityLivingBase)this.thrower); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)curEntity, (EntityLivingBase)this.thrower); } - curEntity.field_70159_w = 0.0; - curEntity.field_70181_x = 0.0; - curEntity.field_70179_y = 0.0; - if (3 >= this.field_70173_aa || this.blade == null || !(curEntity instanceof EntityLivingBase)) continue; + curEntity.motionX = 0.0; + curEntity.motionY = 0.0; + curEntity.motionZ = 0.0; + if (3 >= this.ticksExisted || this.blade == null || !(curEntity instanceof EntityLivingBase)) continue; if (this.getIsSlashDimension()) { - curEntity.func_70024_g(0.0, 0.5, 0.0); + curEntity.addVelocity(0.0, 0.5, 0.0); continue; } - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77344_u.field_77352_x, (ItemStack)this.blade); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.unbreaking.effectId, (ItemStack)this.blade); if (level > 0) { - curEntity.func_70024_g(Math.sin(this.getThrower().field_70177_z * 3.141593f / 180.0f) * (double)level * 0.5, 0.2, -Math.cos(this.getThrower().field_70177_z * 3.141593f / 180.0f) * (double)level * 0.5); + curEntity.addVelocity(Math.sin(this.getThrower().rotationYaw * 3.141593f / 180.0f) * (double)level * 0.5, 0.2, -Math.cos(this.getThrower().rotationYaw * 3.141593f / 180.0f) * (double)level * 0.5); continue; } - curEntity.func_70024_g(-Math.sin(this.getThrower().field_70177_z * 3.141593f / 180.0f) * 0.5, 0.2, Math.cos(this.getThrower().field_70177_z * 3.141593f / 180.0f) * 0.5); + curEntity.addVelocity(-Math.sin(this.getThrower().rotationYaw * 3.141593f / 180.0f) * 0.5, 0.2, Math.cos(this.getThrower().rotationYaw * 3.141593f / 180.0f) * 0.5); } } } - if (this.field_70173_aa >= this.getLifeTime()) { + if (this.ticksExisted >= this.getLifeTime()) { this.alreadyHitEntity.clear(); this.alreadyHitEntity = null; - this.func_70106_y(); + this.setDead(); } } public Random getRand() { - return this.field_70146_Z; + return this.rand; } - public boolean func_70038_c(double par1, double par3, double par5) { + public boolean canBePushed(double par1, double par3, double par5) { return false; } - public void func_70091_d(double par1, double par3, double par5) { + public void moveEntity(double par1, double par3, double par5) { } - protected void func_70081_e(int par1) { + protected void fall(int par1) { } - public boolean func_70072_I() { + public boolean isInWater() { return false; } - public boolean func_70055_a(Material par1Material) { + public boolean isInsideOfMaterial(Material par1Material) { return false; } @SideOnly(value=Side.CLIENT) - public int func_70070_b(float par1) { + public int getBrightnessForRender(float par1) { float f1 = 0.5f; if (f1 < 0.0f) { f1 = 0.0f; @@ -296,7 +293,7 @@ implements IThrowableEntity { if (f1 > 1.0f) { f1 = 1.0f; } - int i = super.func_70070_b(par1); + int i = super.getBrightnessForRender(par1); int j = i & 0xFF; int k = i >> 16 & 0xFF; if ((j += (int)(f1 * 15.0f * 16.0f)) > 240) { @@ -305,27 +302,27 @@ implements IThrowableEntity { return j | k << 16; } - public float func_70013_c(float par1) { - float f1 = super.func_70013_c(par1); + public float getBrightness(float par1) { + float f1 = super.getBrightness(par1); float f2 = 0.9f; f2 = f2 * f2 * f2 * f2; return f1 * (1.0f - f2) + f2; } - protected void func_70037_a(NBTTagCompound nbttagcompound) { + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { } - protected void func_70014_b(NBTTagCompound nbttagcompound) { + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { } @SideOnly(value=Side.CLIENT) - public void func_70056_a(double par1, double par3, double par5, float par7, float par8, int par9) { + public void setVelocity(double par1, double par3, double par5, float par7, float par8, int par9) { } - public void func_70063_aa() { + public void onKillEntity() { } - public boolean func_70027_ad() { + public boolean isInRangeToRenderDist() { return false; } @@ -333,20 +330,20 @@ implements IThrowableEntity { return pass == 1; } - public void func_70110_aj() { + public void playLivingSound() { } public Entity getThrower() { int id; if (this.thrower == null && (id = this.getThrowerEntityId()) != 0) { - this.thrower = this.field_70170_p.func_73045_a(id); + this.thrower = this.worldObj.getEntityByID(id); } return this.thrower; } public void setThrower(Entity entity) { if (entity != null) { - this.setThrowerEntityId(entity.func_145782_y()); + this.setThrowerEntityId(entity.getEntityId()); } this.thrower = entity; } diff --git a/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedButterfly.java b/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedButterfly.java index 5ba3809..02e7483 100644 --- a/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedButterfly.java +++ b/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedButterfly.java @@ -87,7 +87,7 @@ IThrowableEntity { public EntitySummonedButterfly(World par1World) { super(par1World); - this.field_70145_X = true; + this.noClip = true; } public EntitySummonedButterfly(World par1World, EntityLivingBase entityLiving, float AttackLevel, float roll) { @@ -98,91 +98,91 @@ IThrowableEntity { public EntitySummonedButterfly(World par1World, EntityLivingBase entityLiving, float AttackLevel) { this(par1World); this.AttackLevel = AttackLevel; - this.field_70129_M = entityLiving.func_70047_e() / 2.0f; + this.width = entityLiving.getEyeHeight() / 2.0f; this.setThrower((Entity)entityLiving); - this.blade = entityLiving.func_70694_bm(); - if (this.blade != null && !(this.blade.func_77973_b() instanceof ItemSlashBlade)) { + this.blade = entityLiving.getHeldItem(); + if (this.blade != null && !(this.blade.getItem() instanceof ItemSlashBlade)) { this.blade = null; } this.alreadyHitEntity.clear(); this.alreadyHitEntity.add(this.thrower); - this.alreadyHitEntity.add(this.thrower.field_70154_o); - this.alreadyHitEntity.add(this.thrower.field_70153_n); - this.field_70173_aa = 0; - this.func_70105_a(0.5f, 0.5f); + this.alreadyHitEntity.add(this.thrower.riddenByEntity); + this.alreadyHitEntity.add(this.thrower.ridingEntity); + this.ticksExisted = 0; + this.setSize(0.5f, 0.5f); float dist = 2.0f; - double ran = ((double)this.field_70146_Z.nextFloat() - 0.5) * 2.0; - double yaw = Math.toRadians(-this.thrower.field_70177_z + 90.0f); + double ran = ((double)this.rand.nextFloat() - 0.5) * 2.0; + double yaw = Math.toRadians(-this.thrower.rotationYaw + 90.0f); double x = ran * Math.sin(yaw); double y = 1.0 - Math.abs(ran); double z = ran * Math.cos(yaw); - this.func_70012_b(this.thrower.field_70165_t + (x *= (double)dist), this.thrower.field_70163_u + (y *= (double)dist), this.thrower.field_70161_v + (z *= (double)dist), this.thrower.field_70177_z, this.thrower.field_70125_A); - this.iniYaw = this.thrower.field_70177_z; - this.iniPitch = this.thrower.field_70125_A; + this.setLocationAndAngles(this.thrower.posX + (x *= (double)dist), this.thrower.posY + (y *= (double)dist), this.thrower.posZ + (z *= (double)dist), this.thrower.rotationYaw, this.thrower.rotationPitch); + this.iniYaw = this.thrower.rotationYaw; + this.iniPitch = this.thrower.rotationPitch; this.setDriveVector(1.75f); } - protected void func_70088_a() { - this.func_70096_w().func_75682_a(11, (Object)0); - this.func_70096_w().func_75682_a(4, (Object)0); - this.func_70096_w().func_75682_a(5, (Object)Float.valueOf(0.0f)); - this.func_70096_w().func_75682_a(6, (Object)20); - this.func_70096_w().func_75682_a(7, (Object)7); - this.func_70096_w().func_75682_a(10, (Object)0x3333FF); + protected void entityInit() { + this.getDataWatcher().addObject(11, (Object)0); + this.getDataWatcher().addObject(4, (Object)0); + this.getDataWatcher().addObject(5, (Object)Float.valueOf(0.0f)); + this.getDataWatcher().addObject(6, (Object)20); + this.getDataWatcher().addObject(7, (Object)7); + this.getDataWatcher().addObject(10, (Object)0x3333FF); } public int getThrowerEntityId() { - return this.func_70096_w().func_75679_c(11); + return this.getDataWatcher().getWatchableObjectInt(11); } public void setThrowerEntityId(int entityid) { - this.func_70096_w().func_75692_b(11, (Object)entityid); + this.getDataWatcher().updateObject(11, (Object)entityid); } public int getTargetEntityId() { - return this.func_70096_w().func_75679_c(4); + return this.getDataWatcher().getWatchableObjectInt(4); } public void setTargetEntityId(int entityid) { - this.func_70096_w().func_75692_b(4, (Object)entityid); + this.getDataWatcher().updateObject(4, (Object)entityid); } public float getRoll() { - return this.func_70096_w().func_111145_d(5); + return this.getDataWatcher().getWatchableObjectFloat(5); } public void setRoll(float roll) { - this.func_70096_w().func_75692_b(5, (Object)Float.valueOf(roll)); + this.getDataWatcher().updateObject(5, (Object)Float.valueOf(roll)); } public int getLifeTime() { - return this.func_70096_w().func_75679_c(6); + return this.getDataWatcher().getWatchableObjectInt(6); } public void setLifeTime(int lifetime) { - this.func_70096_w().func_75692_b(6, (Object)lifetime); + this.getDataWatcher().updateObject(6, (Object)lifetime); } public int getInterval() { - return this.func_70096_w().func_75679_c(7); + return this.getDataWatcher().getWatchableObjectInt(7); } public void setInterval(int value) { - this.func_70096_w().func_75692_b(7, (Object)value); + this.getDataWatcher().updateObject(7, (Object)value); } public int getColor() { - return this.func_70096_w().func_75679_c(10); + return this.getDataWatcher().getWatchableObjectInt(10); } public void setColor(int value) { - this.func_70096_w().func_75692_b(10, (Object)value); + this.getDataWatcher().updateObject(10, (Object)value); } public boolean doTargeting() { Entity target; Entity rayEntity; - if (this.field_70173_aa > this.getInterval()) { + if (this.ticksExisted > this.getInterval()) { return false; } int targetid = this.getTargetEntityId(); @@ -191,19 +191,19 @@ IThrowableEntity { owner = this; } if (targetid == 0 && (rayEntity = this.getRayTrace(owner, 30.0)) != null) { - targetid = rayEntity.func_145782_y(); - this.setTargetEntityId(rayEntity.func_145782_y()); + targetid = rayEntity.getEntityId(); + this.setTargetEntityId(rayEntity.getEntityId()); } if (targetid == 0 && (rayEntity = this.getRayTrace(owner, 30.0, 5.0f, 5.0f)) != null) { - targetid = rayEntity.func_145782_y(); - this.setTargetEntityId(rayEntity.func_145782_y()); + targetid = rayEntity.getEntityId(); + this.setTargetEntityId(rayEntity.getEntityId()); } - if (targetid != 0 && (target = this.field_70170_p.func_73045_a(targetid)) != null) { + if (targetid != 0 && (target = this.worldObj.getEntityByID(targetid)) != null) { if (Float.isNaN(this.iniPitch) && this.thrower != null) { - this.iniYaw = this.thrower.field_70177_z; - this.iniPitch = this.thrower.field_70125_A; + this.iniYaw = this.thrower.rotationYaw; + this.iniPitch = this.thrower.rotationPitch; } - this.faceEntity(this, target, (float)this.field_70173_aa * 1.0f, (float)this.field_70173_aa * 1.0f); + this.faceEntity(this, target, (float)this.ticksExisted * 1.0f, (float)this.ticksExisted * 1.0f); this.setDriveVector(1.75f, false); } return true; @@ -219,29 +219,29 @@ IThrowableEntity { double reachMin = reachMax; Vec3 entityPos = EntitySummonedButterfly.getPosition(owner); if (objectMouseOver != null) { - reachMin = objectMouseOver.field_72307_f.func_72438_d(entityPos); + reachMin = objectMouseOver.hitVec.squareDistanceTo(entityPos); } Vec3 lookVec = EntitySummonedButterfly.getLook(owner, par1); - Vec3 reachVec = entityPos.func_72441_c(lookVec.field_72450_a * reachMax, lookVec.field_72448_b * reachMax, lookVec.field_72449_c * reachMax); + Vec3 reachVec = entityPos.addVector(lookVec.xCoord * reachMax, lookVec.yCoord * reachMax, lookVec.zCoord * reachMax); Entity pointedEntity = null; - List list = this.field_70170_p.func_72839_b((Entity)this, this.field_70121_D.func_72321_a(lookVec.field_72450_a * reachMax, lookVec.field_72448_b * reachMax, lookVec.field_72449_c * reachMax).func_72314_b((double)expandFactor, (double)expandFactor, (double)expandFactor)); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, this.boundingBox.addCoord(lookVec.xCoord * reachMax, lookVec.yCoord * reachMax, lookVec.zCoord * reachMax).expand((double)expandFactor, (double)expandFactor, (double)expandFactor)); list.removeAll(this.alreadyHitEntity); double tmpDistance = reachMin; EntityLivingBase viewer = owner instanceof EntityLivingBase ? (EntityLivingBase)owner : null; for (Entity entity : (java.util.List)(java.util.List)list) { double d3; - if (entity == null || !entity.func_70067_L() || !ItemSlashBlade.AttackableSelector.func_82704_a(entity) || viewer != null && !viewer.func_70685_l(entity)) continue; - float borderSize = entity.func_70111_Y() + expandBorder; - AxisAlignedBB axisalignedbb = entity.field_70121_D.func_72314_b((double)borderSize, (double)borderSize, (double)borderSize); - MovingObjectPosition movingobjectposition = axisalignedbb.func_72327_a(entityPos, reachVec); - if (axisalignedbb.func_72318_a(entityPos)) { + if (entity == null || !entity.canBeCollidedWith() || !ItemSlashBlade.AttackableSelector.isEntityApplicable(entity) || viewer != null && !viewer.canEntityBeSeen(entity)) continue; + float borderSize = entity.getCollisionBorderSize() + expandBorder; + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)borderSize, (double)borderSize, (double)borderSize); + MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(entityPos, reachVec); + if (axisalignedbb.isVecInside(entityPos)) { if (!(0.0 < tmpDistance) && tmpDistance != 0.0) continue; pointedEntity = entity; tmpDistance = 0.0; continue; } - if (movingobjectposition == null || !((d3 = entityPos.func_72438_d(movingobjectposition.field_72307_f)) < tmpDistance) && tmpDistance != 0.0) continue; - if (entity == this.field_70154_o) { + if (movingobjectposition == null || !((d3 = entityPos.squareDistanceTo(movingobjectposition.hitVec)) < tmpDistance) && tmpDistance != 0.0) continue; + if (entity == this.riddenByEntity) { if (tmpDistance != 0.0) continue; pointedEntity = entity; continue; @@ -255,42 +255,42 @@ IThrowableEntity { public static MovingObjectPosition rayTrace(Entity owner, double par1, float par3) { Vec3 vec3 = EntitySummonedButterfly.getPosition(owner); Vec3 vec31 = EntitySummonedButterfly.getLook(owner, par3); - Vec3 vec32 = vec3.func_72441_c(vec31.field_72450_a * par1, vec31.field_72448_b * par1, vec31.field_72449_c * par1); - return owner.field_70170_p.func_147447_a(vec3, vec32, false, false, true); + Vec3 vec32 = vec3.addVector(vec31.xCoord * par1, vec31.yCoord * par1, vec31.zCoord * par1); + return owner.worldObj.rayTraceBlocks(vec3, vec32, false); } public static Vec3 getPosition(Entity owner) { - return Vec3.func_72443_a((double)owner.field_70165_t, (double)(owner.field_70163_u + (double)owner.func_70047_e()), (double)owner.field_70161_v); + return Vec3.createVectorHelper((double)owner.posX, (double)(owner.posY + (double)owner.getEyeHeight()), (double)owner.posZ); } public static Vec3 getLook(Entity owner, float rotMax) { if (rotMax == 1.0f) { - float f1 = MathHelper.func_76134_b((float)(-owner.field_70177_z * 0.01745329f - 3.141593f)); - float f2 = MathHelper.func_76126_a((float)(-owner.field_70177_z * 0.01745329f - 3.141593f)); - float f3 = -MathHelper.func_76134_b((float)(-owner.field_70125_A * 0.01745329f)); - float f4 = MathHelper.func_76126_a((float)(-owner.field_70125_A * 0.01745329f)); - return Vec3.func_72443_a((double)(f2 * f3), (double)f4, (double)(f1 * f3)); + float f1 = MathHelper.cos((float)(-owner.rotationYaw * 0.01745329f - 3.141593f)); + float f2 = MathHelper.sin((float)(-owner.rotationYaw * 0.01745329f - 3.141593f)); + float f3 = -MathHelper.cos((float)(-owner.rotationPitch * 0.01745329f)); + float f4 = MathHelper.sin((float)(-owner.rotationPitch * 0.01745329f)); + return Vec3.createVectorHelper((double)(f2 * f3), (double)f4, (double)(f1 * f3)); } - float f1 = owner.field_70127_C + (owner.field_70125_A - owner.field_70127_C) * rotMax; - float f2 = owner.field_70126_B + (owner.field_70177_z - owner.field_70126_B) * rotMax; - float f3 = MathHelper.func_76134_b((float)(-f2 * 0.01745329f - 3.141593f)); - float f4 = MathHelper.func_76126_a((float)(-f2 * 0.01745329f - 3.141593f)); - float f5 = -MathHelper.func_76134_b((float)(-f1 * 0.01745329f)); - float f6 = MathHelper.func_76126_a((float)(-f1 * 0.01745329f)); - return Vec3.func_72443_a((double)(f4 * f5), (double)f6, (double)(f3 * f5)); + float f1 = owner.prevRotationYaw + (owner.rotationPitch - owner.prevRotationYaw) * rotMax; + float f2 = owner.prevRotationPitch + (owner.rotationYaw - owner.prevRotationPitch) * rotMax; + float f3 = MathHelper.cos((float)(-f2 * 0.01745329f - 3.141593f)); + float f4 = MathHelper.sin((float)(-f2 * 0.01745329f - 3.141593f)); + float f5 = -MathHelper.cos((float)(-f1 * 0.01745329f)); + float f6 = MathHelper.sin((float)(-f1 * 0.01745329f)); + return Vec3.createVectorHelper((double)(f4 * f5), (double)f6, (double)(f3 * f5)); } public void faceEntity(Entity viewer, Entity target, float yawStep, float pitchStep) { double d2; - double d0 = target.field_70165_t - viewer.field_70165_t; - double d1 = target.field_70161_v - viewer.field_70161_v; + double d0 = target.posX - viewer.posX; + double d1 = target.posZ - viewer.posZ; if (target instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)target; - d2 = entitylivingbase.field_70163_u + (double)entitylivingbase.func_70047_e() - (viewer.field_70163_u + (double)viewer.func_70047_e()); + d2 = entitylivingbase.posY + (double)entitylivingbase.getEyeHeight() - (viewer.posY + (double)viewer.getEyeHeight()); } else { - d2 = (target.field_70121_D.field_72338_b + target.field_70121_D.field_72337_e) / 2.0 - (viewer.field_70163_u + (double)viewer.func_70047_e()); + d2 = (target.boundingBox.minY + target.boundingBox.maxY) / 2.0 - (viewer.posY + (double)viewer.getEyeHeight()); } - double d3 = MathHelper.func_76133_a((double)(d0 * d0 + d1 * d1)); + double d3 = MathHelper.sqrt_double((double)(d0 * d0 + d1 * d1)); float f2 = (float)(Math.atan2(d1, d0) * 180.0 / Math.PI) - 90.0f; float f3 = (float)(-(Math.atan2(d2, d3) * 180.0 / Math.PI)); this.iniPitch = this.updateRotation(this.iniPitch, f3, pitchStep); @@ -298,7 +298,7 @@ IThrowableEntity { } private float updateRotation(float par1, float par2, float par3) { - float f3 = MathHelper.func_76142_g((float)(par2 - par1)); + float f3 = MathHelper.wrapAngleTo180_float((float)(par2 - par1)); if (f3 > par3) { f3 = par3; } @@ -313,10 +313,10 @@ IThrowableEntity { return false; } this.alreadyHitEntity.add(hitEntity); - long now = this.field_70170_p.func_82737_E(); + long now = this.worldObj.getTotalWorldTime(); Long nextTick = playerHitCooldown.get(hitEntity); if (nextTick != null && nextTick.longValue() > now) { - this.func_70106_y(); + this.setDead(); return true; } playerHitCooldown.put(hitEntity, Long.valueOf(now + PLAYER_HIT_COOLDOWN_TICKS)); @@ -330,99 +330,96 @@ IThrowableEntity { public void setDriveVector(float fYVecOfst, boolean init) { float fYawDtoR = this.iniYaw / 180.0f * 3.141593f; float fPitDtoR = this.iniPitch / 180.0f * 3.141593f; - this.field_70159_w = -MathHelper.func_76126_a((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst; - this.field_70181_x = -MathHelper.func_76126_a((float)fPitDtoR) * fYVecOfst; - this.field_70179_y = MathHelper.func_76134_b((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst; - float f3 = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f3) * 180.0 / Math.PI); + this.motionX = -MathHelper.sin((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst; + this.motionY = -MathHelper.sin((float)fPitDtoR) * fYVecOfst; + this.motionZ = MathHelper.cos((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst; + float f3 = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.rotationPitch = (float)(Math.atan2(this.motionY, f3) * 180.0 / Math.PI); if (init) { this.speed = fYVecOfst; - this.field_70126_B = this.field_70177_z; - this.field_70127_C = this.field_70125_A; + this.prevRotationPitch = this.rotationYaw; + this.prevRotationYaw = this.rotationPitch; } } - public void func_70098_U() { + public void updateRidden() { Entity ridingEntity = this.ridingEntity2; - if (ridingEntity.field_70128_L) { - this.func_70106_y(); + if (ridingEntity.isDead) { + this.setDead(); return; } - this.field_70142_S = this.field_70165_t; - this.field_70137_T = this.field_70163_u; - this.field_70136_U = this.field_70161_v; - this.field_70165_t = ridingEntity.field_70165_t + (this.hitX * Math.cos(Math.toRadians(ridingEntity.field_70177_z)) - this.hitZ * Math.sin(Math.toRadians(ridingEntity.field_70177_z))); - this.field_70163_u = ridingEntity.field_70163_u + this.hitY; - this.field_70161_v = ridingEntity.field_70161_v + (this.hitX * Math.sin(Math.toRadians(ridingEntity.field_70177_z)) + this.hitZ * Math.cos(Math.toRadians(ridingEntity.field_70177_z))); - this.field_70127_C = this.field_70125_A; - this.field_70126_B = this.field_70177_z; - this.field_70125_A = ridingEntity.field_70125_A + this.hitPitch; - this.field_70177_z = ridingEntity.field_70177_z + this.hitYaw; - this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); - this.func_70101_b(this.field_70177_z, this.field_70125_A); - if (this.field_70173_aa >= 200) { - if (!ridingEntity.field_70128_L && !this.field_70170_p.field_72995_K) { + this.posX = ridingEntity.posX + (this.hitX * Math.cos(Math.toRadians(ridingEntity.rotationYaw)) - this.hitZ * Math.sin(Math.toRadians(ridingEntity.rotationYaw))); + this.posY = ridingEntity.posY + this.hitY; + this.posZ = ridingEntity.posZ + (this.hitX * Math.sin(Math.toRadians(ridingEntity.rotationYaw)) + this.hitZ * Math.cos(Math.toRadians(ridingEntity.rotationYaw))); + this.prevRotationYaw = this.rotationPitch; + this.prevRotationPitch = this.rotationYaw; + this.rotationPitch = ridingEntity.rotationPitch + this.hitPitch; + this.rotationYaw = ridingEntity.rotationYaw + this.hitYaw; + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + if (this.ticksExisted >= 200) { + if (!ridingEntity.isDead && !this.worldObj.isRemote) { float magicDamage = 0.0f; - ridingEntity.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - ridingEntity.func_70097_a(ds, magicDamage); + ridingEntity.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + ridingEntity.attackEntityFrom(ds, magicDamage); if (this.blade != null && ridingEntity instanceof EntityLivingBase) { if (this.thrower != null) { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.BreakPhantomSword); - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)ridingEntity, (EntityLivingBase)this.thrower); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)ridingEntity, (EntityLivingBase)this.thrower); } - ridingEntity.field_70159_w = 0.0; - ridingEntity.field_70181_x = 0.0; - ridingEntity.field_70179_y = 0.0; - ridingEntity.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)ridingEntity).field_70737_aN = 1; + ridingEntity.motionX = 0.0; + ridingEntity.motionY = 0.0; + ridingEntity.motionZ = 0.0; + ridingEntity.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)ridingEntity).hurtTime = 1; } } - this.func_70106_y(); + this.setDead(); } } protected void initRotation() { - if (this.field_70127_C == 0.0f && this.field_70126_B == 0.0f) { - float f = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70126_B = this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70127_C = this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f) * 180.0 / Math.PI); + if (this.prevRotationYaw == 0.0f && this.prevRotationPitch == 0.0f) { + float f = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.prevRotationPitch = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.prevRotationYaw = this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0 / Math.PI); } } protected MovingObjectPosition getMovingObjectPosition() { IEntitySelector[] selectors; this.lastHitSelector = null; - Vec3 vec3 = Vec3.func_72443_a((double)this.field_70165_t, (double)this.field_70163_u, (double)this.field_70161_v); - Vec3 vec31 = Vec3.func_72443_a((double)(this.field_70165_t + this.field_70159_w), (double)(this.field_70163_u + this.field_70181_x), (double)(this.field_70161_v + this.field_70179_y)); - MovingObjectPosition movingobjectposition = this.field_70170_p.func_72933_a(vec3, vec31); - vec3 = Vec3.func_72443_a((double)this.field_70165_t, (double)this.field_70163_u, (double)this.field_70161_v); - vec31 = Vec3.func_72443_a((double)(this.field_70165_t + this.field_70159_w), (double)(this.field_70163_u + this.field_70181_x), (double)(this.field_70161_v + this.field_70179_y)); + Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); + Vec3 vec31 = Vec3.createVectorHelper((double)(this.posX + this.motionX), (double)(this.posY + this.motionY), (double)(this.posZ + this.motionZ)); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); + vec31 = Vec3.createVectorHelper((double)(this.posX + this.motionX), (double)(this.posY + this.motionY), (double)(this.posZ + this.motionZ)); if (movingobjectposition != null) { - int x = MathHelper.func_76128_c((double)movingobjectposition.field_72307_f.field_72450_a); - int y = MathHelper.func_76128_c((double)movingobjectposition.field_72307_f.field_72448_b); - int z = MathHelper.func_76128_c((double)movingobjectposition.field_72307_f.field_72449_c); + int x = MathHelper.floor_double((double)movingobjectposition.hitVec.xCoord); + int y = MathHelper.floor_double((double)movingobjectposition.hitVec.yCoord); + int z = MathHelper.floor_double((double)movingobjectposition.hitVec.zCoord); int offset = -1; - this.block = this.field_70170_p.func_147439_a(x, y + offset, z); + this.block = this.worldObj.getBlock(x, y + offset, z); if (this.block != null) { - if (this.block.func_149668_a(this.field_70170_p, x, y + offset, z) == null) { + if (this.worldObj.getTileEntity(x, y + offset, z) == null) { movingobjectposition = null; } else { - vec31 = Vec3.func_72443_a((double)movingobjectposition.field_72307_f.field_72450_a, (double)movingobjectposition.field_72307_f.field_72448_b, (double)movingobjectposition.field_72307_f.field_72449_c); + vec31 = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)movingobjectposition.hitVec.zCoord); } } } Entity entity = null; - AxisAlignedBB bb = this.field_70121_D.func_72321_a(this.field_70159_w, this.field_70181_x, this.field_70179_y).func_72314_b(1.0, 1.0, 1.0); + AxisAlignedBB bb = this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0, 1.0, 1.0); IEntitySelector[] arrayOfIEntitySelector1 = selectors = new IEntitySelector[]{ItemSlashBlade.DestructableSelector, ItemSlashBlade.AttackableSelector}; int localBlock1 = selectors.length; for (int block = 0; block < localBlock1; ++block) { Entity target; IEntitySelector selector = arrayOfIEntitySelector1[block]; - List list = this.field_70170_p.func_94576_a((Entity)this, bb, selector); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, bb, selector); list.removeAll(this.alreadyHitEntity); - if (selector.equals(ItemSlashBlade.AttackableSelector) && this.getTargetEntityId() != 0 && (target = this.field_70170_p.func_73045_a(this.getTargetEntityId())) != null && target.field_70121_D.func_72326_a(bb)) { + if (selector.equals(ItemSlashBlade.AttackableSelector) && this.getTargetEntityId() != 0 && (target = this.worldObj.getEntityByID(this.getTargetEntityId())) != null && target.boundingBox.intersectsWith(bb)) { list.add(target); } double d0 = 0.0; @@ -432,7 +429,7 @@ IThrowableEntity { AxisAlignedBB axisalignedbb1; MovingObjectPosition movingobjectposition1; Entity entity1 = (Entity)list.get(i); - if (entity1 instanceof EntitySummonedSwordAdd && ((EntitySummonedSwordAdd)entity1).getThrower() == this.getThrower() || !entity1.func_70067_L() || (movingobjectposition1 = (axisalignedbb1 = entity1.field_70121_D.func_72314_b((double)(f1 = 0.3f), (double)f1, (double)f1)).func_72327_a(vec31, vec3)) == null || !((d1 = vec31.func_72438_d(movingobjectposition1.field_72307_f)) < d0) && d0 != 0.0) continue; + if (entity1 instanceof EntitySummonedSwordAdd && ((EntitySummonedSwordAdd)entity1).getThrower() == this.getThrower() || !entity1.canBeCollidedWith() || (movingobjectposition1 = (axisalignedbb1 = entity1.boundingBox.expand((double)(f1 = 0.3f), (double)f1, (double)f1)).calculateIntercept(vec31, vec3)) == null || !((d1 = vec31.squareDistanceTo(movingobjectposition1.hitVec)) < d0) && d0 != 0.0) continue; entity = entity1; d0 = d1; } @@ -441,9 +438,9 @@ IThrowableEntity { this.lastHitSelector = selector; break; } - if (movingobjectposition != null && movingobjectposition.field_72308_g != null && movingobjectposition.field_72308_g instanceof EntityPlayer) { - EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.field_72308_g; - if (entityplayer.field_71075_bZ.field_75102_a || this.getThrower() != null && this.getThrower() instanceof EntityPlayer && !((EntityPlayer)this.getThrower()).func_96122_a(entityplayer)) { + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + if (entityplayer.capabilities.disableDamage || this.getThrower() != null && this.getThrower() instanceof EntityPlayer && !((EntityPlayer)this.getThrower()).canAttackPlayer(entityplayer)) { movingobjectposition = null; } } @@ -454,23 +451,23 @@ IThrowableEntity { if (this.doTargeting()) { return; } - float f2 = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f2) * 180.0 / Math.PI); - while (this.field_70125_A - this.field_70127_C < -180.0f) { - this.field_70127_C -= 360.0f; + float f2 = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0 / Math.PI); + while (this.rotationPitch - this.prevRotationYaw < -180.0f) { + this.prevRotationYaw -= 360.0f; } } public void normalizeRotation() { - while (this.field_70125_A - this.field_70127_C >= 180.0f) { - this.field_70127_C += 360.0f; + while (this.rotationPitch - this.prevRotationYaw >= 180.0f) { + this.prevRotationYaw += 360.0f; } - while (this.field_70177_z - this.field_70126_B < -180.0f) { - this.field_70126_B -= 360.0f; + while (this.rotationYaw - this.prevRotationPitch < -180.0f) { + this.prevRotationPitch -= 360.0f; } - while (this.field_70177_z - this.field_70126_B >= 180.0f) { - this.field_70126_B += 360.0f; + while (this.rotationYaw - this.prevRotationPitch >= 180.0f) { + this.prevRotationPitch += 360.0f; } } @@ -481,134 +478,131 @@ IThrowableEntity { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.DestructObject); boolean isDestruction = true; if (target instanceof EntityFireball) { - if (((EntityFireball)target).field_70235_a != null && ((EntityFireball)target).field_70235_a.func_145782_y() == this.thrower.func_145782_y()) { + if (((EntityFireball)target).shootingEntity != null && ((EntityFireball)target).shootingEntity.getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } else if (this.thrower instanceof EntityLivingBase) { - isDestruction = !target.func_70097_a(DamageSource.func_76358_a((EntityLivingBase)((EntityLivingBase)this.thrower)), this.AttackLevel); + isDestruction = !target.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this.thrower), this.AttackLevel); } } else if (target instanceof EntityArrow) { - if (((EntityArrow)target).field_70250_c != null && ((EntityArrow)target).field_70250_c.func_145782_y() == this.thrower.func_145782_y()) { + if (((EntityArrow)target).shootingEntity != null && ((EntityArrow)target).shootingEntity.getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } - } else if (target instanceof EntityThrowable && ((EntityThrowable)target).func_85052_h() != null && ((EntityThrowable)target).func_85052_h().func_145782_y() == this.thrower.func_145782_y()) { + } else if (target instanceof EntityThrowable && ((EntityThrowable)target).getThrower() != null && ((EntityThrowable)target).getThrower().getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } - if (isDestruction && target instanceof IThrowableEntity && ((IThrowableEntity)target).getThrower() != null && ((IThrowableEntity)target).getThrower().func_145782_y() == this.thrower.func_145782_y()) { + if (isDestruction && target instanceof IThrowableEntity && ((IThrowableEntity)target).getThrower() != null && ((IThrowableEntity)target).getThrower().getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } if (isDestruction) { - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70106_y(); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.setDead(); for (int var1 = 0; var1 < 10; ++var1) { Random rand = this.getRand(); double var2 = rand.nextGaussian() * 0.02; double var4 = rand.nextGaussian() * 0.02; double var6 = rand.nextGaussian() * 0.02; double var8 = 10.0; - this.field_70170_p.func_72869_a("explode", target.field_70165_t + (double)(rand.nextFloat() * target.field_70130_N * 2.0f) - (double)target.field_70130_N - var2 * var8, target.field_70163_u + (double)(rand.nextFloat() * target.field_70131_O) - var4 * var8, target.field_70161_v + (double)(rand.nextFloat() * target.field_70130_N * 2.0f) - (double)target.field_70130_N - var6 * var8, var2, var4, var6); + this.worldObj.spawnParticle("explode", target.posX + (double)(rand.nextFloat() * target.width * 2.0f) - (double)target.width - var2 * var8, target.posY + (double)(rand.nextFloat() * target.height) - var4 * var8, target.posZ + (double)(rand.nextFloat() * target.width * 2.0f) - (double)target.width - var6 * var8, var2, var4, var6); } } StylishRankManager.doAttack((Entity)this.thrower); - this.func_70106_y(); + this.setDead(); } protected void attackEntity(Entity target) { if (this.thrower != null) { - EntitySummonedButterfly.setLastHitSummonedSwords(this.thrower, this.func_145782_y()); + EntitySummonedButterfly.setLastHitSummonedSwords(this.thrower, this.getEntityId()); } boolean hitPlayer = target instanceof EntityPlayer; if (this.shouldSkipPlayerHit(target)) { return; } if (!hitPlayer) { - this.func_70078_a(target); + this.setInWeb(target); } - if (!this.field_70170_p.field_72995_K) { + if (!this.worldObj.isRemote) { float magicDamage = 0.0f; - target.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - target.func_70097_a(ds, magicDamage); + target.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + target.attackEntityFrom(ds, magicDamage); if (this.blade != null && target instanceof EntityLivingBase && this.thrower != null && this.thrower instanceof EntityLivingBase) { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.PhantomSword); - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)target).field_70737_aN = 1; - ((ItemSlashBlade)this.blade.func_77973_b()).setDaunting((EntityLivingBase)target); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)target).hurtTime = 1; + ((ItemSlashBlade)this.blade.getItem()).setDaunting((EntityLivingBase)target); } } if (hitPlayer) { - this.func_70106_y(); + this.setDead(); } } protected void blastAttackEntity(Entity target) { - if (!this.field_70170_p.field_72995_K) { + if (!this.worldObj.isRemote) { float magicDamage = 0.0f; - target.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - target.func_70097_a(ds, magicDamage); + target.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + target.attackEntityFrom(ds, magicDamage); if (this.blade != null && target instanceof EntityLivingBase && this.thrower != null && this.thrower instanceof EntityLivingBase) { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.PhantomSword); - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)target).field_70737_aN = 1; - ((ItemSlashBlade)this.blade.func_77973_b()).setDaunting((EntityLivingBase)target); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)target).hurtTime = 1; + ((ItemSlashBlade)this.blade.getItem()).setDaunting((EntityLivingBase)target); } } } protected boolean onImpact(MovingObjectPosition mop) { boolean result = true; - if (mop.field_72308_g != null) { - Entity target = mop.field_72308_g; + if (mop.entityHit != null) { + Entity target = mop.entityHit; if (ItemSlashBlade.AttackableSelector.equals(this.lastHitSelector)) { this.attackEntity(target); } else { this.destructEntity(target); } - } else if (!this.field_70170_p.func_72945_a((Entity)this, this.field_70121_D).isEmpty()) { + } else if (!this.worldObj.getCollidingBoundingBoxes((Entity)this, this.boundingBox).isEmpty()) { result = true; } return result; } public void spawnParticle() { - if (this.func_70090_H()) { + if (this.isInWater()) { for (int l = 0; l < 4; ++l) { float trailLength = 0.25f; - this.field_70170_p.func_72869_a("bubble", this.field_70165_t - this.field_70159_w * (double)trailLength, this.field_70163_u - this.field_70181_x * (double)trailLength, this.field_70161_v - this.field_70179_y * (double)trailLength, this.field_70159_w, this.field_70181_x, this.field_70179_y); + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)trailLength, this.posY - this.motionY * (double)trailLength, this.posZ - this.motionZ * (double)trailLength, this.motionX, this.motionY, this.motionZ); } } } public void calculateSpeed() { float speedReductionFactor = 1.1f; - if (this.func_70090_H()) { + if (this.isInWater()) { speedReductionFactor = 1.0f; } - this.field_70159_w *= (double)speedReductionFactor; - this.field_70181_x *= (double)speedReductionFactor; - this.field_70179_y *= (double)speedReductionFactor; + this.motionX *= (double)speedReductionFactor; + this.motionY *= (double)speedReductionFactor; + this.motionZ *= (double)speedReductionFactor; } - public void func_70071_h_() { - this.field_70142_S = this.field_70165_t; - this.field_70137_T = this.field_70163_u; - this.field_70136_U = this.field_70161_v; - super.func_70071_h_(); + public void onUpdate() { + super.onUpdate(); if (this.ridingEntity2 != null) { - this.func_70098_U(); + this.updateRidden(); } else { - if (this.field_70173_aa >= this.getLifeTime()) { - this.func_70106_y(); + if (this.ticksExisted >= this.getLifeTime()) { + this.setDead(); } this.initRotation(); MovingObjectPosition movingobjectposition = this.getMovingObjectPosition(); @@ -617,69 +611,69 @@ IThrowableEntity { } this.calculateSpeed(); this.doRotation(); - if (this.getInterval() < this.field_70173_aa) { - this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y); + if (this.getInterval() < this.ticksExisted) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); } this.normalizeRotation(); this.spawnParticle(); } } - public void func_70106_y() { + public void setDead() { if (this.thrower != null && this.thrower instanceof EntityPlayer) { - ((EntityPlayer)this.thrower).func_71009_b((Entity)this); + ((EntityPlayer)this.thrower).onCriticalHit((Entity)this); } - this.field_70170_p.func_72908_a(this.field_70169_q, this.field_70167_r, this.field_70166_s, "dig.glass", 0.25f, 1.6f); - AxisAlignedBB bb = this.field_70121_D.func_72314_b(1.0, 1.0, 1.0); - List list = this.field_70170_p.func_94576_a((Entity)this, bb, ItemSlashBlade.AttackableSelector); + this.worldObj.playSoundEffect(this.prevPosX, this.prevPosY, this.prevPosZ, "dig.glass", 0.25f, 1.6f); + AxisAlignedBB bb = this.boundingBox.expand(1.0, 1.0, 1.0); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, bb, ItemSlashBlade.AttackableSelector); list.removeAll(this.alreadyHitEntity); for (Entity target : (java.util.List)(java.util.List)list) { if (target == null) continue; this.blastAttackEntity(target); } - super.func_70106_y(); + super.setDead(); } public Random getRand() { - return this.field_70146_Z; + return this.rand; } private static void setLastHitSummonedSwords(Entity entity, int entityId) { try { Object data = Entity.class.getMethod("getEntityData", new Class[0]).invoke(entity, new Object[0]); if (data instanceof NBTTagCompound) { - ((NBTTagCompound)data).func_74768_a("LastHitSummonedSwords", entityId); + ((NBTTagCompound)data).setInteger("LastHitSummonedSwords", entityId); } } catch (Exception ignored) { } } - public boolean func_70038_c(double par1, double par3, double par5) { + public boolean canBePushed(double par1, double par3, double par5) { return false; } - public void func_70091_d(double par1, double par3, double par5) { - super.func_70091_d(par1, par3, par5); + public void moveEntity(double par1, double par3, double par5) { + super.moveEntity(par1, par3, par5); } - protected void func_70081_e(int par1) { + protected void fall(int par1) { } - public boolean func_70072_I() { + public boolean isInWater() { return false; } - public boolean func_70055_a(Material par1Material) { + public boolean isInsideOfMaterial(Material par1Material) { return false; } - public boolean func_70058_J() { + public boolean handleWaterMovement() { return false; } @SideOnly(value=Side.CLIENT) - public int func_70070_b(float par1) { + public int getBrightnessForRender(float par1) { float f1 = 0.5f; if (f1 < 0.0f) { f1 = 0.0f; @@ -687,7 +681,7 @@ IThrowableEntity { if (f1 > 1.0f) { f1 = 1.0f; } - int i = super.func_70070_b(par1); + int i = super.getBrightnessForRender(par1); int j = i & 0xFF; int k = i >> 16 & 0xFF; if ((j += (int)(f1 * 15.0f * 16.0f)) > 240) { @@ -696,21 +690,21 @@ IThrowableEntity { return j | k << 16; } - public float func_70013_c(float par1) { - float f1 = super.func_70013_c(par1); + public float getBrightness(float par1) { + float f1 = super.getBrightness(par1); float f2 = 0.9f; f2 = f2 * f2 * f2 * f2; return f1 * (1.0f - f2) + f2; } - protected void func_70037_a(NBTTagCompound nbttagcompound) { + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { } - protected void func_70014_b(NBTTagCompound nbttagcompound) { + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { } @SideOnly(value=Side.CLIENT) - public float func_70053_R() { + public float getShadowSize() { return 0.0f; } @@ -718,26 +712,26 @@ IThrowableEntity { return this.ridingEntity2; } - public void func_70078_a(Entity par1Entity) { + public void setInWeb(Entity par1Entity) { if (par1Entity != null) { - this.hitYaw = this.field_70177_z - par1Entity.field_70177_z; - this.hitPitch = this.field_70125_A - par1Entity.field_70125_A; - this.hitX = this.field_70165_t - par1Entity.field_70165_t; - this.hitY = this.field_70163_u - par1Entity.field_70163_u; - this.hitZ = this.field_70161_v - par1Entity.field_70161_v; + this.hitYaw = this.rotationYaw - par1Entity.rotationYaw; + this.hitPitch = this.rotationPitch - par1Entity.rotationPitch; + this.hitX = this.posX - par1Entity.posX; + this.hitY = this.posY - par1Entity.posY; + this.hitZ = this.posZ - par1Entity.posZ; this.ridingEntity2 = par1Entity; - this.field_70173_aa = 0; + this.ticksExisted = 0; } } @SideOnly(value=Side.CLIENT) - public void func_70056_a(double par1, double par3, double par5, float par7, float par8, int par9) { + public void setVelocity(double par1, double par3, double par5, float par7, float par8, int par9) { } - public void func_70063_aa() { + public void onKillEntity() { } - public boolean func_70027_ad() { + public boolean isInRangeToRenderDist() { return false; } @@ -745,23 +739,23 @@ IThrowableEntity { return pass == 1; } - public void func_70110_aj() { + public void playLivingSound() { } - public void func_70186_c(double v, double v2, double v3, float v4, float v5) { + public void setThrowableHeading(double v, double v2, double v3, float v4, float v5) { } public Entity getThrower() { int id; if (this.thrower == null && (id = this.getThrowerEntityId()) != 0) { - this.thrower = this.field_70170_p.func_73045_a(id); + this.thrower = this.worldObj.getEntityByID(id); } return this.thrower; } public void setThrower(Entity entity) { if (entity != null) { - this.setThrowerEntityId(entity.func_145782_y()); + this.setThrowerEntityId(entity.getEntityId()); } this.thrower = entity; } diff --git a/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordAdd.java b/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordAdd.java index 9ef9240..688de07 100644 --- a/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordAdd.java +++ b/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordAdd.java @@ -86,7 +86,7 @@ IThrowableEntity { public EntitySummonedSwordAdd(World par1World) { super(par1World); - this.field_70145_X = true; + this.noClip = true; } public EntitySummonedSwordAdd(World par1World, EntityLivingBase entityLiving, float AttackLevel, float roll) { @@ -97,91 +97,91 @@ IThrowableEntity { public EntitySummonedSwordAdd(World par1World, EntityLivingBase entityLiving, float AttackLevel) { this(par1World); this.AttackLevel = AttackLevel; - this.field_70129_M = entityLiving.func_70047_e() / 2.0f; + this.width = entityLiving.getEyeHeight() / 2.0f; this.setThrower((Entity)entityLiving); - this.blade = entityLiving.func_70694_bm(); - if (this.blade != null && !(this.blade.func_77973_b() instanceof ItemSlashBlade)) { + this.blade = entityLiving.getHeldItem(); + if (this.blade != null && !(this.blade.getItem() instanceof ItemSlashBlade)) { this.blade = null; } this.alreadyHitEntity.clear(); this.alreadyHitEntity.add(this.thrower); - this.alreadyHitEntity.add(this.thrower.field_70154_o); - this.alreadyHitEntity.add(this.thrower.field_70153_n); - this.field_70173_aa = 0; - this.func_70105_a(0.5f, 0.5f); + this.alreadyHitEntity.add(this.thrower.riddenByEntity); + this.alreadyHitEntity.add(this.thrower.ridingEntity); + this.ticksExisted = 0; + this.setSize(0.5f, 0.5f); float dist = 2.0f; - double ran = ((double)this.field_70146_Z.nextFloat() - 0.5) * 2.0; - double yaw = Math.toRadians(-this.thrower.field_70177_z + 90.0f); + double ran = ((double)this.rand.nextFloat() - 0.5) * 2.0; + double yaw = Math.toRadians(-this.thrower.rotationYaw + 90.0f); double x = ran * Math.sin(yaw); double y = 1.0 - Math.abs(ran); double z = ran * Math.cos(yaw); - this.func_70012_b(this.thrower.field_70165_t + (x *= (double)dist), this.thrower.field_70163_u + (y *= (double)dist), this.thrower.field_70161_v + (z *= (double)dist), this.thrower.field_70177_z, this.thrower.field_70125_A); - this.iniYaw = this.thrower.field_70177_z; - this.iniPitch = this.thrower.field_70125_A; + this.setLocationAndAngles(this.thrower.posX + (x *= (double)dist), this.thrower.posY + (y *= (double)dist), this.thrower.posZ + (z *= (double)dist), this.thrower.rotationYaw, this.thrower.rotationPitch); + this.iniYaw = this.thrower.rotationYaw; + this.iniPitch = this.thrower.rotationPitch; this.setDriveVector(1.75f); } - protected void func_70088_a() { - this.func_70096_w().func_75682_a(11, (Object)0); - this.func_70096_w().func_75682_a(4, (Object)0); - this.func_70096_w().func_75682_a(5, (Object)Float.valueOf(0.0f)); - this.func_70096_w().func_75682_a(6, (Object)20); - this.func_70096_w().func_75682_a(7, (Object)7); - this.func_70096_w().func_75682_a(10, (Object)0x3333FF); + protected void entityInit() { + this.getDataWatcher().addObject(11, (Object)0); + this.getDataWatcher().addObject(4, (Object)0); + this.getDataWatcher().addObject(5, (Object)Float.valueOf(0.0f)); + this.getDataWatcher().addObject(6, (Object)20); + this.getDataWatcher().addObject(7, (Object)7); + this.getDataWatcher().addObject(10, (Object)0x3333FF); } public int getThrowerEntityId() { - return this.func_70096_w().func_75679_c(11); + return this.getDataWatcher().getWatchableObjectInt(11); } public void setThrowerEntityId(int entityid) { - this.func_70096_w().func_75692_b(11, (Object)entityid); + this.getDataWatcher().updateObject(11, (Object)entityid); } public int getTargetEntityId() { - return this.func_70096_w().func_75679_c(4); + return this.getDataWatcher().getWatchableObjectInt(4); } public void setTargetEntityId(int entityid) { - this.func_70096_w().func_75692_b(4, (Object)entityid); + this.getDataWatcher().updateObject(4, (Object)entityid); } public float getRoll() { - return this.func_70096_w().func_111145_d(5); + return this.getDataWatcher().getWatchableObjectFloat(5); } public void setRoll(float roll) { - this.func_70096_w().func_75692_b(5, (Object)Float.valueOf(roll)); + this.getDataWatcher().updateObject(5, (Object)Float.valueOf(roll)); } public int getLifeTime() { - return this.func_70096_w().func_75679_c(6); + return this.getDataWatcher().getWatchableObjectInt(6); } public void setLifeTime(int lifetime) { - this.func_70096_w().func_75692_b(6, (Object)lifetime); + this.getDataWatcher().updateObject(6, (Object)lifetime); } public int getInterval() { - return this.func_70096_w().func_75679_c(7); + return this.getDataWatcher().getWatchableObjectInt(7); } public void setInterval(int value) { - this.func_70096_w().func_75692_b(7, (Object)value); + this.getDataWatcher().updateObject(7, (Object)value); } public int getColor() { - return this.func_70096_w().func_75679_c(10); + return this.getDataWatcher().getWatchableObjectInt(10); } public void setColor(int value) { - this.func_70096_w().func_75692_b(10, (Object)value); + this.getDataWatcher().updateObject(10, (Object)value); } public boolean doTargeting() { Entity target; Entity rayEntity; - if (this.field_70173_aa > this.getInterval()) { + if (this.ticksExisted > this.getInterval()) { return false; } int targetid = this.getTargetEntityId(); @@ -190,19 +190,19 @@ IThrowableEntity { owner = this; } if (targetid == 0 && (rayEntity = this.getRayTrace(owner, 30.0)) != null) { - targetid = rayEntity.func_145782_y(); - this.setTargetEntityId(rayEntity.func_145782_y()); + targetid = rayEntity.getEntityId(); + this.setTargetEntityId(rayEntity.getEntityId()); } if (targetid == 0 && (rayEntity = this.getRayTrace(owner, 30.0, 5.0f, 5.0f)) != null) { - targetid = rayEntity.func_145782_y(); - this.setTargetEntityId(rayEntity.func_145782_y()); + targetid = rayEntity.getEntityId(); + this.setTargetEntityId(rayEntity.getEntityId()); } - if (targetid != 0 && (target = this.field_70170_p.func_73045_a(targetid)) != null) { + if (targetid != 0 && (target = this.worldObj.getEntityByID(targetid)) != null) { if (Float.isNaN(this.iniPitch) && this.thrower != null) { - this.iniYaw = this.thrower.field_70177_z; - this.iniPitch = this.thrower.field_70125_A; + this.iniYaw = this.thrower.rotationYaw; + this.iniPitch = this.thrower.rotationPitch; } - this.faceEntity(this, target, (float)this.field_70173_aa * 1.0f, (float)this.field_70173_aa * 1.0f); + this.faceEntity(this, target, (float)this.ticksExisted * 1.0f, (float)this.ticksExisted * 1.0f); this.setDriveVector(1.75f, false); } return true; @@ -218,29 +218,29 @@ IThrowableEntity { double reachMin = reachMax; Vec3 entityPos = EntitySummonedSwordAdd.getPosition(owner); if (objectMouseOver != null) { - reachMin = objectMouseOver.field_72307_f.func_72438_d(entityPos); + reachMin = objectMouseOver.hitVec.squareDistanceTo(entityPos); } Vec3 lookVec = EntitySummonedSwordAdd.getLook(owner, par1); - Vec3 reachVec = entityPos.func_72441_c(lookVec.field_72450_a * reachMax, lookVec.field_72448_b * reachMax, lookVec.field_72449_c * reachMax); + Vec3 reachVec = entityPos.addVector(lookVec.xCoord * reachMax, lookVec.yCoord * reachMax, lookVec.zCoord * reachMax); Entity pointedEntity = null; - List list = this.field_70170_p.func_72839_b((Entity)this, this.field_70121_D.func_72321_a(lookVec.field_72450_a * reachMax, lookVec.field_72448_b * reachMax, lookVec.field_72449_c * reachMax).func_72314_b((double)expandFactor, (double)expandFactor, (double)expandFactor)); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, this.boundingBox.addCoord(lookVec.xCoord * reachMax, lookVec.yCoord * reachMax, lookVec.zCoord * reachMax).expand((double)expandFactor, (double)expandFactor, (double)expandFactor)); list.removeAll(this.alreadyHitEntity); double tmpDistance = reachMin; EntityLivingBase viewer = owner instanceof EntityLivingBase ? (EntityLivingBase)owner : null; for (Entity entity : (java.util.List)(java.util.List)list) { double d3; - if (entity == null || !entity.func_70067_L() || !ItemSlashBlade.AttackableSelector.func_82704_a(entity) || viewer != null && !viewer.func_70685_l(entity)) continue; - float borderSize = entity.func_70111_Y() + expandBorder; - AxisAlignedBB axisalignedbb = entity.field_70121_D.func_72314_b((double)borderSize, (double)borderSize, (double)borderSize); - MovingObjectPosition movingobjectposition = axisalignedbb.func_72327_a(entityPos, reachVec); - if (axisalignedbb.func_72318_a(entityPos)) { + if (entity == null || !entity.canBeCollidedWith() || !ItemSlashBlade.AttackableSelector.isEntityApplicable(entity) || viewer != null && !viewer.canEntityBeSeen(entity)) continue; + float borderSize = entity.getCollisionBorderSize() + expandBorder; + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)borderSize, (double)borderSize, (double)borderSize); + MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(entityPos, reachVec); + if (axisalignedbb.isVecInside(entityPos)) { if (!(0.0 < tmpDistance) && tmpDistance != 0.0) continue; pointedEntity = entity; tmpDistance = 0.0; continue; } - if (movingobjectposition == null || !((d3 = entityPos.func_72438_d(movingobjectposition.field_72307_f)) < tmpDistance) && tmpDistance != 0.0) continue; - if (entity == this.field_70154_o) { + if (movingobjectposition == null || !((d3 = entityPos.squareDistanceTo(movingobjectposition.hitVec)) < tmpDistance) && tmpDistance != 0.0) continue; + if (entity == this.riddenByEntity) { if (tmpDistance != 0.0) continue; pointedEntity = entity; continue; @@ -254,42 +254,42 @@ IThrowableEntity { public static MovingObjectPosition rayTrace(Entity owner, double par1, float par3) { Vec3 vec3 = EntitySummonedSwordAdd.getPosition(owner); Vec3 vec31 = EntitySummonedSwordAdd.getLook(owner, par3); - Vec3 vec32 = vec3.func_72441_c(vec31.field_72450_a * par1, vec31.field_72448_b * par1, vec31.field_72449_c * par1); - return owner.field_70170_p.func_147447_a(vec3, vec32, false, false, true); + Vec3 vec32 = vec3.addVector(vec31.xCoord * par1, vec31.yCoord * par1, vec31.zCoord * par1); + return owner.worldObj.rayTraceBlocks(vec3, vec32, false); } public static Vec3 getPosition(Entity owner) { - return Vec3.func_72443_a((double)owner.field_70165_t, (double)(owner.field_70163_u + (double)owner.func_70047_e()), (double)owner.field_70161_v); + return Vec3.createVectorHelper((double)owner.posX, (double)(owner.posY + (double)owner.getEyeHeight()), (double)owner.posZ); } public static Vec3 getLook(Entity owner, float rotMax) { if (rotMax == 1.0f) { - float f1 = MathHelper.func_76134_b((float)(-owner.field_70177_z * 0.01745329f - 3.141593f)); - float f2 = MathHelper.func_76126_a((float)(-owner.field_70177_z * 0.01745329f - 3.141593f)); - float f3 = -MathHelper.func_76134_b((float)(-owner.field_70125_A * 0.01745329f)); - float f4 = MathHelper.func_76126_a((float)(-owner.field_70125_A * 0.01745329f)); - return Vec3.func_72443_a((double)(f2 * f3), (double)f4, (double)(f1 * f3)); + float f1 = MathHelper.cos((float)(-owner.rotationYaw * 0.01745329f - 3.141593f)); + float f2 = MathHelper.sin((float)(-owner.rotationYaw * 0.01745329f - 3.141593f)); + float f3 = -MathHelper.cos((float)(-owner.rotationPitch * 0.01745329f)); + float f4 = MathHelper.sin((float)(-owner.rotationPitch * 0.01745329f)); + return Vec3.createVectorHelper((double)(f2 * f3), (double)f4, (double)(f1 * f3)); } - float f1 = owner.field_70127_C + (owner.field_70125_A - owner.field_70127_C) * rotMax; - float f2 = owner.field_70126_B + (owner.field_70177_z - owner.field_70126_B) * rotMax; - float f3 = MathHelper.func_76134_b((float)(-f2 * 0.01745329f - 3.141593f)); - float f4 = MathHelper.func_76126_a((float)(-f2 * 0.01745329f - 3.141593f)); - float f5 = -MathHelper.func_76134_b((float)(-f1 * 0.01745329f)); - float f6 = MathHelper.func_76126_a((float)(-f1 * 0.01745329f)); - return Vec3.func_72443_a((double)(f4 * f5), (double)f6, (double)(f3 * f5)); + float f1 = owner.prevRotationYaw + (owner.rotationPitch - owner.prevRotationYaw) * rotMax; + float f2 = owner.prevRotationPitch + (owner.rotationYaw - owner.prevRotationPitch) * rotMax; + float f3 = MathHelper.cos((float)(-f2 * 0.01745329f - 3.141593f)); + float f4 = MathHelper.sin((float)(-f2 * 0.01745329f - 3.141593f)); + float f5 = -MathHelper.cos((float)(-f1 * 0.01745329f)); + float f6 = MathHelper.sin((float)(-f1 * 0.01745329f)); + return Vec3.createVectorHelper((double)(f4 * f5), (double)f6, (double)(f3 * f5)); } public void faceEntity(Entity viewer, Entity target, float yawStep, float pitchStep) { double d2; - double d0 = target.field_70165_t - viewer.field_70165_t; - double d1 = target.field_70161_v - viewer.field_70161_v; + double d0 = target.posX - viewer.posX; + double d1 = target.posZ - viewer.posZ; if (target instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)target; - d2 = entitylivingbase.field_70163_u + (double)entitylivingbase.func_70047_e() - (viewer.field_70163_u + (double)viewer.func_70047_e()); + d2 = entitylivingbase.posY + (double)entitylivingbase.getEyeHeight() - (viewer.posY + (double)viewer.getEyeHeight()); } else { - d2 = (target.field_70121_D.field_72338_b + target.field_70121_D.field_72337_e) / 2.0 - (viewer.field_70163_u + (double)viewer.func_70047_e()); + d2 = (target.boundingBox.minY + target.boundingBox.maxY) / 2.0 - (viewer.posY + (double)viewer.getEyeHeight()); } - double d3 = MathHelper.func_76133_a((double)(d0 * d0 + d1 * d1)); + double d3 = MathHelper.sqrt_double((double)(d0 * d0 + d1 * d1)); float f2 = (float)(Math.atan2(d1, d0) * 180.0 / Math.PI) - 90.0f; float f3 = (float)(-(Math.atan2(d2, d3) * 180.0 / Math.PI)); this.iniPitch = this.updateRotation(this.iniPitch, f3, pitchStep); @@ -297,7 +297,7 @@ IThrowableEntity { } private float updateRotation(float par1, float par2, float par3) { - float f3 = MathHelper.func_76142_g((float)(par2 - par1)); + float f3 = MathHelper.wrapAngleTo180_float((float)(par2 - par1)); if (f3 > par3) { f3 = par3; } @@ -312,10 +312,10 @@ IThrowableEntity { return false; } this.alreadyHitEntity.add(hitEntity); - long now = this.field_70170_p.func_82737_E(); + long now = this.worldObj.getTotalWorldTime(); Long nextTick = playerHitCooldown.get(hitEntity); if (nextTick != null && nextTick.longValue() > now) { - this.func_70106_y(); + this.setDead(); return true; } playerHitCooldown.put(hitEntity, Long.valueOf(now + PLAYER_HIT_COOLDOWN_TICKS)); @@ -329,99 +329,96 @@ IThrowableEntity { public void setDriveVector(float fYVecOfst, boolean init) { float fYawDtoR = this.iniYaw / 180.0f * 3.141593f; float fPitDtoR = this.iniPitch / 180.0f * 3.141593f; - this.field_70159_w = -MathHelper.func_76126_a((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst; - this.field_70181_x = -MathHelper.func_76126_a((float)fPitDtoR) * fYVecOfst; - this.field_70179_y = MathHelper.func_76134_b((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst; - float f3 = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f3) * 180.0 / Math.PI); + this.motionX = -MathHelper.sin((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst; + this.motionY = -MathHelper.sin((float)fPitDtoR) * fYVecOfst; + this.motionZ = MathHelper.cos((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst; + float f3 = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.rotationPitch = (float)(Math.atan2(this.motionY, f3) * 180.0 / Math.PI); if (init) { this.speed = fYVecOfst; - this.field_70126_B = this.field_70177_z; - this.field_70127_C = this.field_70125_A; + this.prevRotationPitch = this.rotationYaw; + this.prevRotationYaw = this.rotationPitch; } } - public void func_70098_U() { + public void updateRidden() { Entity ridingEntity = this.ridingEntity2; - if (ridingEntity.field_70128_L) { - this.func_70106_y(); + if (ridingEntity.isDead) { + this.setDead(); return; } - this.field_70142_S = this.field_70165_t; - this.field_70137_T = this.field_70163_u; - this.field_70136_U = this.field_70161_v; - this.field_70165_t = ridingEntity.field_70165_t + (this.hitX * Math.cos(Math.toRadians(ridingEntity.field_70177_z)) - this.hitZ * Math.sin(Math.toRadians(ridingEntity.field_70177_z))); - this.field_70163_u = ridingEntity.field_70163_u + this.hitY; - this.field_70161_v = ridingEntity.field_70161_v + (this.hitX * Math.sin(Math.toRadians(ridingEntity.field_70177_z)) + this.hitZ * Math.cos(Math.toRadians(ridingEntity.field_70177_z))); - this.field_70127_C = this.field_70125_A; - this.field_70126_B = this.field_70177_z; - this.field_70125_A = ridingEntity.field_70125_A + this.hitPitch; - this.field_70177_z = ridingEntity.field_70177_z + this.hitYaw; - this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); - this.func_70101_b(this.field_70177_z, this.field_70125_A); - if (this.field_70173_aa >= 200) { - if (!ridingEntity.field_70128_L && !this.field_70170_p.field_72995_K) { + this.posX = ridingEntity.posX + (this.hitX * Math.cos(Math.toRadians(ridingEntity.rotationYaw)) - this.hitZ * Math.sin(Math.toRadians(ridingEntity.rotationYaw))); + this.posY = ridingEntity.posY + this.hitY; + this.posZ = ridingEntity.posZ + (this.hitX * Math.sin(Math.toRadians(ridingEntity.rotationYaw)) + this.hitZ * Math.cos(Math.toRadians(ridingEntity.rotationYaw))); + this.prevRotationYaw = this.rotationPitch; + this.prevRotationPitch = this.rotationYaw; + this.rotationPitch = ridingEntity.rotationPitch + this.hitPitch; + this.rotationYaw = ridingEntity.rotationYaw + this.hitYaw; + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + if (this.ticksExisted >= 200) { + if (!ridingEntity.isDead && !this.worldObj.isRemote) { float magicDamage = 0.0f; - ridingEntity.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - ridingEntity.func_70097_a(ds, magicDamage); + ridingEntity.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + ridingEntity.attackEntityFrom(ds, magicDamage); if (this.blade != null && ridingEntity instanceof EntityLivingBase) { if (this.thrower != null) { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.BreakPhantomSword); - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)ridingEntity, (EntityLivingBase)this.thrower); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)ridingEntity, (EntityLivingBase)this.thrower); } - ridingEntity.field_70159_w = 0.0; - ridingEntity.field_70181_x = 0.0; - ridingEntity.field_70179_y = 0.0; - ridingEntity.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)ridingEntity).field_70737_aN = 1; + ridingEntity.motionX = 0.0; + ridingEntity.motionY = 0.0; + ridingEntity.motionZ = 0.0; + ridingEntity.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)ridingEntity).hurtTime = 1; } } - this.func_70106_y(); + this.setDead(); } } protected void initRotation() { - if (this.field_70127_C == 0.0f && this.field_70126_B == 0.0f) { - float f = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70126_B = this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70127_C = this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f) * 180.0 / Math.PI); + if (this.prevRotationYaw == 0.0f && this.prevRotationPitch == 0.0f) { + float f = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.prevRotationPitch = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.prevRotationYaw = this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0 / Math.PI); } } protected MovingObjectPosition getMovingObjectPosition() { IEntitySelector[] selectors; this.lastHitSelector = null; - Vec3 vec3 = Vec3.func_72443_a((double)this.field_70165_t, (double)this.field_70163_u, (double)this.field_70161_v); - Vec3 vec31 = Vec3.func_72443_a((double)(this.field_70165_t + this.field_70159_w), (double)(this.field_70163_u + this.field_70181_x), (double)(this.field_70161_v + this.field_70179_y)); - MovingObjectPosition movingobjectposition = this.field_70170_p.func_72933_a(vec3, vec31); - vec3 = Vec3.func_72443_a((double)this.field_70165_t, (double)this.field_70163_u, (double)this.field_70161_v); - vec31 = Vec3.func_72443_a((double)(this.field_70165_t + this.field_70159_w), (double)(this.field_70163_u + this.field_70181_x), (double)(this.field_70161_v + this.field_70179_y)); + Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); + Vec3 vec31 = Vec3.createVectorHelper((double)(this.posX + this.motionX), (double)(this.posY + this.motionY), (double)(this.posZ + this.motionZ)); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); + vec31 = Vec3.createVectorHelper((double)(this.posX + this.motionX), (double)(this.posY + this.motionY), (double)(this.posZ + this.motionZ)); if (movingobjectposition != null) { - int x = MathHelper.func_76128_c((double)movingobjectposition.field_72307_f.field_72450_a); - int y = MathHelper.func_76128_c((double)movingobjectposition.field_72307_f.field_72448_b); - int z = MathHelper.func_76128_c((double)movingobjectposition.field_72307_f.field_72449_c); + int x = MathHelper.floor_double((double)movingobjectposition.hitVec.xCoord); + int y = MathHelper.floor_double((double)movingobjectposition.hitVec.yCoord); + int z = MathHelper.floor_double((double)movingobjectposition.hitVec.zCoord); int offset = -1; - this.block = this.field_70170_p.func_147439_a(x, y + offset, z); + this.block = this.worldObj.getBlock(x, y + offset, z); if (this.block != null) { - if (this.block.func_149668_a(this.field_70170_p, x, y + offset, z) == null) { + if (this.worldObj.getTileEntity(x, y + offset, z) == null) { movingobjectposition = null; } else { - vec31 = Vec3.func_72443_a((double)movingobjectposition.field_72307_f.field_72450_a, (double)movingobjectposition.field_72307_f.field_72448_b, (double)movingobjectposition.field_72307_f.field_72449_c); + vec31 = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)movingobjectposition.hitVec.zCoord); } } } Entity entity = null; - AxisAlignedBB bb = this.field_70121_D.func_72321_a(this.field_70159_w, this.field_70181_x, this.field_70179_y).func_72314_b(1.0, 1.0, 1.0); + AxisAlignedBB bb = this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0, 1.0, 1.0); IEntitySelector[] arrayOfIEntitySelector1 = selectors = new IEntitySelector[]{ItemSlashBlade.DestructableSelector, ItemSlashBlade.AttackableSelector}; int localBlock1 = selectors.length; for (int block = 0; block < localBlock1; ++block) { Entity target; IEntitySelector selector = arrayOfIEntitySelector1[block]; - List list = this.field_70170_p.func_94576_a((Entity)this, bb, selector); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, bb, selector); list.removeAll(this.alreadyHitEntity); - if (selector.equals(ItemSlashBlade.AttackableSelector) && this.getTargetEntityId() != 0 && (target = this.field_70170_p.func_73045_a(this.getTargetEntityId())) != null && target.field_70121_D.func_72326_a(bb)) { + if (selector.equals(ItemSlashBlade.AttackableSelector) && this.getTargetEntityId() != 0 && (target = this.worldObj.getEntityByID(this.getTargetEntityId())) != null && target.boundingBox.intersectsWith(bb)) { list.add(target); } double d0 = 0.0; @@ -431,7 +428,7 @@ IThrowableEntity { AxisAlignedBB axisalignedbb1; MovingObjectPosition movingobjectposition1; Entity entity1 = (Entity)list.get(i); - if (entity1 instanceof EntitySummonedSwordAdd && ((EntitySummonedSwordAdd)entity1).getThrower() == this.getThrower() || !entity1.func_70067_L() || (movingobjectposition1 = (axisalignedbb1 = entity1.field_70121_D.func_72314_b((double)(f1 = 0.3f), (double)f1, (double)f1)).func_72327_a(vec31, vec3)) == null || !((d1 = vec31.func_72438_d(movingobjectposition1.field_72307_f)) < d0) && d0 != 0.0) continue; + if (entity1 instanceof EntitySummonedSwordAdd && ((EntitySummonedSwordAdd)entity1).getThrower() == this.getThrower() || !entity1.canBeCollidedWith() || (movingobjectposition1 = (axisalignedbb1 = entity1.boundingBox.expand((double)(f1 = 0.3f), (double)f1, (double)f1)).calculateIntercept(vec31, vec3)) == null || !((d1 = vec31.squareDistanceTo(movingobjectposition1.hitVec)) < d0) && d0 != 0.0) continue; entity = entity1; d0 = d1; } @@ -440,9 +437,9 @@ IThrowableEntity { this.lastHitSelector = selector; break; } - if (movingobjectposition != null && movingobjectposition.field_72308_g != null && movingobjectposition.field_72308_g instanceof EntityPlayer) { - EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.field_72308_g; - if (entityplayer.field_71075_bZ.field_75102_a || this.getThrower() != null && this.getThrower() instanceof EntityPlayer && !((EntityPlayer)this.getThrower()).func_96122_a(entityplayer)) { + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + if (entityplayer.capabilities.disableDamage || this.getThrower() != null && this.getThrower() instanceof EntityPlayer && !((EntityPlayer)this.getThrower()).canAttackPlayer(entityplayer)) { movingobjectposition = null; } } @@ -453,23 +450,23 @@ IThrowableEntity { if (this.doTargeting()) { return; } - float f2 = MathHelper.func_76133_a((double)(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y)); - this.field_70177_z = (float)(Math.atan2(this.field_70159_w, this.field_70179_y) * 180.0 / Math.PI); - this.field_70125_A = (float)(Math.atan2(this.field_70181_x, f2) * 180.0 / Math.PI); - while (this.field_70125_A - this.field_70127_C < -180.0f) { - this.field_70127_C -= 360.0f; + float f2 = MathHelper.sqrt_double((double)(this.motionX * this.motionX + this.motionZ * this.motionZ)); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0 / Math.PI); + this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0 / Math.PI); + while (this.rotationPitch - this.prevRotationYaw < -180.0f) { + this.prevRotationYaw -= 360.0f; } } public void normalizeRotation() { - while (this.field_70125_A - this.field_70127_C >= 180.0f) { - this.field_70127_C += 360.0f; + while (this.rotationPitch - this.prevRotationYaw >= 180.0f) { + this.prevRotationYaw += 360.0f; } - while (this.field_70177_z - this.field_70126_B < -180.0f) { - this.field_70126_B -= 360.0f; + while (this.rotationYaw - this.prevRotationPitch < -180.0f) { + this.prevRotationPitch -= 360.0f; } - while (this.field_70177_z - this.field_70126_B >= 180.0f) { - this.field_70126_B += 360.0f; + while (this.rotationYaw - this.prevRotationPitch >= 180.0f) { + this.prevRotationPitch += 360.0f; } } @@ -480,134 +477,131 @@ IThrowableEntity { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.DestructObject); boolean isDestruction = true; if (target instanceof EntityFireball) { - if (((EntityFireball)target).field_70235_a != null && ((EntityFireball)target).field_70235_a.func_145782_y() == this.thrower.func_145782_y()) { + if (((EntityFireball)target).shootingEntity != null && ((EntityFireball)target).shootingEntity.getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } else if (this.thrower instanceof EntityLivingBase) { - isDestruction = !target.func_70097_a(DamageSource.func_76358_a((EntityLivingBase)((EntityLivingBase)this.thrower)), this.AttackLevel); + isDestruction = !target.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this.thrower), this.AttackLevel); } } else if (target instanceof EntityArrow) { - if (((EntityArrow)target).field_70250_c != null && ((EntityArrow)target).field_70250_c.func_145782_y() == this.thrower.func_145782_y()) { + if (((EntityArrow)target).shootingEntity != null && ((EntityArrow)target).shootingEntity.getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } - } else if (target instanceof EntityThrowable && ((EntityThrowable)target).func_85052_h() != null && ((EntityThrowable)target).func_85052_h().func_145782_y() == this.thrower.func_145782_y()) { + } else if (target instanceof EntityThrowable && ((EntityThrowable)target).getThrower() != null && ((EntityThrowable)target).getThrower().getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } - if (isDestruction && target instanceof IThrowableEntity && ((IThrowableEntity)target).getThrower() != null && ((IThrowableEntity)target).getThrower().func_145782_y() == this.thrower.func_145782_y()) { + if (isDestruction && target instanceof IThrowableEntity && ((IThrowableEntity)target).getThrower() != null && ((IThrowableEntity)target).getThrower().getEntityId() == this.thrower.getEntityId()) { isDestruction = false; } if (isDestruction) { - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70106_y(); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.setDead(); for (int var1 = 0; var1 < 10; ++var1) { Random rand = this.getRand(); double var2 = rand.nextGaussian() * 0.02; double var4 = rand.nextGaussian() * 0.02; double var6 = rand.nextGaussian() * 0.02; double var8 = 10.0; - this.field_70170_p.func_72869_a("explode", target.field_70165_t + (double)(rand.nextFloat() * target.field_70130_N * 2.0f) - (double)target.field_70130_N - var2 * var8, target.field_70163_u + (double)(rand.nextFloat() * target.field_70131_O) - var4 * var8, target.field_70161_v + (double)(rand.nextFloat() * target.field_70130_N * 2.0f) - (double)target.field_70130_N - var6 * var8, var2, var4, var6); + this.worldObj.spawnParticle("explode", target.posX + (double)(rand.nextFloat() * target.width * 2.0f) - (double)target.width - var2 * var8, target.posY + (double)(rand.nextFloat() * target.height) - var4 * var8, target.posZ + (double)(rand.nextFloat() * target.width * 2.0f) - (double)target.width - var6 * var8, var2, var4, var6); } } StylishRankManager.doAttack((Entity)this.thrower); - this.func_70106_y(); + this.setDead(); } protected void attackEntity(Entity target) { if (this.thrower != null) { - EntitySummonedSwordAdd.setLastHitSummonedSwords(this.thrower, this.func_145782_y()); + EntitySummonedSwordAdd.setLastHitSummonedSwords(this.thrower, this.getEntityId()); } boolean hitPlayer = target instanceof EntityPlayer; if (this.shouldSkipPlayerHit(target)) { return; } if (!hitPlayer) { - this.func_70078_a(target); + this.setInWeb(target); } - if (!this.field_70170_p.field_72995_K) { + if (!this.worldObj.isRemote) { float magicDamage = 0.0f; - target.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - target.func_70097_a(ds, magicDamage); + target.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + target.attackEntityFrom(ds, magicDamage); if (this.blade != null && target instanceof EntityLivingBase && this.thrower != null && this.thrower instanceof EntityLivingBase) { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.PhantomSword); - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)target).field_70737_aN = 1; - ((ItemSlashBlade)this.blade.func_77973_b()).setDaunting((EntityLivingBase)target); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)target).hurtTime = 1; + ((ItemSlashBlade)this.blade.getItem()).setDaunting((EntityLivingBase)target); } } if (hitPlayer) { - this.func_70106_y(); + this.setDead(); } } protected void blastAttackEntity(Entity target) { - if (!this.field_70170_p.field_72995_K) { + if (!this.worldObj.isRemote) { float magicDamage = 0.0f; - target.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - target.func_70097_a(ds, magicDamage); + target.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + target.attackEntityFrom(ds, magicDamage); if (this.blade != null && target instanceof EntityLivingBase && this.thrower != null && this.thrower instanceof EntityLivingBase) { StylishRankManager.setNextAttackType((Entity)this.thrower, (String)StylishRankManager.AttackTypes.PhantomSword); - ((ItemSlashBlade)this.blade.func_77973_b()).func_77644_a(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)target).field_70737_aN = 1; - ((ItemSlashBlade)this.blade.func_77973_b()).setDaunting((EntityLivingBase)target); + ((ItemSlashBlade)this.blade.getItem()).hitEntity(this.blade, (EntityLivingBase)target, (EntityLivingBase)this.thrower); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)target).hurtTime = 1; + ((ItemSlashBlade)this.blade.getItem()).setDaunting((EntityLivingBase)target); } } } protected boolean onImpact(MovingObjectPosition mop) { boolean result = true; - if (mop.field_72308_g != null) { - Entity target = mop.field_72308_g; + if (mop.entityHit != null) { + Entity target = mop.entityHit; if (ItemSlashBlade.AttackableSelector.equals(this.lastHitSelector)) { this.attackEntity(target); } else { this.destructEntity(target); } - } else if (!this.field_70170_p.func_72945_a((Entity)this, this.field_70121_D).isEmpty()) { + } else if (!this.worldObj.getCollidingBoundingBoxes((Entity)this, this.boundingBox).isEmpty()) { result = true; } return result; } public void spawnParticle() { - if (this.func_70090_H()) { + if (this.isInWater()) { for (int l = 0; l < 4; ++l) { float trailLength = 0.25f; - this.field_70170_p.func_72869_a("bubble", this.field_70165_t - this.field_70159_w * (double)trailLength, this.field_70163_u - this.field_70181_x * (double)trailLength, this.field_70161_v - this.field_70179_y * (double)trailLength, this.field_70159_w, this.field_70181_x, this.field_70179_y); + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)trailLength, this.posY - this.motionY * (double)trailLength, this.posZ - this.motionZ * (double)trailLength, this.motionX, this.motionY, this.motionZ); } } } public void calculateSpeed() { float speedReductionFactor = 1.1f; - if (this.func_70090_H()) { + if (this.isInWater()) { speedReductionFactor = 1.0f; } - this.field_70159_w *= (double)speedReductionFactor; - this.field_70181_x *= (double)speedReductionFactor; - this.field_70179_y *= (double)speedReductionFactor; + this.motionX *= (double)speedReductionFactor; + this.motionY *= (double)speedReductionFactor; + this.motionZ *= (double)speedReductionFactor; } - public void func_70071_h_() { - this.field_70142_S = this.field_70165_t; - this.field_70137_T = this.field_70163_u; - this.field_70136_U = this.field_70161_v; - super.func_70071_h_(); + public void onUpdate() { + super.onUpdate(); if (this.ridingEntity2 != null) { - this.func_70098_U(); + this.onEntityUpdate(); } else { - if (this.field_70173_aa >= this.getLifeTime()) { - this.func_70106_y(); + if (this.ticksExisted >= this.getLifeTime()) { + this.setDead(); } this.initRotation(); MovingObjectPosition movingobjectposition = this.getMovingObjectPosition(); @@ -616,69 +610,69 @@ IThrowableEntity { } this.calculateSpeed(); this.doRotation(); - if (this.getInterval() < this.field_70173_aa) { - this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y); + if (this.getInterval() < this.ticksExisted) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); } this.normalizeRotation(); this.spawnParticle(); } } - public void func_70106_y() { + public void setDead() { if (this.thrower != null && this.thrower instanceof EntityPlayer) { - ((EntityPlayer)this.thrower).func_71009_b((Entity)this); + ((EntityPlayer)this.thrower).onCriticalHit((Entity)this); } - this.field_70170_p.func_72908_a(this.field_70169_q, this.field_70167_r, this.field_70166_s, "dig.glass", 0.25f, 1.6f); - AxisAlignedBB bb = this.field_70121_D.func_72314_b(1.0, 1.0, 1.0); - List list = this.field_70170_p.func_94576_a((Entity)this, bb, ItemSlashBlade.AttackableSelector); + this.worldObj.playSoundEffect(this.prevPosX, this.prevPosY, this.prevPosZ, "dig.glass", 0.25f, 1.6f); + AxisAlignedBB bb = this.boundingBox.expand(1.0, 1.0, 1.0); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, bb, ItemSlashBlade.AttackableSelector); list.removeAll(this.alreadyHitEntity); for (Entity target : (java.util.List)(java.util.List)list) { if (target == null) continue; this.blastAttackEntity(target); } - super.func_70106_y(); + super.setDead(); } public Random getRand() { - return this.field_70146_Z; + return this.rand; } private static void setLastHitSummonedSwords(Entity entity, int entityId) { try { Object data = Entity.class.getMethod("getEntityData", new Class[0]).invoke(entity, new Object[0]); if (data instanceof NBTTagCompound) { - ((NBTTagCompound)data).func_74768_a("LastHitSummonedSwords", entityId); + ((NBTTagCompound)data).setInteger("LastHitSummonedSwords", entityId); } } catch (Exception ignored) { } } - public boolean func_70038_c(double par1, double par3, double par5) { + public boolean canBePushed(double par1, double par3, double par5) { return false; } - public void func_70091_d(double par1, double par3, double par5) { - super.func_70091_d(par1, par3, par5); + public void moveEntity(double par1, double par3, double par5) { + super.moveEntity(par1, par3, par5); } - protected void func_70081_e(int par1) { + protected void fall(int par1) { } - public boolean func_70072_I() { + public boolean isInWater() { return false; } - public boolean func_70055_a(Material par1Material) { + public boolean isInsideOfMaterial(Material par1Material) { return false; } - public boolean func_70058_J() { + public boolean handleWaterMovement() { return false; } @SideOnly(value=Side.CLIENT) - public int func_70070_b(float par1) { + public int getBrightnessForRender(float par1) { float f1 = 0.5f; if (f1 < 0.0f) { f1 = 0.0f; @@ -686,7 +680,7 @@ IThrowableEntity { if (f1 > 1.0f) { f1 = 1.0f; } - int i = super.func_70070_b(par1); + int i = super.getBrightnessForRender(par1); int j = i & 0xFF; int k = i >> 16 & 0xFF; if ((j += (int)(f1 * 15.0f * 16.0f)) > 240) { @@ -695,21 +689,21 @@ IThrowableEntity { return j | k << 16; } - public float func_70013_c(float par1) { - float f1 = super.func_70013_c(par1); + public float getBrightness(float par1) { + float f1 = super.getBrightness(par1); float f2 = 0.9f; f2 = f2 * f2 * f2 * f2; return f1 * (1.0f - f2) + f2; } - protected void func_70037_a(NBTTagCompound nbttagcompound) { + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) { } - protected void func_70014_b(NBTTagCompound nbttagcompound) { + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) { } @SideOnly(value=Side.CLIENT) - public float func_70053_R() { + public float getShadowSize() { return 0.0f; } @@ -717,26 +711,26 @@ IThrowableEntity { return this.ridingEntity2; } - public void func_70078_a(Entity par1Entity) { + public void setInWeb(Entity par1Entity) { if (par1Entity != null) { - this.hitYaw = this.field_70177_z - par1Entity.field_70177_z; - this.hitPitch = this.field_70125_A - par1Entity.field_70125_A; - this.hitX = this.field_70165_t - par1Entity.field_70165_t; - this.hitY = this.field_70163_u - par1Entity.field_70163_u; - this.hitZ = this.field_70161_v - par1Entity.field_70161_v; + this.hitYaw = this.rotationYaw - par1Entity.rotationYaw; + this.hitPitch = this.rotationPitch - par1Entity.rotationPitch; + this.hitX = this.posX - par1Entity.posX; + this.hitY = this.posY - par1Entity.posY; + this.hitZ = this.posZ - par1Entity.posZ; this.ridingEntity2 = par1Entity; - this.field_70173_aa = 0; + this.ticksExisted = 0; } } @SideOnly(value=Side.CLIENT) - public void func_70056_a(double par1, double par3, double par5, float par7, float par8, int par9) { + public void setVelocity(double par1, double par3, double par5, float par7, float par8, int par9) { } - public void func_70063_aa() { + public void onKillEntity() { } - public boolean func_70027_ad() { + public boolean isInRangeToRenderDist() { return false; } @@ -744,23 +738,23 @@ IThrowableEntity { return pass == 1; } - public void func_70110_aj() { + public void playLivingSound() { } - public void func_70186_c(double v, double v2, double v3, float v4, float v5) { + public void setThrowableHeading(double v, double v2, double v3, float v4, float v5) { } public Entity getThrower() { int id; if (this.thrower == null && (id = this.getThrowerEntityId()) != 0) { - this.thrower = this.field_70170_p.func_73045_a(id); + this.thrower = this.worldObj.getEntityByID(id); } return this.thrower; } public void setThrower(Entity entity) { if (entity != null) { - this.setThrowerEntityId(entity.func_145782_y()); + this.setThrowerEntityId(entity.getEntityId()); } this.thrower = entity; } diff --git a/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordPotionEffectAdd.java b/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordPotionEffectAdd.java index 47bb0b6..568335c 100644 --- a/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordPotionEffectAdd.java +++ b/src/main/java/com/moe/allweapon/Entityadd/EntitySummonedSwordPotionEffectAdd.java @@ -36,44 +36,44 @@ extends EntityPhantomSwordBase { super(par1World, entityLiving, AttackLevel, roll); } - protected void func_70088_a() { - super.func_70088_a(); - this.func_70096_w().func_75682_a(8, (Object)0); + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(8, (Object)0); } public boolean getBurst() { - return this.func_70096_w().func_75683_a(8) != 0; + return this.getDataWatcher().getWatchableObjectInt(8) != 0; } public void setBurst(boolean value) { - this.func_70096_w().func_75692_b(8, (Object)((byte)(value ? 1 : 0))); + this.getDataWatcher().updateObject(8, (Object)((byte)(value ? 1 : 0))); } protected void attackEntity(Entity target) { if (this.getBurst()) { - this.field_70170_p.func_72885_a((Entity)this, this.field_70165_t, this.field_70163_u, this.field_70161_v, 1.0f, false, false); + this.worldObj.newExplosion((Entity)this, this.posX, this.posY, this.posZ, 1.0f, false, false); } - if (!this.field_70170_p.field_72995_K) { + if (!this.worldObj.isRemote) { float magicDamage = 0.0f; - target.field_70172_ad = 0; - DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).func_76348_h().func_82726_p(); - target.func_70097_a(ds, 1.0f); + target.hurtResistantTime = 0; + DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setMagicDamage().setProjectile(); + target.attackEntityFrom(ds, 1.0f); if (this.blade != null && target instanceof EntityLivingBase && this.thrower != null && this.thrower instanceof EntityLivingBase) { - if (!target.func_70089_S()) { + if (!target.isEntityAlive()) { // empty if block } - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; - target.func_70024_g(0.0, 0.1, 0.0); - ((EntityLivingBase)target).field_70737_aN = 0; + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; + target.addVelocity(0.0, 0.1, 0.0); + ((EntityLivingBase)target).hurtTime = 0; if (!this.getBurst()) { - ((EntityLivingBase)target).func_70690_d(new PotionEffect(2, 100, 2)); + ((EntityLivingBase)target).addPotionEffect(new PotionEffect(2, 100, 2)); } - ((ItemSlashBlade)this.blade.func_77973_b()).setDaunting((EntityLivingBase)target); + ((ItemSlashBlade)this.blade.getItem()).setDaunting((EntityLivingBase)target); } } - this.func_70106_y(); + this.setDead(); } } diff --git a/src/main/java/com/moe/allweapon/SA/SAbaoku.java b/src/main/java/com/moe/allweapon/SA/SAbaoku.java index 0510a04..42c949c 100644 --- a/src/main/java/com/moe/allweapon/SA/SAbaoku.java +++ b/src/main/java/com/moe/allweapon/SA/SAbaoku.java @@ -45,9 +45,9 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { Entity tmp; if (AllWeaponLimits.isOnCooldown(tag, world, "allweapon.baokuNextTick", 10L)) { return; @@ -56,14 +56,14 @@ extends SpecialAttackBase { if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-50), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; int rank = StylishRankManager.getStylishRank((Entity)player); Entity target = null; int entityId = ItemSlashBlade.TargetEntityId.get(tag); - if (entityId != 0 && (tmp = world.func_73045_a(entityId)) != null && tmp.func_70032_d((Entity)player) < 30.0f) { + if (entityId != 0 && (tmp = world.getEntityByID(entityId)) != null && tmp.getDistanceToEntity((Entity)player) < 30.0f) { target = tmp; } if (target == null) { @@ -73,35 +73,35 @@ extends SpecialAttackBase { ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.SlashDim); StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.PhantomSword); blade.attackTargetEntity(stack, target, player, Boolean.valueOf(true)); - player.func_71009_b(target); + player.onCriticalHit(target); boolean targetIsPlayer = AllWeaponLimits.isPlayerTarget(target); - double o = targetIsPlayer ? target.field_70163_u : target.field_70163_u + 10.0; - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; + double o = targetIsPlayer ? target.posY : target.posY + 10.0; + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; if (target instanceof EntityLivingBase) { blade.setDaunting((EntityLivingBase)target); - ((EntityLivingBase)target).field_70737_aN = 0; - ((EntityLivingBase)target).field_70172_ad = 0; + ((EntityLivingBase)target).hurtTime = 0; + ((EntityLivingBase)target).hurtResistantTime = 0; } int count = 1 + StylishRankManager.getStylishRank((Entity)player); Random rand = new Random(); int maxSwords = targetIsPlayer ? 4 : 16; for (int i = 0; i < maxSwords; ++i) { - target.func_70107_b(target.field_70165_t, o, target.field_70161_v); - if (world.field_72995_K) continue; + target.setPosition(target.posX, o, target.posZ); + if (world.isRemote) continue; boolean isBurst = i % 2 == 0; float a = rand.nextInt(100); float b = rand.nextInt(20); float c = rand.nextInt(100); EntitySummonedSwordPotionEffectAdd entityDrive = new EntitySummonedSwordPotionEffectAdd(world, (EntityLivingBase)player, magicDamage, 0.0f); if (entityDrive == null) continue; - entityDrive.func_70012_b(target.field_70165_t + (double)(50.0f - a), target.field_70163_u + (double)b, target.field_70161_v + (double)(50.0f - c), target.field_70177_z + b * 36.0f, 0.0f); + entityDrive.setLocationAndAngles(target.posX + (double)(50.0f - a), target.posY + (double)b, target.posZ + (double)(50.0f - c), target.rotationYaw + b * 36.0f, 0.0f); entityDrive.setInterval(50); entityDrive.setLifeTime(targetIsPlayer ? 30 : 80); entityDrive.setColor(0xFFFF00); - entityDrive.setTargetEntityId(target.func_145782_y()); - world.func_72838_d((Entity)entityDrive); + entityDrive.setTargetEntityId(target.getEntityId()); + world.spawnEntityInWorld((Entity)entityDrive); } } ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); @@ -109,18 +109,18 @@ extends SpecialAttackBase { } private Entity getEntityToWatch(EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; Entity target = null; for (int dist = 2; dist < 20; dist += 2) { - AxisAlignedBB bb = player.field_70121_D.func_72329_c(); - Vec3 vec = player.func_70040_Z(); - vec = vec.func_72432_b(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - bb = bb.func_72317_d(vec.field_72450_a * (double)dist, vec.field_72448_b * (double)dist, vec.field_72449_c * (double)dist); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); + AxisAlignedBB bb = player.boundingBox.expand(0.0,0.0,0.0); + Vec3 vec = player.getLookVec(); + vec = vec.normalize(); + bb = bb.expand(2.0, 0.25, 2.0); + bb = bb.offset(vec.xCoord * (double)dist, vec.yCoord * (double)dist, vec.zCoord * (double)dist); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); float distance = 30.0f; for (Entity curEntity : (java.util.List)(java.util.List)list) { - float curDist = curEntity.func_70032_d((Entity)player); + float curDist = curEntity.getDistanceToEntity((Entity)player); if (!(curDist < distance)) continue; target = curEntity; distance = curDist; diff --git a/src/main/java/com/moe/allweapon/SA/SAfengxuan.java b/src/main/java/com/moe/allweapon/SA/SAfengxuan.java index 5d5dea4..011c7a1 100644 --- a/src/main/java/com/moe/allweapon/SA/SAfengxuan.java +++ b/src/main/java/com/moe/allweapon/SA/SAfengxuan.java @@ -36,10 +36,10 @@ import java.util.List; import mods.flammpfeil.slashblade.EntityDrive; import mods.flammpfeil.slashblade.ItemSlashBlade; import mods.flammpfeil.slashblade.ability.StylishRankManager; -import mods.flammpfeil.slashblade.ability.UntouchableTime; -import mods.flammpfeil.slashblade.entity.EntityJudgmentCutManager; -import mods.flammpfeil.slashblade.specialattack.IJustSpecialAttack; -import mods.flammpfeil.slashblade.specialattack.ISuperSpecialAttack; + + + + import mods.flammpfeil.slashblade.specialattack.SpecialAttackBase; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; @@ -56,20 +56,18 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; public class SAfengxuan -extends SpecialAttackBase -implements IJustSpecialAttack, -ISuperSpecialAttack { +extends SpecialAttackBase { public String toString() { return "fengxuan"; } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { Entity tmp; - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); Entity target = null; int entityId = ItemSlashBlade.TargetEntityId.get(tag); - if (entityId != 0 && (tmp = world.func_73045_a(entityId)) != null && tmp.func_70032_d((Entity)player) < 30.0f) { + if (entityId != 0 && (tmp = world.getEntityByID(entityId)) != null && tmp.getDistanceToEntity((Entity)player) < 30.0f) { target = tmp; } if (target == null) { @@ -81,82 +79,82 @@ ISuperSpecialAttack { if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-20), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } - if (!player.field_70170_p.field_72995_K) { - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + if (!player.worldObj.isRemote) { + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = 1.0f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * (0.5f + (float)level / 5.0f); EntitySlashDimensionAdd dim = new EntitySlashDimensionAdd(world, (EntityLivingBase)player, magicDamage); if (dim != null) { Vec3 tmppos; Block block; - Vec3 pos = player.func_70040_Z(); + Vec3 pos = player.getLookVec(); float scale = 5.0f; - pos.field_72450_a *= (double)scale; - pos.field_72448_b *= (double)scale; - pos.field_72449_c *= (double)scale; - pos = pos.func_72441_c(player.field_70165_t, player.field_70163_u, player.field_70161_v); - pos = pos.func_72441_c(0.0, (double)player.func_70047_e(), 0.0); - Vec3 offset = Vec3.func_72443_a((double)player.field_70165_t, (double)player.field_70163_u, (double)player.field_70161_v).func_72441_c(0.0, (double)player.func_70047_e(), 0.0); - Vec3 look = player.func_70040_Z(); - Vec3 offsettedLook = offset.func_72441_c(look.field_72450_a * 5.0, look.field_72448_b * 5.0, look.field_72449_c * 5.0); - MovingObjectPosition movingobjectposition = world.func_72933_a(offset, offsettedLook); - if (movingobjectposition != null && movingobjectposition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK && (block = world.func_147439_a(movingobjectposition.field_72311_b, movingobjectposition.field_72312_c, movingobjectposition.field_72309_d)) != null && block.func_149703_v() && 1.0 < (tmppos = Vec3.func_72443_a((double)movingobjectposition.field_72307_f.field_72450_a, (double)movingobjectposition.field_72307_f.field_72448_b, (double)movingobjectposition.field_72307_f.field_72449_c)).func_72438_d(Vec3.func_72443_a((double)player.field_70165_t, (double)player.field_70163_u, (double)player.field_70161_v))) { + pos.xCoord *= (double)scale; + pos.yCoord *= (double)scale; + pos.zCoord *= (double)scale; + pos = pos.addVector(player.posX, player.posY, player.posZ); + pos = pos.addVector(0.0, (double)player.getEyeHeight(), 0.0); + Vec3 offset = Vec3.createVectorHelper((double)player.posX, (double)player.posY, (double)player.posZ).addVector(0.0, (double)player.getEyeHeight(), 0.0); + Vec3 look = player.getLookVec(); + Vec3 offsettedLook = offset.addVector(look.xCoord * 5.0, look.yCoord * 5.0, look.zCoord * 5.0); + MovingObjectPosition movingobjectposition = world.rayTraceBlocks(offset, offsettedLook); + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && (block = world.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)) != null && block.isOpaqueCube() && 1.0 < (tmppos = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)movingobjectposition.hitVec.zCoord)).squareDistanceTo(Vec3.createVectorHelper((double)player.posX, (double)player.posY, (double)player.posZ))) { pos = tmppos; } - dim.func_70107_b(pos.field_72450_a, pos.field_72448_b, pos.field_72449_c); + dim.setPosition(pos.xCoord, pos.yCoord, pos.zCoord); dim.setLifeTime(50); dim.setColor(0xFFFFFF); dim.setIsSlashDimension(true); - world.func_72838_d((Entity)dim); + world.spawnEntityInWorld((Entity)dim); } - world.func_72956_a((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); } } else { ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.SlashDim); this.spawnParticle(world, target); - player.field_70170_p.func_72908_a(player.field_70165_t, player.field_70163_u, player.field_70161_v, "mob.endermen.portal", 0.5f, 1.0f); + player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 0.5f, 1.0f); int cost = -20; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-20), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } - AxisAlignedBB bb = target.field_70121_D.func_72329_c(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); - if (!ItemSlashBlade.AttackableSelector.func_82704_a(target)) { + AxisAlignedBB bb = target.boundingBox.expand(0.0,0.0,0.0); + bb = bb.expand(2.0, 0.25, 2.0); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); + if (!ItemSlashBlade.AttackableSelector.isEntityApplicable(target)) { list.add(target); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); for (Entity curEntity : (java.util.List)(java.util.List)list) { StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.SlashDim); blade.attackTargetEntity(stack, curEntity, player, Boolean.valueOf(true)); } - if (!target.field_70170_p.field_72995_K) { - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + if (!target.worldObj.isRemote) { + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = 0.5f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 5.0f); EntitySlashDimensionAdd dim = new EntitySlashDimensionAdd(world, (EntityLivingBase)player, magicDamage); if (dim != null) { - dim.func_70107_b(target.field_70165_t, target.field_70163_u + (double)target.field_70131_O / 2.0, target.field_70161_v); + dim.setPosition(target.posX, target.posY + (double)target.height / 2.0, target.posZ); dim.setLifeTime(50); dim.setColor(0xFFFFFF); - world.func_72838_d((Entity)dim); + world.spawnEntityInWorld((Entity)dim); } - world.func_72956_a((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); } } } private Entity getEntityToWatch(EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; Entity target = null; for (int dist = 2; dist < 20; dist += 2) { - AxisAlignedBB bb = player.field_70121_D.func_72329_c(); - Vec3 vec = player.func_70040_Z(); - vec = vec.func_72432_b(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - bb = bb.func_72317_d(vec.field_72450_a * (double)dist, vec.field_72448_b * (double)dist, vec.field_72449_c * (double)dist); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); + AxisAlignedBB bb = player.boundingBox.expand(0.0,0.0,0.0); + Vec3 vec = player.getLookVec(); + vec = vec.normalize(); + bb = bb.expand(2.0, 0.25, 2.0); + bb = bb.offset(vec.xCoord * (double)dist, vec.yCoord * (double)dist, vec.zCoord * (double)dist); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); float distance = 30.0f; for (Entity curEntity : (java.util.List)(java.util.List)list) { - float curDist = curEntity.func_70032_d((Entity)player); + float curDist = curEntity.getDistanceToEntity((Entity)player); if (!(curDist < distance)) continue; target = curEntity; distance = curDist; @@ -167,18 +165,18 @@ ISuperSpecialAttack { } private void spawnParticle(World world, Entity target) { - world.func_72869_a("largeexplode", target.field_70165_t, target.field_70163_u + (double)target.field_70131_O, target.field_70161_v, 3.0, 3.0, 3.0); - world.func_72869_a("largeexplode", target.field_70165_t + 1.0, target.field_70163_u + (double)target.field_70131_O + 1.0, target.field_70161_v, 3.0, 3.0, 3.0); - world.func_72869_a("largeexplode", target.field_70165_t, target.field_70163_u + (double)target.field_70131_O + 0.5, target.field_70161_v + 1.0, 3.0, 3.0, 3.0); + world.spawnParticle("largeexplode", target.posX, target.posY + (double)target.height, target.posZ, 3.0, 3.0, 3.0); + world.spawnParticle("largeexplode", target.posX + 1.0, target.posY + (double)target.height + 1.0, target.posZ, 3.0, 3.0, 3.0); + world.spawnParticle("largeexplode", target.posX, target.posY + (double)target.height + 0.5, target.posZ + 1.0, 3.0, 3.0, 3.0); } public void doJustSpacialAttack(ItemStack stack, EntityPlayer player) { Entity tmp; - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); Entity target = null; int entityId = ItemSlashBlade.TargetEntityId.get(tag); - if (entityId != 0 && (tmp = world.func_73045_a(entityId)) != null && tmp.func_70032_d((Entity)player) < 30.0f) { + if (entityId != 0 && (tmp = world.getEntityByID(entityId)) != null && tmp.getDistanceToEntity((Entity)player) < 30.0f) { target = tmp; } if (target == null) { @@ -190,35 +188,35 @@ ISuperSpecialAttack { if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-20), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } - if (!player.field_70170_p.field_72995_K) { + if (!player.worldObj.isRemote) { Vec3 tmppos; Block block; - Vec3 pos = player.func_70040_Z(); + Vec3 pos = player.getLookVec(); float scale = 5.0f; - pos.field_72450_a *= (double)scale; - pos.field_72448_b *= (double)scale; - pos.field_72449_c *= (double)scale; - pos = pos.func_72441_c(player.field_70165_t, player.field_70163_u, player.field_70161_v); - pos = pos.func_72441_c(0.0, (double)player.func_70047_e(), 0.0); - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); - Vec3 offset = Vec3.func_72443_a((double)player.field_70165_t, (double)player.field_70163_u, (double)player.field_70161_v).func_72441_c(0.0, (double)player.func_70047_e(), 0.0); - Vec3 look = player.func_70040_Z(); - Vec3 offsettedLook = offset.func_72441_c(look.field_72450_a * 5.0, look.field_72448_b * 5.0, look.field_72449_c * 5.0); - MovingObjectPosition movingobjectposition = world.func_72933_a(offset, offsettedLook); - if (movingobjectposition != null && movingobjectposition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK && (block = world.func_147439_a(movingobjectposition.field_72311_b, movingobjectposition.field_72312_c, movingobjectposition.field_72309_d)) != null && block.func_149703_v() && 1.0 < (tmppos = Vec3.func_72443_a((double)movingobjectposition.field_72307_f.field_72450_a, (double)movingobjectposition.field_72307_f.field_72448_b, (double)movingobjectposition.field_72307_f.field_72449_c)).func_72438_d(Vec3.func_72443_a((double)player.field_70165_t, (double)player.field_70163_u, (double)player.field_70161_v))) { + pos.xCoord *= (double)scale; + pos.yCoord *= (double)scale; + pos.zCoord *= (double)scale; + pos = pos.addVector(player.posX, player.posY, player.posZ); + pos = pos.addVector(0.0, (double)player.getEyeHeight(), 0.0); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); + Vec3 offset = Vec3.createVectorHelper((double)player.posX, (double)player.posY, (double)player.posZ).addVector(0.0, (double)player.getEyeHeight(), 0.0); + Vec3 look = player.getLookVec(); + Vec3 offsettedLook = offset.addVector(look.xCoord * 5.0, look.yCoord * 5.0, look.zCoord * 5.0); + MovingObjectPosition movingobjectposition = world.rayTraceBlocks(offset, offsettedLook); + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && (block = world.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ)) != null && block.isOpaqueCube() && 1.0 < (tmppos = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)movingobjectposition.hitVec.zCoord)).squareDistanceTo(Vec3.createVectorHelper((double)player.posX, (double)player.posY, (double)player.posZ))) { pos = tmppos; } - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = 1.0f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * (0.5f + (float)level / 5.0f); EntitySlashDimensionAdd dim = new EntitySlashDimensionAdd(world, (EntityLivingBase)player, magicDamage); if (dim != null) { - dim.func_70107_b(pos.field_72450_a, pos.field_72448_b, pos.field_72449_c); + dim.setPosition(pos.xCoord, pos.yCoord, pos.zCoord); dim.setLifeTime(50); dim.setIsSlashDimension(true); dim.setColor(0xFFFFFF); - world.func_72838_d((Entity)dim); + world.spawnEntityInWorld((Entity)dim); } - world.func_72956_a((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); magicDamage = 1.0f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 5.0f); for (int i = 0; i < 5; ++i) { EntityDrive entityDrive = new EntityDrive(world, (EntityLivingBase)player, Math.min(1.0f, magicDamage / 3.0f), false, 0.0f); @@ -227,10 +225,10 @@ ISuperSpecialAttack { float fYawDtoR = rotationYaw / 180.0f * 3.141593f; float fPitDtoR = rotationPitch / 180.0f * 3.141593f; float fYVecOfst = 0.5f; - float motionX = -MathHelper.func_76126_a((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst * 2.0f; - float motionY = -MathHelper.func_76126_a((float)fPitDtoR) * fYVecOfst; - float motionZ = MathHelper.func_76134_b((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst * 2.0f; - entityDrive.func_70012_b(pos.field_72450_a - (double)motionX, pos.field_72448_b - (double)motionY, pos.field_72449_c - (double)motionZ, rotationYaw, rotationPitch); + float motionX = -MathHelper.sin((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst * 2.0f; + float motionY = -MathHelper.sin((float)fPitDtoR) * fYVecOfst; + float motionZ = MathHelper.cos((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst * 2.0f; + entityDrive.setLocationAndAngles(pos.xCoord - (double)motionX, pos.yCoord - (double)motionY, pos.zCoord - (double)motionZ, rotationYaw, rotationPitch); entityDrive.setDriveVector(fYVecOfst); entityDrive.setLifeTime(8); entityDrive.setIsMultiHit(false); @@ -241,42 +239,44 @@ ISuperSpecialAttack { } entityDrive.setRoll(90.0f + 120.0f * (entityDrive.getRand().nextFloat() - 0.5f)); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } } else { ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.SlashDim); - player.field_70170_p.func_72908_a(player.field_70165_t, player.field_70163_u, player.field_70161_v, "mob.endermen.portal", 0.5f, 1.0f); + player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 0.5f, 1.0f); int cost = -20; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-20), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } - AxisAlignedBB bb = target.field_70121_D.func_72329_c(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); - if (!ItemSlashBlade.AttackableSelector.func_82704_a(target)) { + AxisAlignedBB bb = target.boundingBox.expand(0.0,0.0,0.0); + bb = bb.expand(2.0, 0.25, 2.0); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); + if (!ItemSlashBlade.AttackableSelector.isEntityApplicable(target)) { list.add(target); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); for (Entity curEntity : (java.util.List)(java.util.List)list) { StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.SlashDim); blade.attackTargetEntity(stack, curEntity, player, Boolean.valueOf(true)); - player.func_71047_c(curEntity); + if (curEntity instanceof EntityLivingBase) { + player.setRevengeTarget((EntityLivingBase)curEntity); + } } - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = 1.0f + ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 5.0f); if (level > 0) { for (int i = 0; i < 5; ++i) { EntityDrive entityDrive = new EntityDrive(world, (EntityLivingBase)player, Math.min(1.0f, magicDamage / 3.0f), false, 0.0f); - float rotationYaw = target.field_70177_z + (float)(60 * i) + (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f; + float rotationYaw = target.rotationYaw + (float)(60 * i) + (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f; float rotationPitch = (entityDrive.getRand().nextFloat() - 0.5f) * 60.0f; float fYawDtoR = rotationYaw / 180.0f * 3.141593f; float fPitDtoR = rotationPitch / 180.0f * 3.141593f; float fYVecOfst = 0.5f; - float motionX = -MathHelper.func_76126_a((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst * 2.0f; - float motionY = -MathHelper.func_76126_a((float)fPitDtoR) * fYVecOfst; - float motionZ = MathHelper.func_76134_b((float)fYawDtoR) * MathHelper.func_76134_b((float)fPitDtoR) * fYVecOfst * 2.0f; - entityDrive.func_70012_b(target.field_70165_t - (double)motionX, target.field_70163_u + (double)target.func_70047_e() / 2.0 - (double)motionY, target.field_70161_v - (double)motionZ, rotationYaw, rotationPitch); + float motionX = -MathHelper.sin((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst * 2.0f; + float motionY = -MathHelper.sin((float)fPitDtoR) * fYVecOfst; + float motionZ = MathHelper.cos((float)fYawDtoR) * MathHelper.cos((float)fPitDtoR) * fYVecOfst * 2.0f; + entityDrive.setLocationAndAngles(target.posX - (double)motionX, target.posY + (double)target.getEyeHeight() / 2.0 - (double)motionY, target.posZ - (double)motionZ, rotationYaw, rotationPitch); entityDrive.setDriveVector(fYVecOfst); entityDrive.setLifeTime(8); entityDrive.setIsMultiHit(false); @@ -287,29 +287,25 @@ ISuperSpecialAttack { } entityDrive.setRoll(90.0f + 120.0f * (entityDrive.getRand().nextFloat() - 0.5f)); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } - if (!target.field_70170_p.field_72995_K) { + if (!target.worldObj.isRemote) { EntitySlashDimensionAdd dim = new EntitySlashDimensionAdd(world, (EntityLivingBase)player, magicDamage); if (dim != null) { - dim.func_70107_b(target.field_70165_t, target.field_70163_u + (double)target.field_70131_O / 2.0, target.field_70161_v); + dim.setPosition(target.posX, target.posY + (double)target.height / 2.0, target.posZ); dim.setLifeTime(50); dim.setIsSlashDimension(true); dim.setColor(0xFFFFFF); - world.func_72838_d((Entity)dim); + world.spawnEntityInWorld((Entity)dim); } - world.func_72956_a((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:fengxuan", 1.0f, 1.0f); } } } public void doSuperSpecialAttack(ItemStack stack, EntityPlayer player) { - EntityJudgmentCutManager entityDA = new EntityJudgmentCutManager(player.field_70170_p, (EntityLivingBase)player); - if (entityDA != null) { - player.field_70170_p.func_72838_d((Entity)entityDA); - } - UntouchableTime.setUntouchableTime((Entity)player, (int)30, (boolean)true); + // doSuperSpecialAttack: EntityJudgmentCutManager and UntouchableTime not in stub — skipped } } diff --git a/src/main/java/com/moe/allweapon/SA/SAfuzhan.java b/src/main/java/com/moe/allweapon/SA/SAfuzhan.java index 63dae0a..87988ee 100644 --- a/src/main/java/com/moe/allweapon/SA/SAfuzhan.java +++ b/src/main/java/com/moe/allweapon/SA/SAfuzhan.java @@ -37,23 +37,23 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { int cost = -10; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-10), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; int rank = StylishRankManager.getStylishRank((Entity)player); if (5 <= rank) { magicDamage += ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * (0.5f + (float)level / 5.0f); } EntityDriveAdd entityDrive = new EntityDriveAdd(world, (EntityLivingBase)player, magicDamage, false, 0.0f - ItemSlashBlade.ComboSequence.Battou.swingDirection); - entityDrive.func_70015_d(100); + entityDrive.setFire(100); entityDrive.setColor(0xFF0000); entityDrive.setc(Float.valueOf(40.0f)); entityDrive.setk(Float.valueOf(10.25f)); @@ -62,10 +62,10 @@ extends SpecialAttackBase { entityDrive.setLifeTime(50); entityDrive.setParticle("flame"); if (entityDrive != null) { - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } - world.func_72956_a((Entity)player, "allweapon:yanfuzhan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:yanfuzhan", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); } } diff --git a/src/main/java/com/moe/allweapon/SA/SAhuanyingdie.java b/src/main/java/com/moe/allweapon/SA/SAhuanyingdie.java index 5e77aad..0d44e79 100644 --- a/src/main/java/com/moe/allweapon/SA/SAhuanyingdie.java +++ b/src/main/java/com/moe/allweapon/SA/SAhuanyingdie.java @@ -43,9 +43,9 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { if (AllWeaponLimits.isOnCooldown(tag, world, "allweapon.huanyingdieNextTick", 6L)) { return; } @@ -55,41 +55,41 @@ extends SpecialAttackBase { } double playerDist = 5.0; float attackDist = (float)(playerDist / 3.0); - if (!player.field_70122_E) { + if (!player.onGround) { playerDist *= (double)0.35f; } - double a = -Math.sin(Math.toRadians(player.field_70177_z)) * playerDist; - double b = Math.cos(Math.toRadians(player.field_70177_z)) * playerDist; - player.field_70159_w = a; - player.field_70179_y = b; - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); - player.func_70690_d(new PotionEffect(Potion.field_76420_g.func_76396_c(), 10, 0, true)); + double a = -Math.sin(Math.toRadians(player.rotationYaw)) * playerDist; + double b = Math.cos(Math.toRadians(player.rotationYaw)) * playerDist; + player.motionX = a; + player.motionZ = b; + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.getId(), 10, 0, true)); EntityDirectAttackDummy entityDA = new EntityDirectAttackDummy(world, (EntityLivingBase)player, false); entityDA.setLifeTime(27); if (entityDA != null) { - world.func_72838_d((Entity)entityDA); + world.spawnEntityInWorld((Entity)entityDA); } } - world.func_72956_a((Entity)player, "allweapon:yanfan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:yanfan", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.HiraTuki); - if (!world.field_72995_K) { + if (!world.isRemote) { Random rand = new Random(); for (int i = 0; i < 8; ++i) { float a = rand.nextInt(30); float b = rand.nextInt(30); float e = rand.nextInt(30); - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif / 12.0f; EntitySummonedButterfly entityDrive = new EntitySummonedButterfly(world, (EntityLivingBase)player, magicDamage += ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 12.0f), 0.0f); if (entityDrive == null) continue; - entityDrive.func_70012_b(player.field_70165_t + (double)((15.0f - a) / 10.0f), player.field_70163_u + (double)((15.0f - b) / 10.0f) + (double)player.func_70047_e() / 2.0, player.field_70161_v + (double)((15.0f - e) / 10.0f), player.field_70177_z + (float)(i * 30), 0.0f); + entityDrive.setLocationAndAngles(player.posX + (double)((15.0f - a) / 10.0f), player.posY + (double)((15.0f - b) / 10.0f) + (double)player.getEyeHeight() / 2.0, player.posZ + (double)((15.0f - e) / 10.0f), player.rotationYaw + (float)(i * 30), 0.0f); entityDrive.setDriveVector((float)(1.0E-4 * (double)a * (double)i + 1.0E-4)); entityDrive.setInterval((i + 1) * 3); entityDrive.setLifeTime(30); entityDrive.setColor(65407); - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } } diff --git a/src/main/java/com/moe/allweapon/SA/SAhuanyingdie2.java b/src/main/java/com/moe/allweapon/SA/SAhuanyingdie2.java index 780d6a4..dde1bdf 100644 --- a/src/main/java/com/moe/allweapon/SA/SAhuanyingdie2.java +++ b/src/main/java/com/moe/allweapon/SA/SAhuanyingdie2.java @@ -37,9 +37,9 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { if (AllWeaponLimits.isOnCooldown(tag, world, "allweapon.huanyingdie2NextTick", 8L)) { return; } @@ -48,26 +48,26 @@ extends SpecialAttackBase { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } } - world.func_72956_a((Entity)player, "allweapon:yanfan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:yanfan", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.HiraTuki); - if (!world.field_72995_K) { + if (!world.isRemote) { Random rand = new Random(); for (int i = 0; i < 12; ++i) { float a = rand.nextInt(100); float b = rand.nextInt(30); float e = rand.nextInt(100); - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif / 50.0f; EntitySummonedButterfly entityDrive = new EntitySummonedButterfly(world, (EntityLivingBase)player, magicDamage += ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * ((float)level / 50.0f), 0.0f); if (entityDrive == null) continue; - entityDrive.func_70012_b(player.field_70165_t + (double)((50.0f - a) / 10.0f), player.field_70163_u + (double)((15.0f - b) / 10.0f) + (double)player.func_70047_e() / 2.0, player.field_70161_v + (double)((50.0f - e) / 10.0f), player.field_70177_z + (float)(i * 30), 0.0f); + entityDrive.setLocationAndAngles(player.posX + (double)((50.0f - a) / 10.0f), player.posY + (double)((15.0f - b) / 10.0f) + (double)player.getEyeHeight() / 2.0, player.posZ + (double)((50.0f - e) / 10.0f), player.rotationYaw + (float)(i * 30), 0.0f); entityDrive.setDriveVector((float)(1.0E-4 * (double)a * (double)i + 1.0E-4)); entityDrive.setInterval((i + 1) * 3); entityDrive.setLifeTime(40); entityDrive.setColor(0xFFFFFF); - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } } diff --git a/src/main/java/com/moe/allweapon/SA/SAliedi.java b/src/main/java/com/moe/allweapon/SA/SAliedi.java index bebb9c9..d53e55d 100644 --- a/src/main/java/com/moe/allweapon/SA/SAliedi.java +++ b/src/main/java/com/moe/allweapon/SA/SAliedi.java @@ -44,25 +44,25 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); double playerDist = 7.0; float attackDist = (float)(playerDist / 3.0); - if (!player.field_70122_E) { + if (!player.onGround) { playerDist *= (double)0.35f; } - player.field_70159_w = -Math.sin(Math.toRadians(player.field_70177_z)) * playerDist; - player.field_70179_y = Math.cos(Math.toRadians(player.field_70177_z)) * playerDist; - if (!world.field_72995_K) { + player.motionX = -Math.sin(Math.toRadians(player.rotationYaw)) * playerDist; + player.motionZ = Math.cos(Math.toRadians(player.rotationYaw)) * playerDist; + if (!world.isRemote) { Entity tmp; int cost = -20; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-20), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); Entity target = null; int entityId = ItemSlashBlade.TargetEntityId.get(tag); - if (entityId != 0 && (tmp = world.func_73045_a(entityId)) != null && tmp.func_70032_d((Entity)player) < 30.0f) { + if (entityId != 0 && (tmp = world.getEntityByID(entityId)) != null && tmp.getDistanceToEntity((Entity)player) < 30.0f) { target = tmp; } if (target == null) { @@ -72,41 +72,41 @@ extends SpecialAttackBase { ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.SlashDim); StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.PhantomSword); blade.attackTargetEntity(stack, target, player, Boolean.valueOf(true)); - player.func_71009_b(target); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; + player.onCriticalHit(target); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; if (target instanceof EntityLivingBase) { blade.setDaunting((EntityLivingBase)target); - ((EntityLivingBase)target).field_70737_aN = 0; - ((EntityLivingBase)target).field_70172_ad = 0; + ((EntityLivingBase)target).hurtTime = 0; + ((EntityLivingBase)target).hurtResistantTime = 0; } - player.func_70690_d(new PotionEffect(Potion.field_76420_g.func_76396_c(), 20, 3, true)); - target.func_70107_b(target.field_70165_t, target.field_70163_u + 15.0, target.field_70161_v); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.getId(), 20, 3, true)); + target.setPosition(target.posX, target.posY + 15.0, target.posZ); EntityDirectAttackDummy entityDA = new EntityDirectAttackDummy(world, (EntityLivingBase)player, false); entityDA.setLifeTime(42); if (entityDA != null) { - world.func_72838_d((Entity)entityDA); + world.spawnEntityInWorld((Entity)entityDA); } } - world.func_72956_a((Entity)player, "random.explode", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "random.explode", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.HiraTuki); } } private Entity getEntityToWatch(EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; Entity target = null; for (int dist = 2; dist < 20; dist += 2) { - AxisAlignedBB bb = player.field_70121_D.func_72329_c(); - Vec3 vec = player.func_70040_Z(); - vec = vec.func_72432_b(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - bb = bb.func_72317_d(vec.field_72450_a * (double)dist, vec.field_72448_b * (double)dist, vec.field_72449_c * (double)dist); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); + AxisAlignedBB bb = player.boundingBox.expand(0.0,0.0,0.0); + Vec3 vec = player.getLookVec(); + vec = vec.normalize(); + bb = bb.expand(2.0, 0.25, 2.0); + bb = bb.offset(vec.xCoord * (double)dist, vec.yCoord * (double)dist, vec.zCoord * (double)dist); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); float distance = 30.0f; for (Entity curEntity : (java.util.List)(java.util.List)list) { - float curDist = curEntity.func_70032_d((Entity)player); + float curDist = curEntity.getDistanceToEntity((Entity)player); if (!(curDist < distance)) continue; target = curEntity; distance = curDist; diff --git a/src/main/java/com/moe/allweapon/SA/SAoulaoula.java b/src/main/java/com/moe/allweapon/SA/SAoulaoula.java index c1685d6..76747ec 100644 --- a/src/main/java/com/moe/allweapon/SA/SAoulaoula.java +++ b/src/main/java/com/moe/allweapon/SA/SAoulaoula.java @@ -44,25 +44,25 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - player.field_70170_p.func_72956_a((Entity)player, "mob.blaze.hit", 0.2f, 0.6f); - if (!world.field_72995_K) { + player.worldObj.playSoundAtEntity((Entity)player, "mob.blaze.hit", 0.2f, 0.6f); + if (!world.isRemote) { int cost = -20; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-20), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)10, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); - AxisAlignedBB bb = player.field_70121_D.func_72329_c(); - bb = bb.func_72314_b(5.0, 0.25, 5.0); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); + AxisAlignedBB bb = player.boundingBox.expand(0.0,0.0,0.0); + bb = bb.expand(5.0, 0.25, 5.0); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); for (Entity curEntity : (java.util.List)(java.util.List)list) { StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.CircleSlash); blade.attackTargetEntity(stack, curEntity, player, Boolean.valueOf(true)); - player.func_71009_b(curEntity); + player.onCriticalHit(curEntity); } float baseModif = blade.getBaseAttackModifiers(tag); - int level = Math.max(1, EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack)); + int level = Math.max(1, EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack)); float magicDamage = baseModif / 20.0f; int rank = StylishRankManager.getStylishRank((Entity)player); if (5 <= rank) { @@ -70,7 +70,7 @@ extends SpecialAttackBase { } Random rand = new Random(); for (int o = 0; o < 10; ++o) { - world.func_72956_a((Entity)player, "allweapon:oulaoula", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:oulaoula", 1.0f, 1.0f); for (int o1 = 0; o1 < 4; ++o1) { float a = rand.nextInt(10); float b = rand.nextInt(10); @@ -83,13 +83,13 @@ extends SpecialAttackBase { entityDrive.setc(Float.valueOf(0.125f)); entityDrive.setk(Float.valueOf(0.35f)); entityDrive.setg(Float.valueOf(0.125f)); - entityDrive.func_70012_b(player.field_70165_t + (double)((5.0f - a) / 10.0f), player.field_70163_u + (double)((5.0f - b) / 10.0f) + (double)player.func_70047_e() / 2.0, player.field_70161_v + (double)((5.0f - c) / 10.0f), player.field_70177_z, 0.0f); + entityDrive.setLocationAndAngles(player.posX + (double)((5.0f - a) / 10.0f), player.posY + (double)((5.0f - b) / 10.0f) + (double)player.getEyeHeight() / 2.0, player.posZ + (double)((5.0f - c) / 10.0f), player.rotationYaw, 0.0f); entityDrive.setDriveVector((float)(0.003 * (double)o1 + 0.001)); entityDrive.setLifeTime((int)d * 5); entityDrive.setIsMultiHit(false); entityDrive.setRoll(d * 18.0f); - world.func_72838_d((Entity)entityDrive); - world.func_72956_a((Entity)player, "allweapon:oulaoula", 1.0f, 1.0f); + world.spawnEntityInWorld((Entity)entityDrive); + world.playSoundAtEntity((Entity)player, "allweapon:oulaoula", 1.0f, 1.0f); } } } diff --git a/src/main/java/com/moe/allweapon/SA/SAqicai.java b/src/main/java/com/moe/allweapon/SA/SAqicai.java index 0a845a3..c978c66 100644 --- a/src/main/java/com/moe/allweapon/SA/SAqicai.java +++ b/src/main/java/com/moe/allweapon/SA/SAqicai.java @@ -37,16 +37,16 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { int cost = -10; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-10), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; float[] speeds = new float[]{0.55f, 0.5f, 0.45f, 0.4f, 0.35f, 0.3f, 0.25f}; int[] colors = new int[]{0xFF0000, 0xFF7F00, 0xFFFF00, 65280, 65535, 0x4D4DFF, 10040013}; @@ -64,10 +64,10 @@ extends SpecialAttackBase { entityDrive.setLifeTime(80); entityDrive.setParticle("enchantmenttable"); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } - world.func_72956_a((Entity)player, "allweapon:yanfan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:yanfan", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); } } diff --git a/src/main/java/com/moe/allweapon/SA/SAweizhan.java b/src/main/java/com/moe/allweapon/SA/SAweizhan.java index 8add628..ebd8155 100644 --- a/src/main/java/com/moe/allweapon/SA/SAweizhan.java +++ b/src/main/java/com/moe/allweapon/SA/SAweizhan.java @@ -44,9 +44,9 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { Entity tmp; if (AllWeaponLimits.isOnCooldown(tag, world, "allweapon.weizhanNextTick", 6L)) { return; @@ -55,14 +55,14 @@ extends SpecialAttackBase { if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-10), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; int rank = StylishRankManager.getStylishRank((Entity)player); Entity target = null; int entityId = ItemSlashBlade.TargetEntityId.get(tag); - if (entityId != 0 && (tmp = world.func_73045_a(entityId)) != null && tmp.func_70032_d((Entity)player) < 30.0f) { + if (entityId != 0 && (tmp = world.getEntityByID(entityId)) != null && tmp.getDistanceToEntity((Entity)player) < 30.0f) { target = tmp; } if (target == null) { @@ -72,14 +72,14 @@ extends SpecialAttackBase { ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.SlashDim); StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.PhantomSword); blade.attackTargetEntity(stack, target, player, Boolean.valueOf(true)); - player.func_71009_b(target); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; + player.onCriticalHit(target); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; if (target instanceof EntityLivingBase) { blade.setDaunting((EntityLivingBase)target); - ((EntityLivingBase)target).field_70737_aN = 0; - ((EntityLivingBase)target).field_70172_ad = 0; + ((EntityLivingBase)target).hurtTime = 0; + ((EntityLivingBase)target).hurtResistantTime = 0; } if (5 <= rank) { magicDamage += ItemSlashBlade.AttackAmplifier.get(tag).floatValue() * (0.5f + (float)level / 5.0f); @@ -88,10 +88,10 @@ extends SpecialAttackBase { int driveCount = targetIsPlayer ? 3 : 8; for (int i = 0; i < driveCount; ++i) { EntityDriveAdd entityDrive = new EntityDriveAdd(world, (EntityLivingBase)player, magicDamage, false, 0.0f - ItemSlashBlade.ComboSequence.Battou.swingDirection); - entityDrive.func_70034_d(i); - entityDrive.field_70165_t = target.field_70165_t; - entityDrive.field_70163_u = target.field_70163_u + 1.0; - entityDrive.field_70161_v = target.field_70161_v; + entityDrive.setRotationYawHead(i); + entityDrive.posX = target.posX; + entityDrive.posY = target.posY + 1.0; + entityDrive.posZ = target.posZ; entityDrive.setColor(0xFF0000); entityDrive.setc(Float.valueOf(0.0f)); entityDrive.setk(Float.valueOf(0.0f)); @@ -99,27 +99,27 @@ extends SpecialAttackBase { entityDrive.setLifeTime(targetIsPlayer ? 8 : 10); entityDrive.setParticle("enchantmenttable"); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } - world.func_72956_a((Entity)player, "allweapon:yanfuzhan", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:yanfuzhan", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); } } private Entity getEntityToWatch(EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; Entity target = null; for (int dist = 2; dist < 20; dist += 2) { - AxisAlignedBB bb = player.field_70121_D.func_72329_c(); - Vec3 vec = player.func_70040_Z(); - vec = vec.func_72432_b(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - bb = bb.func_72317_d(vec.field_72450_a * (double)dist, vec.field_72448_b * (double)dist, vec.field_72449_c * (double)dist); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); + AxisAlignedBB bb = player.boundingBox.expand(0.0,0.0,0.0); + Vec3 vec = player.getLookVec(); + vec = vec.normalize(); + bb = bb.expand(2.0, 0.25, 2.0); + bb = bb.offset(vec.xCoord * (double)dist, vec.yCoord * (double)dist, vec.zCoord * (double)dist); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); float distance = 30.0f; for (Entity curEntity : (java.util.List)(java.util.List)list) { - float curDist = curEntity.func_70032_d((Entity)player); + float curDist = curEntity.getDistanceToEntity((Entity)player); if (!(curDist < distance)) continue; target = curEntity; distance = curDist; diff --git a/src/main/java/com/moe/allweapon/SA/SAxingbao.java b/src/main/java/com/moe/allweapon/SA/SAxingbao.java index aba4a35..bf4a4fa 100644 --- a/src/main/java/com/moe/allweapon/SA/SAxingbao.java +++ b/src/main/java/com/moe/allweapon/SA/SAxingbao.java @@ -38,15 +38,15 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-500), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; Random rand = new Random(); int rank = StylishRankManager.getStylishRank((Entity)player); @@ -63,7 +63,7 @@ extends SpecialAttackBase { entityDrive.setInitialSpeed((float)i * 0.1f + 0.1f); entityDrive.setLifeTime(50); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); diff --git a/src/main/java/com/moe/allweapon/SA/SAxuepo.java b/src/main/java/com/moe/allweapon/SA/SAxuepo.java index 9a1e324..cea1b36 100644 --- a/src/main/java/com/moe/allweapon/SA/SAxuepo.java +++ b/src/main/java/com/moe/allweapon/SA/SAxuepo.java @@ -44,17 +44,17 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { Entity tmp; int cost = -50; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-50), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; int rank = StylishRankManager.getStylishRank((Entity)player); if (5 <= rank) { @@ -72,11 +72,11 @@ extends SpecialAttackBase { entityDrive.setLifeTime(150); entityDrive.setParticle("snowshovel"); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } Entity target = null; int entityId = ItemSlashBlade.TargetEntityId.get(tag); - if (entityId != 0 && (tmp = world.func_73045_a(entityId)) != null && tmp.func_70032_d((Entity)player) < 30.0f) { + if (entityId != 0 && (tmp = world.getEntityByID(entityId)) != null && tmp.getDistanceToEntity((Entity)player) < 30.0f) { target = tmp; } if (target == null) { @@ -86,27 +86,27 @@ extends SpecialAttackBase { ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.SlashDim); StylishRankManager.setNextAttackType((Entity)player, (String)StylishRankManager.AttackTypes.PhantomSword); blade.attackTargetEntity(stack, target, player, Boolean.valueOf(true)); - player.func_71009_b(target); - target.field_70159_w = 0.0; - target.field_70181_x = 0.0; - target.field_70179_y = 0.0; + player.onCriticalHit(target); + target.motionX = 0.0; + target.motionY = 0.0; + target.motionZ = 0.0; if (target instanceof EntityLivingBase) { blade.setDaunting((EntityLivingBase)target); - ((EntityLivingBase)target).field_70737_aN = 0; - ((EntityLivingBase)target).field_70172_ad = 0; + ((EntityLivingBase)target).hurtTime = 0; + ((EntityLivingBase)target).hurtResistantTime = 0; } int count = 1 + StylishRankManager.getStylishRank((Entity)player); for (int i = 0; i < 3; ++i) { - if (world.field_72995_K) continue; + if (world.isRemote) continue; boolean isBurst = i % 2 == 0; EntitySummonedSwordPotionEffectAdd entityDrive = new EntitySummonedSwordPotionEffectAdd(world, (EntityLivingBase)player, magicDamage, 0.0f); if (entityDrive == null) continue; - entityDrive.func_70012_b(player.field_70165_t, player.field_70163_u + (double)(i + 1) * 0.5, player.field_70161_v, player.field_70177_z, 0.0f); + entityDrive.setLocationAndAngles(player.posX, player.posY + (double)(i + 1) * 0.5, player.posZ, player.rotationYaw, 0.0f); entityDrive.setInterval(25); entityDrive.setLifeTime(30); entityDrive.setColor(0xFFFFFF); - entityDrive.setTargetEntityId(target.func_145782_y()); - world.func_72838_d((Entity)entityDrive); + entityDrive.setTargetEntityId(target.getEntityId()); + world.spawnEntityInWorld((Entity)entityDrive); } } ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); @@ -114,18 +114,18 @@ extends SpecialAttackBase { } private Entity getEntityToWatch(EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; Entity target = null; for (int dist = 2; dist < 20; dist += 2) { - AxisAlignedBB bb = player.field_70121_D.func_72329_c(); - Vec3 vec = player.func_70040_Z(); - vec = vec.func_72432_b(); - bb = bb.func_72314_b(2.0, 0.25, 2.0); - bb = bb.func_72317_d(vec.field_72450_a * (double)dist, vec.field_72448_b * (double)dist, vec.field_72449_c * (double)dist); - List list = world.func_94576_a((Entity)player, bb, ItemSlashBlade.AttackableSelector); + AxisAlignedBB bb = player.boundingBox.expand(0.0,0.0,0.0); + Vec3 vec = player.getLookVec(); + vec = vec.normalize(); + bb = bb.expand(2.0, 0.25, 2.0); + bb = bb.offset(vec.xCoord * (double)dist, vec.yCoord * (double)dist, vec.zCoord * (double)dist); + List list = world.getEntitiesWithinAABBExcludingEntity((Entity)player, bb, ItemSlashBlade.AttackableSelector); float distance = 30.0f; for (Entity curEntity : (java.util.List)(java.util.List)list) { - float curDist = curEntity.func_70032_d((Entity)player); + float curDist = curEntity.getDistanceToEntity((Entity)player); if (!(curDist < distance)) continue; target = curEntity; distance = curDist; diff --git a/src/main/java/com/moe/allweapon/SA/SAyueyatianchong.java b/src/main/java/com/moe/allweapon/SA/SAyueyatianchong.java index daec7e9..ee57488 100644 --- a/src/main/java/com/moe/allweapon/SA/SAyueyatianchong.java +++ b/src/main/java/com/moe/allweapon/SA/SAyueyatianchong.java @@ -37,16 +37,16 @@ extends SpecialAttackBase { } public void doSpacialAttack(ItemStack stack, EntityPlayer player) { - World world = player.field_70170_p; + World world = player.worldObj; NBTTagCompound tag = ItemSlashBlade.getItemTagCompound((ItemStack)stack); - if (!world.field_72995_K) { + if (!world.isRemote) { int cost = -10; if (!ItemSlashBlade.ProudSoul.tryAdd(tag, Integer.valueOf(-10), false)) { ItemSlashBlade.damageItem((ItemStack)stack, (int)5, (EntityLivingBase)player); } - ItemSlashBlade blade = (ItemSlashBlade)stack.func_77973_b(); + ItemSlashBlade blade = (ItemSlashBlade)stack.getItem(); float baseModif = blade.getBaseAttackModifiers(tag); - int level = EnchantmentHelper.func_77506_a((int)Enchantment.field_77345_t.field_77352_x, (ItemStack)stack); + int level = EnchantmentHelper.getEnchantmentLevel((int)Enchantment.power.effectId, (ItemStack)stack); float magicDamage = baseModif; int rank = StylishRankManager.getStylishRank((Entity)player); float[] speeds = new float[]{0.25f, 0.3f, 0.35f, 0.4f, 0.45f}; @@ -63,10 +63,10 @@ extends SpecialAttackBase { entityDrive.setInitialSpeed(speeds[i] / 5.0f); entityDrive.setLifeTime(100); if (entityDrive == null) continue; - world.func_72838_d((Entity)entityDrive); + world.spawnEntityInWorld((Entity)entityDrive); } } - world.func_72956_a((Entity)player, "allweapon:yueyatianchong", 1.0f, 1.0f); + world.playSoundAtEntity((Entity)player, "allweapon:yueyatianchong", 1.0f, 1.0f); ItemSlashBlade.setComboSequence((NBTTagCompound)tag, (ItemSlashBlade.ComboSequence)ItemSlashBlade.ComboSequence.Battou); } } diff --git a/src/main/java/com/moe/allweapon/render/RenderDriveAdd.java b/src/main/java/com/moe/allweapon/render/RenderDriveAdd.java index 0c1d9cf..b700f9e 100644 --- a/src/main/java/com/moe/allweapon/render/RenderDriveAdd.java +++ b/src/main/java/com/moe/allweapon/render/RenderDriveAdd.java @@ -27,43 +27,43 @@ extends Render { private static double[][] dVec = new double[][]{{0.0, 1.0, -0.5}, {0.0, 0.75, 0.0}, {0.1, 0.6, -0.15}, {0.0, 0.5, -0.25}, {-0.1, 0.6, -0.15}, {0.0, 0.0, 0.25}, {0.25, 0.0, 0.0}, {0.0, 0.0, -0.25}, {-0.25, 0.0, 0.0}, {0.0, -0.75, 0.0}, {0.1, -0.6, -0.15}, {0.0, -0.5, -0.25}, {-0.1, -0.6, -0.15}, {0.0, -1.0, -0.5}}; private static int[][] nVecPos = new int[][]{{0, 1, 2, 3}, {0, 3, 4, 1}, {1, 5, 6, 2}, {3, 2, 6, 7}, {3, 7, 8, 4}, {1, 4, 8, 5}, {6, 5, 9, 10}, {6, 10, 11, 7}, {8, 7, 11, 12}, {8, 12, 9, 5}, {10, 9, 13, 11}, {12, 11, 13, 9}}; - public void func_76986_a(Entity entity, double d0, double d1, double d2, float f, float f1) { + public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { if (entity instanceof EntityDriveAdd) { this.doDriveRender((EntityDriveAdd)entity, d0, d1, d2, f, f1); } } - protected ResourceLocation func_110775_a(Entity var1) { + protected ResourceLocation getEntityTexture(Entity var1) { return null; } private void doDriveRender(EntityDriveAdd entityDrive, double dX, double dY, double dZ, float f, float f1) { - Tessellator tessellator = Tessellator.field_78398_a; + Tessellator tessellator = Tessellator.instance; GL11.glDisable((int)3553); GL11.glDisable((int)2896); GL11.glEnable((int)3042); GL11.glBlendFunc((int)770, (int)1); GL11.glPushMatrix(); GL11.glTranslatef((float)((float)dX), (float)((float)dY), (float)((float)dZ)); - GL11.glRotatef((float)entityDrive.field_70177_z, (float)0.0f, (float)1.0f, (float)0.0f); - GL11.glRotatef((float)(-entityDrive.field_70125_A), (float)1.0f, (float)0.0f, (float)0.0f); + GL11.glRotatef((float)entityDrive.rotationYaw, (float)0.0f, (float)1.0f, (float)0.0f); + GL11.glRotatef((float)(-entityDrive.rotationPitch), (float)1.0f, (float)0.0f, (float)0.0f); GL11.glRotatef((float)entityDrive.getRoll(), (float)0.0f, (float)0.0f, (float)1.0f); float c = entityDrive.getc(); float k = entityDrive.getk(); float g = entityDrive.getg(); GL11.glScalef((float)k, (float)c, (float)g); float lifetime = entityDrive.getLifeTime(); - float ticks = entityDrive.field_70173_aa; - tessellator.func_78382_b(); - tessellator.func_78384_a(entityDrive.getColor(), (int)(255.0f * (float)Math.pow((lifetime - Math.min(lifetime, ticks)) / lifetime, 2.0))); + float ticks = entityDrive.ticksExisted; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(entityDrive.getColor(), (int)(255.0f * (float)Math.pow((lifetime - Math.min(lifetime, ticks)) / lifetime, 2.0))); double dScale = 1.0; for (int idx = 0; idx < nVecPos.length; ++idx) { - tessellator.func_78377_a(dVec[nVecPos[idx][0]][0] * dScale, dVec[nVecPos[idx][0]][1] * dScale, dVec[nVecPos[idx][0]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][1]][0] * dScale, dVec[nVecPos[idx][1]][1] * dScale, dVec[nVecPos[idx][1]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][2]][0] * dScale, dVec[nVecPos[idx][2]][1] * dScale, dVec[nVecPos[idx][2]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][3]][0] * dScale, dVec[nVecPos[idx][3]][1] * dScale, dVec[nVecPos[idx][3]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][0]][0] * dScale, dVec[nVecPos[idx][0]][1] * dScale, dVec[nVecPos[idx][0]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][1]][0] * dScale, dVec[nVecPos[idx][1]][1] * dScale, dVec[nVecPos[idx][1]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][2]][0] * dScale, dVec[nVecPos[idx][2]][1] * dScale, dVec[nVecPos[idx][2]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][3]][0] * dScale, dVec[nVecPos[idx][3]][1] * dScale, dVec[nVecPos[idx][3]][2] * dScale); } - tessellator.func_78381_a(); + tessellator.draw(); GL11.glPopMatrix(); GL11.glDisable((int)3042); GL11.glEnable((int)2896); diff --git a/src/main/java/com/moe/allweapon/render/RenderSlashDimensionAdd.java b/src/main/java/com/moe/allweapon/render/RenderSlashDimensionAdd.java index 5d0aa63..2f1dd59 100644 --- a/src/main/java/com/moe/allweapon/render/RenderSlashDimensionAdd.java +++ b/src/main/java/com/moe/allweapon/render/RenderSlashDimensionAdd.java @@ -37,10 +37,10 @@ extends Render { public static ResourceLocation textureLocation = new ResourceLocation("flammpfeil.slashblade", "model/util/SAhuixuanqiu/texture.png"); private TextureManager engine() { - return this.field_76990_c.field_78724_e; + return this.renderManager.renderEngine; } - public void func_76986_a(Entity entity, double x, double y, double z, float yaw, float partialRenderTick) { + public void doRender(Entity entity, double x, double y, double z, float yaw, float partialRenderTick) { this.renderModel(entity, x, y, z, yaw, partialRenderTick); } @@ -50,7 +50,7 @@ extends Render { if (model == null && (model = AdvancedModelLoader.loadModel((ResourceLocation)modelLocation)) instanceof WavefrontObject) { Util.replaceFace((WavefrontObject)((WavefrontObject)model)); } - this.func_110777_b(entity); + this.bindEntityTexture(entity); GL11.glPushMatrix(); GL11.glPushAttrib((int)1048575); GL11.glShadeModel((int)7425); @@ -64,7 +64,7 @@ extends Render { } boolean inverse = color < 0; double deathTime = lifetime; - double baseAlpha = Math.sin(1.570796326794897 * (Math.min(deathTime, (double)((float)(lifetime - entity.field_70173_aa) - partialRenderTick)) / deathTime)); + double baseAlpha = Math.sin(1.570796326794897 * (Math.min(deathTime, (double)((float)(lifetime - entity.ticksExisted) - partialRenderTick)) / deathTime)); int seed = entity instanceof EntitySlashDimensionAdd ? ((EntitySlashDimensionAdd)entity).getSeed() : 0; int baseColor = color; Color col = new Color(baseColor); @@ -73,15 +73,15 @@ extends Render { baseColor |= (int)(102.0 * baseAlpha) << 24; GL11.glTranslatef((float)((float)x), (float)((float)y), (float)((float)z)); float rotParTicks = 40.0f; - float rot = (float)entity.field_70173_aa % rotParTicks / rotParTicks * 360.0f + partialRenderTick * (360.0f / rotParTicks); + float rot = (float)entity.ticksExisted % rotParTicks / rotParTicks * 360.0f + partialRenderTick * (360.0f / rotParTicks); float scale = 0.01f; GL11.glScalef((float)scale, (float)scale, (float)scale); float lastx = 0.0f; float lasty = 0.0f; - OpenGlHelper.func_77475_a((int)OpenGlHelper.field_77476_b, (float)240.0f, (float)240.0f); + OpenGlHelper.setLightmapTextureCoords((int)OpenGlHelper.lightmapTexUnit, (float)240.0f, (float)240.0f); Color tmpColor = new Color(baseColor, true); GL11.glColor4f((float)((float)tmpColor.getRed() / 255.0f), (float)((float)tmpColor.getGreen() / 255.0f), (float)((float)tmpColor.getBlue() / 255.0f), (float)((float)tmpColor.getAlpha() / 255.0f)); - OpenGlHelper.func_148821_a((int)770, (int)1, (int)1, (int)0); + OpenGlHelper.glBlendFunc((int)770, (int)1, (int)1, (int)0); GlStateManager.glBlendEquation((int)32779); GL11.glPushMatrix(); for (int i = 0; i < 5; ++i) { @@ -93,7 +93,7 @@ extends Render { for (int i = 0; i < loop; ++i) { GL11.glPushMatrix(); float ticks = 15.0f; - float wave = ((float)entity.field_70173_aa + ticks / (float)loop * (float)i + partialRenderTick) % ticks; + float wave = ((float)entity.ticksExisted + ticks / (float)loop * (float)i + partialRenderTick) % ticks; double waveScale = 1.0 + 0.03 * (double)wave; double rad = Math.PI * 2; GL11.glScaled((double)waveScale, (double)waveScale, (double)waveScale); @@ -110,7 +110,7 @@ extends Render { double offsetBase = 7.0; double offset = (double)i * offsetBase; double motionLen = offsetBase * (double)(windCount - 1); - double ticks = (float)entity.field_70173_aa + partialRenderTick + (float)seed; + double ticks = (float)entity.ticksExisted + partialRenderTick + (float)seed; double offsetTicks = ticks + offset; double progress = offsetTicks % motionLen / motionLen; double rad = Math.PI * 2; @@ -125,7 +125,7 @@ extends Render { double rad = Math.PI * 2; Color tmpColor1 = new Color(color & 0xFFFFFF | (int)Math.min(0.0, 255.0 * Math.sin(rad)) << 24, true); GL11.glColor4f((float)((float)tmpColor1.getRed() / 255.0f), (float)((float)tmpColor1.getGreen() / 255.0f), (float)((float)tmpColor1.getBlue() / 255.0f), (float)((float)tmpColor1.getAlpha() / 255.0f)); - OpenGlHelper.func_77475_a((int)OpenGlHelper.field_77476_b, (float)lastx, (float)lasty); + OpenGlHelper.setLightmapTextureCoords((int)OpenGlHelper.lightmapTexUnit, (float)lastx, (float)lasty); GL11.glDisable((int)3042); GL11.glEnable((int)2896); GL11.glShadeModel((int)7424); @@ -133,7 +133,7 @@ extends Render { GL11.glPopMatrix(); } - protected ResourceLocation func_110775_a(Entity p_110775_1_) { + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return textureLocation; } } diff --git a/src/main/java/com/moe/allweapon/render/RenderSummonedButterfly.java b/src/main/java/com/moe/allweapon/render/RenderSummonedButterfly.java index 422d9cf..f8c381c 100644 --- a/src/main/java/com/moe/allweapon/render/RenderSummonedButterfly.java +++ b/src/main/java/com/moe/allweapon/render/RenderSummonedButterfly.java @@ -27,41 +27,41 @@ extends Render { private static double[][] dVec = new double[][]{{1.05, 5.03, 22.63}, {2.36, 3.05, 8.4}, {3.83, 1.2, -5.34}, {5.4, -0.47, -18.09}, {7.13, -1.85, -29.36}, {9.07, -2.85, -38.66}, {12.52, -3.37, -47.44}, {21.05, -1.84, -51.88}, {30.57, 0.87, -50.69}, {39.45, 3.14, -51.22}, {42.36, 4.8, -45.76}, {47.93, 7.38, -39.0}, {55.35, 10.33, -32.93}, {59.25, 12.66, -24.99}, {59.61, 14.03, -17.16}, {58.07, 14.95, -9.08}, {55.23, 15.26, -2.54}, {51.3, 15.08, 2.69}, {46.49, 14.49, 6.9}, {41.03, 13.61, 10.33}, {35.13, 12.52, 13.24}, {29.02, 11.33, 15.89}, {35.81, 13.07, 15.54}, {45.37, 15.58, 15.38}, {55.78, 18.52, 16.53}, {61.65, 20.7, 20.35}, {63.76, 22.38, 27.2}, {66.06, 24.43, 36.03}, {68.45, 26.8, 46.65}, {70.12, 29.0, 57.46}, {70.21, 30.56, 66.88}, {65.14, 30.42, 74.24}, {54.81, 27.67, 74.13}, {46.95, 25.3, 72.35}, {38.75, 22.58, 68.98}, {30.12, 19.35, 63.18}, {21.03, 15.45, 54.08}, {11.39, 10.74, 40.85}, {-37.42, 3.13, -51.46}, {-28.53, 0.86, -50.94}, {-22.07, -1.09, -52.38}, {-15.97, -2.61, -51.86}, {-10.48, -3.39, -47.68}, {-7.03, -2.87, -38.9}, {-40.32, 4.79, -46.01}, {-5.09, -1.86, -29.6}, {-3.36, -0.48, -18.33}, {-45.89, 7.37, -39.24}, {-53.31, 10.32, -33.17}, {-57.22, 12.65, -25.24}, {-57.57, 14.02, -17.41}, {-56.03, 14.94, -9.32}, {-53.19, 15.25, -2.79}, {-49.26, 15.07, 2.45}, {-44.45, 14.48, 6.66}, {-38.99, 13.59, 10.08}, {-33.1, 12.51, 12.99}, {-1.79, 1.19, -5.58}, {-26.98, 11.32, 15.64}, {-0.32, 3.04, 8.16}, {-9.36, 10.73, 40.61}, {-33.77, 13.06, 15.29}, {-43.33, 15.57, 15.14}, {-53.75, 18.51, 16.29}, {-59.61, 20.69, 20.1}, {-61.72, 22.36, 26.95}, {-18.99, 15.44, 53.84}, {-64.02, 24.42, 35.79}, {-28.09, 19.34, 62.93}, {-66.42, 26.79, 46.41}, {-36.71, 22.57, 68.74}, {-44.92, 25.29, 72.11}, {-68.08, 28.99, 57.22}, {-52.77, 27.66, 73.88}, {-68.18, 30.55, 66.63}, {-63.1, 30.41, 74.0}, {0.98, 5.02, 22.39}}; private static int[][] nVecPos = new int[][]{{8, 9, 10}, {7, 8, 10}, {6, 7, 10}, {10, 5, 6}, {11, 4, 5}, {11, 5, 10}, {11, 3, 4}, {12, 3, 11}, {14, 3, 12}, {14, 12, 13}, {16, 3, 14}, {16, 14, 15}, {18, 3, 16}, {18, 16, 17}, {20, 3, 18}, {20, 18, 19}, {21, 2, 3}, {21, 3, 20}, {0, 1, 2}, {0, 2, 21}, {22, 37, 0}, {22, 0, 21}, {23, 37, 22}, {37, 23, 24}, {37, 24, 25}, {36, 37, 25}, {36, 25, 26}, {35, 36, 26}, {35, 26, 27}, {34, 35, 27}, {34, 27, 28}, {29, 33, 34}, {29, 34, 28}, {30, 32, 33}, {30, 33, 29}, {31, 32, 30}, {44, 38, 39}, {39, 40, 44}, {44, 40, 41}, {41, 42, 44}, {44, 42, 43}, {44, 43, 45}, {44, 45, 47}, {45, 46, 47}, {48, 47, 46}, {48, 46, 50}, {48, 50, 49}, {51, 50, 46}, {51, 46, 52}, {52, 46, 54}, {52, 54, 53}, {55, 54, 46}, {55, 46, 56}, {46, 57, 58}, {46, 58, 56}, {57, 59, 76}, {57, 76, 58}, {58, 76, 60}, {58, 60, 61}, {62, 61, 60}, {63, 62, 60}, {64, 63, 60}, {65, 64, 60}, {65, 60, 66}, {67, 65, 66}, {67, 66, 68}, {69, 67, 68}, {69, 68, 70}, {69, 70, 71}, {69, 71, 72}, {72, 71, 73}, {72, 73, 74}, {73, 75, 74}, {10, 9, 8}, {8, 7, 10}, {7, 6, 10}, {10, 6, 5}, {5, 4, 11}, {5, 11, 10}, {4, 3, 11}, {11, 3, 12}, {13, 12, 3}, {13, 3, 14}, {14, 3, 16}, {14, 16, 15}, {16, 3, 18}, {16, 18, 17}, {19, 18, 3}, {19, 3, 20}, {3, 2, 21}, {3, 21, 20}, {2, 1, 0}, {2, 0, 21}, {21, 0, 37}, {21, 37, 22}, {23, 22, 37}, {24, 23, 37}, {25, 24, 37}, {25, 37, 36}, {25, 36, 26}, {27, 26, 36}, {27, 36, 35}, {28, 27, 35}, {28, 35, 34}, {28, 34, 33}, {28, 33, 29}, {33, 32, 30}, {33, 30, 29}, {30, 32, 31}, {39, 38, 44}, {40, 39, 44}, {41, 40, 44}, {42, 41, 44}, {43, 42, 44}, {47, 45, 43}, {47, 43, 44}, {47, 46, 45}, {48, 46, 47}, {50, 46, 48}, {50, 48, 49}, {46, 50, 51}, {46, 51, 52}, {54, 46, 52}, {54, 52, 53}, {56, 46, 54}, {56, 54, 55}, {58, 57, 46}, {58, 46, 56}, {76, 59, 57}, {76, 57, 58}, {60, 76, 58}, {60, 58, 61}, {60, 61, 62}, {63, 60, 62}, {64, 60, 63}, {60, 64, 65}, {60, 65, 66}, {68, 66, 65}, {68, 65, 67}, {70, 68, 67}, {70, 67, 69}, {72, 71, 70}, {72, 70, 69}, {73, 71, 72}, {73, 72, 74}, {75, 73, 74}}; - public void func_76986_a(Entity entity, double d0, double d1, double d2, float f, float f1) { + public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { if (entity instanceof EntitySummonedButterfly) { this.doDriveRender((EntitySummonedButterfly)entity, d0, d1, d2, f, f1); } } - protected ResourceLocation func_110775_a(Entity var1) { + protected ResourceLocation getEntityTexture(Entity var1) { return null; } private void doDriveRender(EntitySummonedButterfly entityPhantomSword, double dX, double dY, double dZ, float f, float f1) { - Tessellator tessellator = Tessellator.field_78398_a; + Tessellator tessellator = Tessellator.instance; GL11.glDisable((int)3553); GL11.glDisable((int)2896); GL11.glEnable((int)3042); GL11.glBlendFunc((int)770, (int)1); GL11.glPushMatrix(); GL11.glTranslatef((float)((float)dX), (float)((float)dY), (float)((float)dZ)); - GL11.glRotatef((float)entityPhantomSword.field_70177_z, (float)0.0f, (float)1.0f, (float)0.0f); - GL11.glRotatef((float)(-entityPhantomSword.field_70125_A), (float)1.0f, (float)0.0f, (float)0.0f); + GL11.glRotatef((float)entityPhantomSword.rotationYaw, (float)0.0f, (float)1.0f, (float)0.0f); + GL11.glRotatef((float)(-entityPhantomSword.rotationPitch), (float)1.0f, (float)0.0f, (float)0.0f); GL11.glRotatef((float)entityPhantomSword.getRoll(), (float)0.0f, (float)0.0f, (float)1.0f); float scale = 0.0045f; GL11.glScalef((float)scale, (float)scale, (float)scale); GL11.glScalef((float)0.5f, (float)0.5f, (float)1.0f); float lifetime = entityPhantomSword.getLifeTime(); - float ticks = entityPhantomSword.field_70173_aa; - tessellator.func_78371_b(4); - tessellator.func_78369_a(0.2f, 0.2f, 1.0f, 1.0f); + float ticks = entityPhantomSword.ticksExisted; + tessellator.startDrawing(4); + tessellator.setColorRGBA_F(0.2f, 0.2f, 1.0f, 1.0f); double dScale = 1.0; for (int idx = 0; idx < nVecPos.length; ++idx) { - tessellator.func_78377_a(dVec[nVecPos[idx][0]][0] * dScale, dVec[nVecPos[idx][0]][1] * dScale, dVec[nVecPos[idx][0]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][1]][0] * dScale, dVec[nVecPos[idx][1]][1] * dScale, dVec[nVecPos[idx][1]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][2]][0] * dScale, dVec[nVecPos[idx][2]][1] * dScale, dVec[nVecPos[idx][2]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][0]][0] * dScale, dVec[nVecPos[idx][0]][1] * dScale, dVec[nVecPos[idx][0]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][1]][0] * dScale, dVec[nVecPos[idx][1]][1] * dScale, dVec[nVecPos[idx][1]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][2]][0] * dScale, dVec[nVecPos[idx][2]][1] * dScale, dVec[nVecPos[idx][2]][2] * dScale); } - tessellator.func_78381_a(); + tessellator.draw(); GL11.glPopMatrix(); GL11.glDisable((int)3042); GL11.glEnable((int)2896); diff --git a/src/main/java/com/moe/allweapon/render/RenderSummonedSwordAdd.java b/src/main/java/com/moe/allweapon/render/RenderSummonedSwordAdd.java index 7f87f11..963d5dc 100644 --- a/src/main/java/com/moe/allweapon/render/RenderSummonedSwordAdd.java +++ b/src/main/java/com/moe/allweapon/render/RenderSummonedSwordAdd.java @@ -27,41 +27,41 @@ extends Render { private static double[][] dVec = new double[][]{{0.0, 0.0, 417.7431}, {0.0, -44.6113, 0.0}, {38.9907, 0.0, 50.0}, {0.0, 44.6113, 0.0}, {-38.9907, 0.0, 50.0}, {38.9907, 0.0, -50.0}, {-38.9907, 0.0, -50.0}, {0.0, 0.0, -214.0305}, {159.1439, 0.0, -49.6611}, {-159.1439, 0.0, -49.6611}}; private static int[][] nVecPos = new int[][]{{0, 2, 1}, {0, 3, 2}, {0, 4, 3}, {0, 1, 4}, {1, 5, 7}, {5, 3, 7}, {3, 6, 7}, {6, 1, 7}, {2, 8, 1}, {5, 8, 3}, {4, 9, 3}, {6, 9, 1}, {1, 8, 5}, {1, 9, 4}, {3, 8, 2}, {3, 9, 6}}; - public void func_76986_a(Entity entity, double d0, double d1, double d2, float f, float f1) { + public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { if (entity instanceof EntitySummonedSwordAdd) { this.doDriveRender((EntitySummonedSwordAdd)entity, d0, d1, d2, f, f1); } } - protected ResourceLocation func_110775_a(Entity var1) { + protected ResourceLocation getEntityTexture(Entity var1) { return null; } private void doDriveRender(EntitySummonedSwordAdd entityPhantomSword, double dX, double dY, double dZ, float f, float f1) { - Tessellator tessellator = Tessellator.field_78398_a; + Tessellator tessellator = Tessellator.instance; GL11.glDisable((int)3553); GL11.glDisable((int)2896); GL11.glEnable((int)3042); GL11.glBlendFunc((int)770, (int)1); GL11.glPushMatrix(); GL11.glTranslatef((float)((float)dX), (float)((float)dY), (float)((float)dZ)); - GL11.glRotatef((float)entityPhantomSword.field_70177_z, (float)0.0f, (float)1.0f, (float)0.0f); - GL11.glRotatef((float)(-entityPhantomSword.field_70125_A), (float)1.0f, (float)0.0f, (float)0.0f); + GL11.glRotatef((float)entityPhantomSword.rotationYaw, (float)0.0f, (float)1.0f, (float)0.0f); + GL11.glRotatef((float)(-entityPhantomSword.rotationPitch), (float)1.0f, (float)0.0f, (float)0.0f); GL11.glRotatef((float)entityPhantomSword.getRoll(), (float)0.0f, (float)0.0f, (float)1.0f); float scale = 0.0045f; GL11.glScalef((float)scale, (float)scale, (float)scale); GL11.glScalef((float)0.5f, (float)0.5f, (float)1.0f); float lifetime = entityPhantomSword.getLifeTime(); - float ticks = entityPhantomSword.field_70173_aa; - tessellator.func_78371_b(4); - tessellator.func_78369_a(0.2f, 0.2f, 1.0f, 1.0f); + float ticks = entityPhantomSword.ticksExisted; + tessellator.startDrawing(4); + tessellator.setColorRGBA_F(0.2f, 0.2f, 1.0f, 1.0f); double dScale = 1.0; for (int idx = 0; idx < nVecPos.length; ++idx) { - tessellator.func_78377_a(dVec[nVecPos[idx][0]][0] * dScale, dVec[nVecPos[idx][0]][1] * dScale, dVec[nVecPos[idx][0]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][1]][0] * dScale, dVec[nVecPos[idx][1]][1] * dScale, dVec[nVecPos[idx][1]][2] * dScale); - tessellator.func_78377_a(dVec[nVecPos[idx][2]][0] * dScale, dVec[nVecPos[idx][2]][1] * dScale, dVec[nVecPos[idx][2]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][0]][0] * dScale, dVec[nVecPos[idx][0]][1] * dScale, dVec[nVecPos[idx][0]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][1]][0] * dScale, dVec[nVecPos[idx][1]][1] * dScale, dVec[nVecPos[idx][1]][2] * dScale); + tessellator.addVertex(dVec[nVecPos[idx][2]][0] * dScale, dVec[nVecPos[idx][2]][1] * dScale, dVec[nVecPos[idx][2]][2] * dScale); } - tessellator.func_78381_a(); + tessellator.draw(); GL11.glPopMatrix(); GL11.glDisable((int)3042); GL11.glEnable((int)2896);