diff options
Diffstat (limited to 'src/main/java')
3 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java index ee83ec9..ebd6498 100644 --- a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java +++ b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java @@ -277,7 +277,7 @@ public class CommandsOLD { String extramessage = StringArgumentType.getString(context, "extramessage"); String location = StringArgumentType.getString(context, "location"); boolean lessWaste = Boolean.parseBoolean(StringArgumentType.getString(context, "lasswaste")); - sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, BBUtils.getCurrentIsland() , extramessage, lessWaste)); + sendPacket(new SplashNotifyPacket(0,hub, config.getUsername(), location, BBUtils.getCurrentIsland() , extramessage, lessWaste)); return 1; }) ) @@ -285,14 +285,14 @@ public class CommandsOLD { int hub = IntegerArgumentType.getInteger(context, "Hub"); String location = "bea"; boolean lessWaste = Boolean.parseBoolean(StringArgumentType.getString(context, "lasswaste")); - sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, BBUtils.getCurrentIsland(), "", lessWaste)); + sendPacket(new SplashNotifyPacket(0,hub, config.getUsername(), location, BBUtils.getCurrentIsland(), "", lessWaste)); return 1; }) )) .executes((context) -> { int hub = IntegerArgumentType.getInteger(context, "Hub"); String location = StringArgumentType.getString(context, "location"); - sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, BBUtils.getCurrentIsland(), "", true)); + sendPacket(new SplashNotifyPacket(0,hub, config.getUsername(), location, BBUtils.getCurrentIsland(), "", true)); return 1; }) diff --git a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java index 4a8fb50..8df4fc5 100644 --- a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java +++ b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java @@ -49,14 +49,14 @@ public class BBsentialConnection { } public static int getPotTime() { - int remainingTimeInMinutes = 0; + int remainingDuration = 0; StatusEffectInstance potTimeRequest = MinecraftClient.getInstance().player.getStatusEffect(StatusEffects.STRENGTH); if (potTimeRequest != null) { if (potTimeRequest.getAmplifier() >= 7) { - remainingTimeInMinutes = (int) (potTimeRequest.getDuration() / 20.0); + remainingDuration = (int) (potTimeRequest.getDuration() / 20.0); } } - return remainingTimeInMinutes; + return remainingDuration; } public static boolean isCommandSafe(String command) { @@ -345,7 +345,7 @@ public class BBsentialConnection { public void onSplashNotifyPacket(SplashNotifyPacket packet) { int waitTime; if (packet.lessWaste) { - waitTime = (getPotTime() * 1000) / 80; + waitTime = Math.min(((getPotTime() * 1000) / 80),25*1000); } else { waitTime = 0; diff --git a/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java index ab0076e..e0b4fa4 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java @@ -6,9 +6,11 @@ import de.hype.bbsentials.constants.enviromentShared.Islands; public class SplashNotifyPacket extends AbstractPacket { - public SplashNotifyPacket(int hub, String splasherUsername, String location, Islands hubType, String extraMessage, boolean lessWaste) { + public SplashNotifyPacket(int splashId, int hub, String splasherUsername, String location, Islands hubType, String extraMessage, boolean lessWaste) { super(1, 1); //Min and Max supported Version this.hub = hub; + this.splashId = splashId; + this.lessWaste = lessWaste; this.splasherUsername = splasherUsername; this.location = location; @@ -17,6 +19,7 @@ public class SplashNotifyPacket extends AbstractPacket { } public final int hub; + public final int splashId; public final boolean lessWaste; public final String splasherUsername; public final String location; |