Small wakeup fixes

This commit is contained in:
Sn0wStorm
2021-06-14 13:05:00 +02:00
parent 8896742feb
commit da9f84acb4
3 changed files with 5 additions and 7 deletions
+1 -3
View File
@@ -493,15 +493,13 @@ public class BPlayer {
} }
} else if (offlineDrunk - drunkeness >= 30) { } else if (offlineDrunk - drunkeness >= 30) {
if (BConfig.enableWake) { if (BConfig.enableWake && !player.hasPermission("brewery.bypass.teleport")) {
Location randomLoc = Wakeup.getRandom(player.getLocation()); Location randomLoc = Wakeup.getRandom(player.getLocation());
if (randomLoc != null) { if (randomLoc != null) {
if (!player.hasPermission("brewery.bypass.teleport")) {
player.teleport(randomLoc); player.teleport(randomLoc);
P.p.msg(player, P.p.languageReader.get("Player_Wake")); P.p.msg(player, P.p.languageReader.get("Player_Wake"));
} }
} }
}
offlineDrunk = 0; offlineDrunk = 0;
syncToSQL(false); syncToSQL(false);
} }
+1 -1
View File
@@ -341,7 +341,7 @@ public class P extends JavaPlugin {
})); }));
metrics.addCustomChart(new SimplePie("wakeups", () -> { metrics.addCustomChart(new SimplePie("wakeups", () -> {
if (!BConfig.enableHome) { if (!BConfig.enableWake) {
return "disabled"; return "disabled";
} }
int wakeups = Wakeup.wakeups.size(); int wakeups = Wakeup.wakeups.size();
+1 -1
View File
@@ -32,7 +32,7 @@ public class Wakeup {
return null; return null;
} }
List worldWakes = wakeups.stream() List<Wakeup> worldWakes = wakeups.stream()
.filter(w -> w.active) .filter(w -> w.active)
.filter(w -> w.loc.getWorld().equals(playerLoc.getWorld())) .filter(w -> w.loc.getWorld().equals(playerLoc.getWorld()))
.collect(Collectors.toList()); .collect(Collectors.toList());