diff --git a/src/com/dre/brewery/BPlayer.java b/src/com/dre/brewery/BPlayer.java index b09b37c..d5a01af 100644 --- a/src/com/dre/brewery/BPlayer.java +++ b/src/com/dre/brewery/BPlayer.java @@ -115,7 +115,7 @@ public class BPlayer { // Player has drunken too much public void drinkCap(Player player) { - if (overdrinkKick) { + if (overdrinkKick && !player.hasPermission("brewery.bypass.overdrink")) { passOut(player); } else { quality = getQuality() * 100; @@ -263,7 +263,7 @@ public class BPlayer { public void login(final Player player) { if (drunkeness < 10) { if (offlineDrunk > 60) { - if (enableHome) { + if (enableHome && !player.hasPermission("brewery.bypass.teleport")) { goHome(player); } } @@ -274,8 +274,10 @@ public class BPlayer { } else if (offlineDrunk - drunkeness >= 30) { Location randomLoc = Wakeup.getRandom(player.getLocation()); if (randomLoc != null) { - player.teleport(randomLoc); - P.p.msg(player, P.p.languageReader.get("Player_Wake")); + if (!player.hasPermission("brewery.bypass.teleport")) { + player.teleport(randomLoc); + P.p.msg(player, P.p.languageReader.get("Player_Wake")); + } } } diff --git a/src/com/dre/brewery/listeners/CommandListener.java b/src/com/dre/brewery/listeners/CommandListener.java index 2150653..bd0dac4 100644 --- a/src/com/dre/brewery/listeners/CommandListener.java +++ b/src/com/dre/brewery/listeners/CommandListener.java @@ -270,10 +270,17 @@ public class CommandListener implements CommandExecutor { bPlayer.setData(drunkeness, quality); } - p.msg(sender, p.languageReader.get("CMD_Player", playerName, "" + drunkeness, "" + bPlayer.getQuality())); if (drunkeness > 100) { - bPlayer.drinkCap(p.getServer().getPlayer(playerName)); + Player player = p.getServer().getPlayer(playerName); + if (player != null) { + bPlayer.drinkCap(player); + } else { + if (!BPlayer.overdrinkKick) { + bPlayer.setData(100, 0); + } + } } + p.msg(sender, p.languageReader.get("CMD_Player", playerName, "" + drunkeness, "" + bPlayer.getQuality())); } diff --git a/src/com/dre/brewery/listeners/PlayerListener.java b/src/com/dre/brewery/listeners/PlayerListener.java index 498cfe3..81f104e 100644 --- a/src/com/dre/brewery/listeners/PlayerListener.java +++ b/src/com/dre/brewery/listeners/PlayerListener.java @@ -181,6 +181,13 @@ public class PlayerListener implements Listener { final Player player = event.getPlayer(); BPlayer bplayer = BPlayer.get(player.getName()); if (bplayer != null) { + if (player.hasPermission("brewery.bypass.logindeny")) { + if (bplayer.getDrunkeness() > 100) { + bplayer.setData(100, 0); + } + bplayer.join(player); + return; + } switch (bplayer.canJoin()) { case 0: bplayer.join(player);