From 58a092267a52f5de96d5c18dfd7a26222119a765 Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Mon, 29 Jul 2013 08:47:25 +0200 Subject: [PATCH] Riding animals buck off the player now on gamemode change --- .../minecraft/limitedcreative/ModInventories.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModInventories.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModInventories.java index ab7514b..0b77ab0 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModInventories.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModInventories.java @@ -5,6 +5,7 @@ import java.util.Map; import java.util.WeakHashMap; import org.bukkit.GameMode; +import org.bukkit.entity.Animals; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -85,6 +86,9 @@ public class ModInventories extends CoreModule { if (plugin.getPermManager().hasPermission(player, InventoryPermissions.KEEP_INVENTORY)) return; player.closeInventory(); + if (player.getVehicle() != null && player.getVehicle() instanceof Animals) { + player.leaveVehicle(); + } GameMode cgm = player.getGameMode(); if (gm == GameMode.ADVENTURE && !config.getSeparateAdventure())