From 197d33925268d6d7d608ceb3f111744ec39535c2 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 17 Aug 2024 12:02:23 -0700 Subject: [PATCH] Added to config.yml https://github.com/BentoBoxWorld/BentoBox/issues/2470 --- pom.xml | 2 +- .../world/bentobox/aoneblock/Settings.java | 27 ++++++++++++++++++- src/main/resources/config.yml | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 14bab8b..31bce21 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 2.0.9 1.20.4-R0.1-SNAPSHOT - 2.3.0-SNAPSHOT + 2.5.0-SNAPSHOT 2.6.2 1.3.0 diff --git a/src/main/java/world/bentobox/aoneblock/Settings.java b/src/main/java/world/bentobox/aoneblock/Settings.java index 4ec144e..83647ed 100644 --- a/src/main/java/world/bentobox/aoneblock/Settings.java +++ b/src/main/java/world/bentobox/aoneblock/Settings.java @@ -17,6 +17,7 @@ import com.google.common.base.Enums; import world.bentobox.aoneblock.listeners.BlockListener; +import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.api.configuration.ConfigComment; import world.bentobox.bentobox.api.configuration.ConfigEntry; import world.bentobox.bentobox.api.configuration.StoreAt; @@ -196,9 +197,14 @@ public class Settings implements WorldSettings { @ConfigEntry(path = "world.island-height") private int islandHeight = 120; + @ConfigComment("The number of concurrent islands a player can have in the world") + @ConfigComment("A value of 0 will use the BentoBox config.yml default") + @ConfigEntry(path = "world.concurrent-islands") + private int concurrentIslands = 0; + @ConfigComment("Disallow team members from having their own islands.") @ConfigEntry(path = "world.disallow-team-member-islands") - private boolean disallowTeamMemberIslands = false; + private boolean disallowTeamMemberIslands = true; @ConfigComment("Use your own world generator for this world.") @ConfigComment("In this case, the plugin will not generate anything.") @@ -2213,4 +2219,23 @@ public String getOffset() { public void setOffset(String offset) { this.offset = offset; } + + /** + * @return the concurrentIslands + */ + @Override + public int getConcurrentIslands() { + if (concurrentIslands <= 0) { + return BentoBox.getInstance().getSettings().getIslandNumber(); + } + return concurrentIslands; + } + + /** + * @param concurrentIslands the concurrentIslands to set + */ + public void setConcurrentIslands(int concurrentIslands) { + this.concurrentIslands = concurrentIslands; + } + } \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3237205..a5f60bb 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -126,7 +126,7 @@ world: # It is the y coordinate of the bedrock block in the schem. island-height: 80 # Disallow team members from having their own islands. - disallow-team-member-islands: false + disallow-team-member-islands: true # Use your own world generator for this world. # In this case, the plugin will not generate anything. # If used, you must specify the world name and generator in the bukkit.yml file.