Merge pull request #179 from AtlasMediaGroup/FS-212

Makes spawnmob configurable, increases the default limit to 25 (FS-212)
This commit is contained in:
Video 2021-12-22 20:56:46 -07:00 committed by GitHub
commit 2eb0ab4cb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,8 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import java.util.List; import java.util.List;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.EnumUtils; import org.apache.commons.lang3.EnumUtils;
@ -55,6 +57,7 @@ public class Command_spawnmob extends FreedomCommand
return true; return true;
} }
int max = ConfigEntry.SPAWNMOB_MAX.getInteger();
int amount = 1; int amount = 1;
if (args.length > 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; return true;
} }

View File

@ -45,6 +45,8 @@ public enum ConfigEntry
MOB_LIMITER_DISABLE_GIANT(Boolean.class, "moblimiter.disable.giant"), MOB_LIMITER_DISABLE_GIANT(Boolean.class, "moblimiter.disable.giant"),
MOB_LIMITER_DISABLE_SLIME(Boolean.class, "moblimiter.disable.slime"), MOB_LIMITER_DISABLE_SLIME(Boolean.class, "moblimiter.disable.slime"),
// //
SPAWNMOB_MAX(Integer.class, "spawnmob.max"),
//
HTTPD_ENABLED(Boolean.class, "httpd.enabled"), HTTPD_ENABLED(Boolean.class, "httpd.enabled"),
HTTPD_HOST(String.class, "httpd.host"), HTTPD_HOST(String.class, "httpd.host"),
HTTPD_PORT(Integer.class, "httpd.port"), HTTPD_PORT(Integer.class, "httpd.port"),

View File

@ -509,6 +509,10 @@ moblimiter:
slime: true slime: true
giant: true giant: true
# Spawnmob
spawnmob:
max: 25
# Flatlands # Flatlands
flatlands: flatlands:
generate: true generate: true