|
10 | 10 |
|
11 | 11 | import com.google.common.base.Enums;
|
12 | 12 |
|
| 13 | +import world.bentobox.bentobox.BentoBox; |
13 | 14 | import world.bentobox.bentobox.api.configuration.ConfigComment;
|
14 | 15 | import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
15 | 16 | import world.bentobox.bentobox.api.configuration.StoreAt;
|
@@ -135,6 +136,15 @@ public class Settings implements WorldSettings {
|
135 | 136 | @ConfigEntry(path = "world.max-islands")
|
136 | 137 | private int maxIslands = -1;
|
137 | 138 |
|
| 139 | + @ConfigComment("The number of concurrent islands a player can have in the world") |
| 140 | + @ConfigComment("A value of 0 will use the BentoBox config.yml default") |
| 141 | + @ConfigEntry(path = "world.concurrent-islands") |
| 142 | + private int concurrentIslands = 0; |
| 143 | + |
| 144 | + @ConfigComment("Disallow players to have other islands if they are in a team.") |
| 145 | + @ConfigEntry(path = "world.disallow-team-member-islands") |
| 146 | + boolean disallowTeamMemberIslands = true; |
| 147 | + |
138 | 148 | @ConfigComment("The default game mode for this world. Players will be set to this mode when they create")
|
139 | 149 | @ConfigComment("a new island for example. Options are SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR")
|
140 | 150 | @ConfigEntry(path = "world.default-game-mode")
|
@@ -1817,4 +1827,37 @@ public void setMakeEndPortals(boolean makeEndPortals) {
|
1817 | 1827 | this.makeEndPortals = makeEndPortals;
|
1818 | 1828 | }
|
1819 | 1829 |
|
| 1830 | + /** |
| 1831 | + * @return the concurrentIslands |
| 1832 | + */ |
| 1833 | + @Override |
| 1834 | + public int getConcurrentIslands() { |
| 1835 | + if (concurrentIslands <= 0) { |
| 1836 | + return BentoBox.getInstance().getSettings().getIslandNumber(); |
| 1837 | + } |
| 1838 | + return concurrentIslands; |
| 1839 | + } |
| 1840 | + |
| 1841 | + /** |
| 1842 | + * @param concurrentIslands the concurrentIslands to set |
| 1843 | + */ |
| 1844 | + public void setConcurrentIslands(int concurrentIslands) { |
| 1845 | + this.concurrentIslands = concurrentIslands; |
| 1846 | + } |
| 1847 | + |
| 1848 | + /** |
| 1849 | + * @return the disallowTeamMemberIslands |
| 1850 | + */ |
| 1851 | + @Override |
| 1852 | + public boolean isDisallowTeamMemberIslands() { |
| 1853 | + return disallowTeamMemberIslands; |
| 1854 | + } |
| 1855 | + |
| 1856 | + /** |
| 1857 | + * @param disallowTeamMemberIslands the disallowTeamMemberIslands to set |
| 1858 | + */ |
| 1859 | + public void setDisallowTeamMemberIslands(boolean disallowTeamMemberIslands) { |
| 1860 | + this.disallowTeamMemberIslands = disallowTeamMemberIslands; |
| 1861 | + } |
| 1862 | + |
1820 | 1863 | }
|
0 commit comments