Riding animals buck off the player now on gamemode change

This commit is contained in:
Jascha Starke 2013-07-29 08:47:25 +02:00
parent 5d7dee727b
commit 58a092267a

View file

@ -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<LimitedCreative> {
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())