Correct last commit to make it work.

This commit is contained in:
Myles 2016-03-02 10:09:04 +00:00
parent 0db43e612e
commit 6199e1d8ce
2 changed files with 1 additions and 23 deletions

View File

@ -84,28 +84,6 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
}
}
public static Entity getEntity(final UUID player, final int id) {
try {
return Bukkit.getScheduler().callSyncMethod(getPlugin(ViaVersionPlugin.class), new Callable<Entity>() {
@Override
public Entity call() throws Exception {
Player p = Bukkit.getPlayer(player);
if (p == null) return null;
for (Entity e : p.getWorld().getEntities()) {
if (e.getEntityId() == id) {
return e;
}
}
return null;
}
}).get(10, TimeUnit.SECONDS);
} catch (Exception e) {
System.out.println("Error fetching entity ");
e.printStackTrace();
return null;
}
}
public static ItemStack getHandItem(final ConnectionInfo info) {
try {
return Bukkit.getScheduler().callSyncMethod(getPlugin(ViaVersionPlugin.class), new Callable<ItemStack>() {

View File

@ -212,7 +212,7 @@ public class IncomingTransformer {
output.writeLong(-1L);
output.writeByte(255);
// write item in hand
ItemStack inHand = Core.getHandItem(info);
ItemStack inHand = ViaVersionPlugin.getHandItem(info);
Object item = null;
try {
Method m = ReflectionUtil.obc("inventory.CraftItemStack").getDeclaredMethod("asNMSCopy", ItemStack.class);