Fix some minor inv problems

This commit is contained in:
Andrew 2013-11-06 06:11:55 +13:00
parent ef7d1e936f
commit c79c0067bf

View File

@ -61,10 +61,11 @@ public class DisguiseListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onVechileLeave(VehicleExitEvent event) { public void onVechileLeave(VehicleExitEvent event) {
final Disguise disguise = DisguiseAPI.getDisguise(event.getExited()); final Disguise disguise = DisguiseAPI.getDisguise(event.getExited());
if (disguise != null) { if (disguise != null && event.getExited() instanceof Player) {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
public void run() { public void run() {
disguiseAPI.setupFakeDisguise(disguise); disguiseAPI.setupFakeDisguise(disguise);
((Player) disguise.getEntity()).updateInventory();
} }
}); });
} }
@ -75,6 +76,7 @@ public class DisguiseListener implements Listener {
Disguise disguise = DisguiseAPI.getDisguise(event.getEntered()); Disguise disguise = DisguiseAPI.getDisguise(event.getEntered());
if (disguise != null && event.getEntered() instanceof Player) { if (disguise != null && event.getEntered() instanceof Player) {
disguiseAPI.removeVisibleDisguise((Player) event.getEntered()); disguiseAPI.removeVisibleDisguise((Player) event.getEntered());
((Player) event.getEntered()).updateInventory();
} }
} }