diff --git a/src/main/java/eu/m724/giants/Configuration.java b/src/main/java/eu/m724/giants/Configuration.java index 68b3153..f7bbed6 100644 --- a/src/main/java/eu/m724/giants/Configuration.java +++ b/src/main/java/eu/m724/giants/Configuration.java @@ -10,6 +10,7 @@ import org.bukkit.util.Vector; import java.io.File; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.logging.Logger; @@ -26,6 +27,7 @@ public class Configuration { Vector attackReach; + List worldBlacklist; Set effects = new HashSet<>(); Set drops = new HashSet<>(); @@ -48,6 +50,8 @@ public class Configuration { double _expandUp = config.getDouble("expandUp"); attackReach = new Vector(_attackReach, _expandUp, _attackReach); + worldBlacklist = config.getStringList("blacklist"); + for (String line : config.getStringList("effects")) { String[] parts = line.split(":"); diff --git a/src/main/java/eu/m724/giants/GiantProcessor.java b/src/main/java/eu/m724/giants/GiantProcessor.java index 118eb10..d5b3643 100644 --- a/src/main/java/eu/m724/giants/GiantProcessor.java +++ b/src/main/java/eu/m724/giants/GiantProcessor.java @@ -132,6 +132,9 @@ public class GiantProcessor implements Listener { @EventHandler public void entitySpawn(EntitySpawnEvent e) { + if (configuration.worldBlacklist.contains(e.getLocation().getWorld().getName())) + return; + if (e.getEntityType() == EntityType.ZOMBIE) { if (configuration.chance > random.nextFloat()) { e.setCancelled(true); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7ddb714..099a4ed 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,5 +1,5 @@ -# Do as it says -remove_this_line_after_editing: true +# Notes: +# To have no values in a list, remove every value below it and change to [] like `effects: []` # If disabled, the giant won't move (but it will still attack) ai: true @@ -18,30 +18,34 @@ attackDelay: 20 # There's no wall check yet, so it will hit through walls attackReach: 2 +# The value above does not modify vertical reach, this value extends it upwards +expandUp: 0 + ### # Chance of a zombie becoming a giant. This is per each zombie spawn, natural or not. -chance: 0.02 +# 0 is 0% (no zombie becomes a giant), 1 is 100% (every zombie becomes a giant), so the default 0.005 is 0.5% +chance: 0.005 + +# Which worlds not to spawn Giants in +blacklist: + - "world_nether" + - "world_the_end" # Potion effects applied to a giant # type:amplifier # types: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # amplifier: just like you know it, max 255 -# Set to [] to disable effects: -- "JUMP:1" -- "REGENERATION:2" -- "HEALTH_BOOST:10" + - "JUMP:1" + - "REGENERATION:2" + - "HEALTH_BOOST:10" # Custom drops # material:min quantity:max quantity:chance # material: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html # min and max are inclusive -# chance is 0 - 100 +# unlike above, chance is an integer from 0 to 100 # metadata can't be set yet -# Set to [] to disable drops: -- "APPLE:1:3:25" # 25% of the time, drop 1 to 3 apples - -### Advanced -expandUp: 0 \ No newline at end of file + - "APPLE:1:3:25" # 25% of the time, drop 1 to 3 apples