Skip to content

Commit

Permalink
Added settings for concurrent islands and team member islands.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 17, 2024
1 parent 5a7bd5f commit 58bdafc
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/main/java/world/bentobox/bskyblock/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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 @@ -135,6 +136,15 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.max-islands")
private int maxIslands = -1;

@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")
boolean disallowTeamMemberIslands = true;

@ConfigComment("The default game mode for this world. Players will be set to this mode when they create")
@ConfigComment("a new island for example. Options are SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR")
@ConfigEntry(path = "world.default-game-mode")
Expand Down Expand Up @@ -1817,4 +1827,37 @@ public void setMakeEndPortals(boolean makeEndPortals) {
this.makeEndPortals = makeEndPortals;
}

/**
* @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;
}

/**
* @return the disallowTeamMemberIslands
*/
@Override
public boolean isDisallowTeamMemberIslands() {
return disallowTeamMemberIslands;
}

/**
* @param disallowTeamMemberIslands the disallowTeamMemberIslands to set
*/
public void setDisallowTeamMemberIslands(boolean disallowTeamMemberIslands) {
this.disallowTeamMemberIslands = disallowTeamMemberIslands;
}

}

0 comments on commit 58bdafc

Please sign in to comment.