From c79c0067bff4fb1e8bfd814ee3c16f7ce3c3a51c Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 06:11:55 +1300 Subject: [PATCH] Fix some minor inv problems --- src/me/libraryaddict/disguise/DisguiseListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/DisguiseListener.java b/src/me/libraryaddict/disguise/DisguiseListener.java index 26b1a7d7..c47b4369 100644 --- a/src/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/me/libraryaddict/disguise/DisguiseListener.java @@ -61,10 +61,11 @@ public class DisguiseListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onVechileLeave(VehicleExitEvent event) { final Disguise disguise = DisguiseAPI.getDisguise(event.getExited()); - if (disguise != null) { + if (disguise != null && event.getExited() instanceof Player) { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { disguiseAPI.setupFakeDisguise(disguise); + ((Player) disguise.getEntity()).updateInventory(); } }); } @@ -75,6 +76,7 @@ public class DisguiseListener implements Listener { Disguise disguise = DisguiseAPI.getDisguise(event.getEntered()); if (disguise != null && event.getEntered() instanceof Player) { disguiseAPI.removeVisibleDisguise((Player) event.getEntered()); + ((Player) event.getEntered()).updateInventory(); } }