Skip to content

Commit

Permalink
Add settings to config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 17, 2024
1 parent 1990268 commit 2a144b5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.3.0-SNAPSHOT</bentobox.version>
<bentobox.version>2.5.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
Expand Down
28 changes: 26 additions & 2 deletions src/main/java/world/bentobox/acidisland/AISettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.google.common.base.Enums;

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;
Expand Down Expand Up @@ -201,9 +202,14 @@ public class AISettings implements WorldSettings {
@ConfigEntry(path = "world.island-height")
private int islandHeight = 50;

@ConfigComment("Disallow team members from having their own islands.")
@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 players to have other islands if they are in a team.")
@ConfigEntry(path = "world.disallow-team-member-islands")
private boolean disallowTeamMemberIslands = false;
boolean disallowTeamMemberIslands = true;

@ConfigComment("Use your own world generator for this world.")
@ConfigComment("In this case, the plugin will not generate anything.")
Expand Down Expand Up @@ -2100,4 +2106,22 @@ public boolean isDisallowTeamMemberIslands() {
public void setDisallowTeamMemberIslands(boolean disallowTeamMemberIslands) {
this.disallowTeamMemberIslands = disallowTeamMemberIslands;
}

/**
* @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;
}
}
13 changes: 9 additions & 4 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ world:
# Island height - Lowest is 5.
# It is the y coordinate of the bedrock block in the schem.
island-height: 60
# Disallow team members from having their own islands.
# Only works if players are allowed multiple islands.
disallow-team-member-islands: false
# The number of concurrent islands a player can have in the world
# A value of 0 will use the BentoBox config.yml default
concurrent-islands: 1
# Disallow players to have other islands if they are in a team.
disallow-team-member-islands: true
# Use your own world generator for this world.
# In this case, the plugin will not generate anything.
# /!\ This feature is experimental and might not work as expected or might not work at all.
Expand Down Expand Up @@ -227,9 +229,9 @@ world:
# Mob white list - these mobs will NOT be removed when logging in or doing /island
remove-mobs-whitelist:
- ENDERMAN
- ZOMBIFIED_PIGLIN
- ZOMBIE_VILLAGER
- WITHER
- ZOMBIFIED_PIGLIN
# World flags. These are boolean settings for various flags for this world
flags:
CREEPER_DAMAGE: true
Expand All @@ -243,13 +245,16 @@ world:
PREVENT_TELEPORT_WHEN_FALLING: false
NATURAL_SPAWNING_OUTSIDE_RANGE: true
ENTER_EXIT_MESSAGES: true
ALLOW_MOVE_BOX: true
ENDERMAN_DEATH_DROP: true
LIQUIDS_FLOWING_OUT: false
OFFLINE_REDSTONE: true
REMOVE_END_EXIT_ISLAND: true
OFFLINE_GROWTH: true
REMOVE_MOBS: true
ENDER_CHEST: false
ITEM_FRAME_DAMAGE: false
TREES_GROWING_OUTSIDE_RANGE: false
BOAT: true
# These are the default protection settings for new islands.
# The value is the minimum island rank required allowed to do the action
Expand Down

0 comments on commit 2a144b5

Please sign in to comment.