diff --git a/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java index a0998c60d..db1244267 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java @@ -103,17 +103,17 @@ public abstract class MiniPlugin implements Listener System.out.println(F.main(_moduleName, message)); } - protected void runAsync(Runnable runnable) + public void runAsync(Runnable runnable) { _plugin.getServer().getScheduler().runTaskAsynchronously(_plugin, runnable); } - protected void runSync(Runnable runnable) + public void runSync(Runnable runnable) { _plugin.getServer().getScheduler().runTask(_plugin, runnable); } - protected void runSyncLater(Runnable runnable, long delay) + public void runSyncLater(Runnable runnable, long delay) { _plugin.getServer().getScheduler().runTaskLater(_plugin, runnable, delay); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/MobPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/MobPage.java index 9950c41eb..bf0395491 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/MobPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/gui/page/MobPage.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.build.gui.page; import org.bukkit.ChatColor; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Ageable; @@ -155,7 +156,6 @@ public class MobPage extends ShopPageBase } // Entity look at player (Currently Bugged) - /* if (_entity instanceof LivingEntity) { ShopItem lookAtMe = new ShopItem(Material.GHAST_TEAR, "Look at Me", null, 0, false); @@ -164,16 +164,26 @@ public class MobPage extends ShopPageBase @Override public void onClick(Player player, ClickType clickType) { - Location entityLocation = _entity.getLocation(); - entityLocation.setDirection(player.getLocation().getDirection().multiply(-1)); - _entity.teleport(entityLocation); + final Location newLoc = _entity.getLocation(); + newLoc.setDirection(player.getLocation().getDirection().multiply(-1)); + + ((CraftLivingEntity) _entity).getHandle().setPositionRotation(newLoc.getX(), newLoc.getY(), newLoc.getZ(), newLoc.getYaw(), newLoc.getPitch()); + ((CraftLivingEntity) _entity).getHandle().g(0.05, 0.0, 0.05); + + getPlugin().runSyncLater(new Runnable() + { + @Override + public void run() + { + _entity.teleport(newLoc); + } + }, 1L); UtilPlayer.message(player, F.main("Game", entityName + " is now looking at you")); } }); buttonSlot += 2; } - */ // Delete Entity ShopItem deleteButton = new ShopItem(Material.TNT, "Delete " + entityName, null, 0, false);