Fix/Enable Look at me Button

This commit is contained in:
Shaun Bennett 2015-05-11 20:46:37 -05:00
parent d57bab7430
commit 9d959ee7a3
2 changed files with 18 additions and 8 deletions

View File

@ -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);
}

View File

@ -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<ArcadeManager, MobShop>
}
// 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<ArcadeManager, MobShop>
@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);