mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-22 17:17:38 +01:00
getEyeLocation() workaround
This commit is contained in:
parent
001b643b16
commit
2c10b2a2bc
@ -64,10 +64,14 @@ public class NpcEffectThread implements Runnable {
|
||||
|
||||
private static void showEffect_R4(Player player, NPC npc) {
|
||||
|
||||
//Get and set eye location, because npc.getBukkitEntity() is deprecated.
|
||||
Location eyeLoc = npc.getEntity().getLocation();
|
||||
eyeLoc.setY(eyeLoc.getY() + 1.5);
|
||||
|
||||
if (Quests.effect.equalsIgnoreCase("enchant")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.ENCHANTMENT_TABLE.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 1, 0, 1, 10);
|
||||
Eff_1_7_R4.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -75,7 +79,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("crit")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.CRIT.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, (float) 0.35, 3);
|
||||
Eff_1_7_R4.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -83,7 +87,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("spell")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.INSTANT_SPELL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R4.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -91,7 +95,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("magiccrit")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.MAGIC_CRIT.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, (float) 0.35, 3);
|
||||
Eff_1_7_R4.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -99,7 +103,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("mobspell")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.MOB_SPELL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R4.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -107,7 +111,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("note")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R4.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
|
||||
} catch (Exception e) {
|
||||
@ -117,7 +121,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("portal")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.PORTAL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 5);
|
||||
Eff_1_7_R4.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -125,8 +129,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("dust")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Location newLoc = new Location(player.getWorld(), eyeLoc.getX(), eyeLoc.getY() + (float) 0.5, eyeLoc.getZ());
|
||||
Eff_1_7_R4.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -135,7 +138,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("witch")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.WITCH_MAGIC.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R4.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -143,7 +146,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("snowball")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R4.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
@ -153,7 +156,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("splash")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R4.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4);
|
||||
} catch (Exception e) {
|
||||
@ -163,7 +166,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("smoke")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R4.TOWN_AURA.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 1, 0, 1, 20);
|
||||
Eff_1_7_R4.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -174,10 +177,14 @@ public class NpcEffectThread implements Runnable {
|
||||
|
||||
private static void showEffect_R3(Player player, NPC npc) {
|
||||
|
||||
//Get and set eye location, because npc.getBukkitEntity() is deprecated.
|
||||
Location eyeLoc = npc.getEntity().getLocation();
|
||||
eyeLoc.setY(eyeLoc.getY() + 1.5);
|
||||
|
||||
if (Quests.effect.equalsIgnoreCase("enchant")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.ENCHANTMENT_TABLE.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 1, 0, 1, 10);
|
||||
Eff_1_7_R3.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -185,7 +192,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("crit")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.CRIT.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, (float) 0.35, 3);
|
||||
Eff_1_7_R3.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -193,7 +200,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("spell")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.INSTANT_SPELL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R3.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -201,7 +208,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("magiccrit")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.MAGIC_CRIT.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, (float) 0.35, 3);
|
||||
Eff_1_7_R3.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -209,7 +216,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("mobspell")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.MOB_SPELL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R3.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -217,7 +224,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("note")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R3.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
|
||||
} catch (Exception e) {
|
||||
@ -227,7 +234,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("portal")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.PORTAL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 5);
|
||||
Eff_1_7_R3.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -235,7 +242,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("dust")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R3.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
|
||||
} catch (Exception e) {
|
||||
@ -245,7 +252,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("witch")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.WITCH_MAGIC.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R3.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -253,7 +260,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("snowball")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R3.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
@ -263,7 +270,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("splash")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R3.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4);
|
||||
} catch (Exception e) {
|
||||
@ -273,7 +280,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("smoke")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R3.TOWN_AURA.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 1, 0, 1, 20);
|
||||
Eff_1_7_R3.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -284,10 +291,14 @@ public class NpcEffectThread implements Runnable {
|
||||
|
||||
private static void showEffect_R1(Player player, NPC npc) {
|
||||
|
||||
//Get and set eye location, because npc.getBukkitEntity() is deprecated.
|
||||
Location eyeLoc = npc.getEntity().getLocation();
|
||||
eyeLoc.setY(eyeLoc.getY() + 1.5);
|
||||
|
||||
if (Quests.effect.equalsIgnoreCase("enchant")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.ENCHANTMENT_TABLE.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 1, 0, 1, 10);
|
||||
Eff_1_7_R1.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -295,7 +306,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("crit")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.CRIT.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, (float) 0.35, 3);
|
||||
Eff_1_7_R1.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -303,7 +314,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("spell")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.INSTANT_SPELL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R1.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -311,7 +322,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("magiccrit")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.MAGIC_CRIT.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, (float) 0.35, 3);
|
||||
Eff_1_7_R1.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -319,7 +330,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("mobspell")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.MOB_SPELL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R1.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -327,7 +338,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("note")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R1.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
|
||||
} catch (Exception e) {
|
||||
@ -337,7 +348,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("portal")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.PORTAL.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 5);
|
||||
Eff_1_7_R1.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -345,7 +356,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("dust")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R1.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1);
|
||||
} catch (Exception e) {
|
||||
@ -355,7 +366,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("witch")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.WITCH_MAGIC.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 0, 0, 1, 3);
|
||||
Eff_1_7_R1.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -363,7 +374,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("snowball")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R1.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3);
|
||||
} catch (Exception e) {
|
||||
@ -373,7 +384,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("splash")) {
|
||||
|
||||
try {
|
||||
Location old = npc.getBukkitEntity().getEyeLocation();
|
||||
Location old = eyeLoc;
|
||||
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
|
||||
Eff_1_7_R1.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4);
|
||||
} catch (Exception e) {
|
||||
@ -383,7 +394,7 @@ public class NpcEffectThread implements Runnable {
|
||||
} else if (Quests.effect.equalsIgnoreCase("smoke")) {
|
||||
|
||||
try {
|
||||
Eff_1_7_R1.TOWN_AURA.sendToPlayer(player, npc.getBukkitEntity().getEyeLocation(), 0, 1, 0, 1, 20);
|
||||
Eff_1_7_R1.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user