From 5e4d1d0d6db1f98b95d54f1d7610d17700606c26 Mon Sep 17 00:00:00 2001 From: StevenLawson Date: Sat, 26 Jul 2014 11:47:23 -0400 Subject: [PATCH] Limit duration and amplifier for /potion command. Resolves #243 --- .../StevenLawson/TotalFreedomMod/Commands/Command_potion.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java index 9a7e9e48..e97fc2ac 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java @@ -136,6 +136,7 @@ public class Command_potion extends TFM_Command try { duration = Integer.parseInt(args[2]); + duration = Math.min(duration, 100000); } catch (NumberFormatException ex) { @@ -147,6 +148,7 @@ public class Command_potion extends TFM_Command try { amplifier = Integer.parseInt(args[3]); + amplifier = Math.min(amplifier, 100000); } catch (NumberFormatException ex) {