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

Fix getHandItem across reloads, though half the things will still break on reload :(

Dieser Commit ist enthalten in:
Myles 2016-03-05 21:23:14 +00:00
Ursprung 369710333c
Commit ef6214a442

Datei anzeigen

@ -47,6 +47,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
ViaVersion.setInstance(this); ViaVersion.setInstance(this);
if (System.getProperty("ViaVersion") != null) { if (System.getProperty("ViaVersion") != null) {
getLogger().severe("ViaVersion is already loaded, we don't support reloads. Please reboot if you wish to update."); getLogger().severe("ViaVersion is already loaded, we don't support reloads. Please reboot if you wish to update.");
getLogger().severe("Some features may not work.");
return; return;
} }
@ -166,7 +167,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
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(Bukkit.getPluginManager().getPlugin("ViaVersion"), new Callable<ItemStack>() {
@Override @Override
public ItemStack call() throws Exception { public ItemStack call() throws Exception {
if (info.getPlayer() != null) { if (info.getPlayer() != null) {