3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 08:10:09 +01:00

Correct last commit to make it work.

Dieser Commit ist enthalten in:
Myles 2016-03-02 10:09:04 +00:00
Ursprung 0db43e612e
Commit 6199e1d8ce
2 geänderte Dateien mit 1 neuen und 23 gelöschten Zeilen

Datei anzeigen

@ -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) { public static ItemStack getHandItem(final ConnectionInfo info) {
try { try {
return Bukkit.getScheduler().callSyncMethod(getPlugin(ViaVersionPlugin.class), new Callable<ItemStack>() { return Bukkit.getScheduler().callSyncMethod(getPlugin(ViaVersionPlugin.class), new Callable<ItemStack>() {

Datei anzeigen

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