From 13f8d073a992fc9b8e972419bdc717fa0a322c93 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 30 Nov 2024 11:35:21 +0100 Subject: [PATCH] yes --- pom.xml | 20 +++++++++++++++++++ .../eu/m724/tweaks/sleep/SleepListener.java | 2 +- .../tweaks/sleep/TimeForwardRunnable.java | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cae9ab5..fb063a6 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,15 @@ + + + org.apache.maven.plugins + maven-release-plugin + 3.1.1 + + true + + @@ -110,6 +119,10 @@ maxhenkel-repo https://maven.maxhenkel.de/repository/public + + m724-repo + https://git.m724.eu/api/packages/Minecon724/maven + @@ -145,4 +158,11 @@ compile + + + + + scm:git:git@git.m724.eu:Minecon724/tweaks724.git + HEAD + \ No newline at end of file diff --git a/src/main/java/eu/m724/tweaks/sleep/SleepListener.java b/src/main/java/eu/m724/tweaks/sleep/SleepListener.java index 80f1f67..3a7a27d 100644 --- a/src/main/java/eu/m724/tweaks/sleep/SleepListener.java +++ b/src/main/java/eu/m724/tweaks/sleep/SleepListener.java @@ -38,7 +38,7 @@ public class SleepListener implements Listener { lastDay = day; if (!skippedCurrentNight.contains(event.getPlayer())) { - double onePlayerRatio = 1.0 / (event.getPlayer().getServer().getOnlinePlayers().size() * world.getGameRuleValue(GameRule.PLAYERS_SLEEPING_PERCENTAGE)); + double onePlayerRatio = 1 / (event.getPlayer().getServer().getOnlinePlayers().size() * (world.getGameRuleValue(GameRule.PLAYERS_SLEEPING_PERCENTAGE) / 100.0)); world.setTime((long) ((23459 - world.getTime()) * onePlayerRatio)); skippedCurrentNight.add(event.getPlayer()); } diff --git a/src/main/java/eu/m724/tweaks/sleep/TimeForwardRunnable.java b/src/main/java/eu/m724/tweaks/sleep/TimeForwardRunnable.java index 4b263b9..eae8bdc 100644 --- a/src/main/java/eu/m724/tweaks/sleep/TimeForwardRunnable.java +++ b/src/main/java/eu/m724/tweaks/sleep/TimeForwardRunnable.java @@ -21,7 +21,7 @@ public class TimeForwardRunnable extends BukkitRunnable { public TimeForwardRunnable(Plugin plugin) { this.server = plugin.getServer(); this.world = server.getWorld("world"); - this.percentage = world.getGameRuleValue(GameRule.PLAYERS_SLEEPING_PERCENTAGE); + this.percentage = (world.getGameRuleValue(GameRule.PLAYERS_SLEEPING_PERCENTAGE) / 100.0); } @Override