diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index 1bb8207b..e5593b91 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -186,7 +186,6 @@ public class TotalFreedomMod extends JavaPlugin fsh = new FreedomServiceHandler(); config = new MainConfig(); - config.load(); if (FUtil.inDeveloperMode()) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mute.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mute.java index 0ce530d4..e66c0c73 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mute.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_mute.java @@ -130,17 +130,19 @@ public class Command_mute extends FreedomCommand { playerdata.setMuted(true); player.sendTitle(ChatColor.RED + "You've been muted.", ChatColor.YELLOW + "Be sure to follow the rules!", 20, 100, 60); + + if (quiet) + { + msg("Muted " + player.getName() + " quietly"); + return true; // doesn't announce reason + } + + FUtil.adminAction(sender.getName(), "Muting " + player.getName(), true); + if (reason != null) { msg(player, ChatColor.RED + "Reason: " + ChatColor.YELLOW + reason); } - if (quiet) - { - msg("Muted " + player.getName() + " quietly"); - return true; - } - - FUtil.adminAction(sender.getName(), "Muting " + player.getName(), true); if (smite) { @@ -178,4 +180,4 @@ public class Command_mute extends FreedomCommand return Collections.emptyList(); } -} \ No newline at end of file +} diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_spawnmob.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_spawnmob.java index 5306ceda..2ef26e69 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_spawnmob.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_spawnmob.java @@ -1,6 +1,8 @@ package me.totalfreedom.totalfreedommod.command; import java.util.List; + +import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Rank; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.EnumUtils; @@ -55,6 +57,7 @@ public class Command_spawnmob extends FreedomCommand return true; } + int max = ConfigEntry.SPAWNMOB_MAX.getInteger(); int amount = 1; if (args.length > 1) { @@ -69,9 +72,9 @@ public class Command_spawnmob extends FreedomCommand } } - if (amount > 10 || amount < 1) + if (amount > max || amount < 1) { - msg("Invalid amount: " + args[1] + ". Must be 1-10.", ChatColor.RED); + msg("Invalid amount: " + args[1] + ". Must be 1-" + max + ".", ChatColor.RED); return true; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java index 86fb22a3..4d336882 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java @@ -45,6 +45,8 @@ public enum ConfigEntry MOB_LIMITER_DISABLE_GIANT(Boolean.class, "moblimiter.disable.giant"), MOB_LIMITER_DISABLE_SLIME(Boolean.class, "moblimiter.disable.slime"), // + SPAWNMOB_MAX(Integer.class, "spawnmob.max"), + // HTTPD_ENABLED(Boolean.class, "httpd.enabled"), HTTPD_HOST(String.class, "httpd.host"), HTTPD_PORT(Integer.class, "httpd.port"), diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java index ea7a7344..f6988aec 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java @@ -752,7 +752,7 @@ public class FUtil public static String getIp(Player player) { - return Objects.requireNonNull(player.getAddress()).getAddress().getHostAddress().trim(); + return player.getAddress().getAddress().getHostAddress().trim(); } public static String getIp(PlayerLoginEvent event) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index b8dbaaf2..33b4b43e 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -509,6 +509,10 @@ moblimiter: slime: true giant: true +# Spawnmob +spawnmob: + max: 25 + # Flatlands flatlands: generate: true