11package world .bentobox .skygrid ;
22
3- import java .util .ArrayList ;
4- import java .util .EnumMap ;
5- import java .util .HashMap ;
6- import java .util .HashSet ;
7- import java .util .List ;
8- import java .util .Map ;
9- import java .util .Set ;
3+ import java .util .*;
104
115import org .bukkit .Difficulty ;
126import org .bukkit .GameMode ;
@@ -92,6 +86,12 @@ public class Settings implements WorldSettings {
9286 @ ConfigEntry (path = "world.nether.blocks" )
9387 private Map <Material , Integer > netherBlocks = new EnumMap <>(Material .class );
9488
89+ @ ConfigComment ("This option indicates if nether portals should be linked via dimensions." )
90+ @ ConfigComment ("Option will simulate vanilla portal mechanics that links portals together" )
91+ @ ConfigComment ("or creates a new portal, if there is not a portal in that dimension." )
92+ @ ConfigEntry (path = "world.nether.create-and-link-portals" , since = "1.16" )
93+ private boolean makeNetherPortals = false ;
94+
9595 // End
9696 @ ConfigComment ("Generate SkyGrid End - if this is false, the end world will not be made" )
9797 @ ConfigEntry (path = "world.end.generate" )
@@ -101,6 +101,11 @@ public class Settings implements WorldSettings {
101101 @ ConfigEntry (path = "world.end.blocks" )
102102 private Map <Material , Integer > endBlocks = new EnumMap <>(Material .class );
103103
104+ @ ConfigComment ("This option indicates if obsidian platform in the end should be generated" )
105+ @ ConfigComment ("when player enters the end world." )
106+ @ ConfigEntry (path = "world.end.create-obsidian-platform" , since = "1.16" )
107+ private boolean makeEndPortals = false ;
108+
104109 /* SkyGrid */
105110 @ ConfigComment ("Biomes - this will affect some block types and tree types." )
106111 @ ConfigEntry (path = "world.create-biomes" )
@@ -330,13 +335,50 @@ public class Settings implements WorldSettings {
330335
331336 // Commands
332337 @ ConfigComment ("List of commands to run when a player joins." )
338+ @ ConfigComment ("These commands are run by the console, unless otherwise stated using the [SUDO] prefix," )
339+ @ ConfigComment ("in which case they are executed by the player." )
340+ @ ConfigComment ("" )
341+ @ ConfigComment ("Available placeholders for the commands are the following:" )
342+ @ ConfigComment (" * [name]: name of the player" )
343+ @ ConfigComment ("" )
344+ @ ConfigComment ("Here are some examples of valid commands to execute:" )
345+ @ ConfigComment (" * '[SUDO] bbox version'" )
346+ @ ConfigComment (" * 'bsbadmin deaths set [player] 0'" )
347+ @ ConfigComment ("" )
348+ @ ConfigComment ("Note that player-executed commands might not work, as these commands can be run with said player being offline." )
333349 @ ConfigEntry (path = "area.commands.on-join" )
334350 private List <String > onJoinCommands = new ArrayList <>();
335351
336352 @ ConfigComment ("list of commands to run when a player leaves." )
353+ @ ConfigComment ("These commands are run by the console, unless otherwise stated using the [SUDO] prefix," )
354+ @ ConfigComment ("in which case they are executed by the player." )
355+ @ ConfigComment ("" )
356+ @ ConfigComment ("Available placeholders for the commands are the following:" )
357+ @ ConfigComment (" * [name]: name of the player" )
358+ @ ConfigComment ("" )
359+ @ ConfigComment ("Here are some examples of valid commands to execute:" )
360+ @ ConfigComment (" * '[SUDO] bbox version'" )
361+ @ ConfigComment (" * 'bsbadmin deaths set [player] 0'" )
362+ @ ConfigComment ("" )
363+ @ ConfigComment ("Note that player-executed commands might not work, as these commands can be run with said player being offline." )
337364 @ ConfigEntry (path = "area.commands.on-leave" )
338365 private List <String > onLeaveCommands = new ArrayList <>();
339366
367+ @ ConfigComment ("List of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true." )
368+ @ ConfigComment ("These commands are run by the console, unless otherwise stated using the [SUDO] prefix," )
369+ @ ConfigComment ("in which case they are executed by the player." )
370+ @ ConfigComment ("" )
371+ @ ConfigComment ("Available placeholders for the commands are the following:" )
372+ @ ConfigComment (" * [name]: name of the player" )
373+ @ ConfigComment ("" )
374+ @ ConfigComment ("Here are some examples of valid commands to execute:" )
375+ @ ConfigComment (" * '[SUDO] bbox version'" )
376+ @ ConfigComment (" * 'bsbadmin deaths set [player] 0'" )
377+ @ ConfigComment ("" )
378+ @ ConfigComment ("Note that player-executed commands might not work, as these commands can be run with said player being offline." )
379+ @ ConfigEntry (path = "area.commands.on-respawn" , since = "1.14.0" )
380+ private List <String > onRespawnCommands = new ArrayList <>();
381+
340382 // Sethome
341383 @ ConfigComment ("Allow setting home in the nether. Only available on nether islands, not vanilla nether." )
342384 @ ConfigEntry (path = "area.sethome.nether.allow" )
@@ -377,6 +419,11 @@ public class Settings implements WorldSettings {
377419 @ ConfigEntry (path = "protection.geo-limit-settings" )
378420 private List <String > geoLimitSettings = new ArrayList <>();
379421
422+ @ ConfigComment ("SkyGrid blocked mobs." )
423+ @ ConfigComment ("List of mobs that should not spawn in SkyGrid." )
424+ @ ConfigEntry (path = "protection.block-mobs" )
425+ private List <String > mobLimitSettings = new ArrayList <>();
426+
380427 // Invincible visitor settings
381428 @ ConfigComment ("Invincible visitors. List of damages that will not affect visitors." )
382429 @ ConfigComment ("Make list blank if visitors should receive all damages" )
@@ -1295,7 +1342,7 @@ public void setDeathsResetOnNewIsland(boolean deathsResetOnNewIsland) {
12951342 */
12961343 @ Override
12971344 public List <String > getOnJoinCommands () {
1298- return onJoinCommands ;
1345+ return Objects . requireNonNullElseGet ( onJoinCommands , ArrayList :: new ) ;
12991346 }
13001347
13011348 /**
@@ -1310,7 +1357,7 @@ public void setOnJoinCommands(List<String> onJoinCommands) {
13101357 */
13111358 @ Override
13121359 public List <String > getOnLeaveCommands () {
1313- return onLeaveCommands ;
1360+ return Objects . requireNonNullElseGet ( onLeaveCommands , ArrayList :: new ) ;
13141361 }
13151362
13161363 /**
@@ -1320,6 +1367,23 @@ public void setOnLeaveCommands(List<String> onLeaveCommands) {
13201367 this .onLeaveCommands = onLeaveCommands ;
13211368 }
13221369
1370+ /**
1371+ * @return the onRespawnCommands
1372+ */
1373+ @ Override
1374+ public List <String > getOnRespawnCommands () {
1375+ return Objects .requireNonNullElseGet (onRespawnCommands , ArrayList ::new );
1376+ }
1377+
1378+ /**
1379+ * Sets on respawn commands.
1380+ *
1381+ * @param onRespawnCommands the on respawn commands
1382+ */
1383+ public void setOnRespawnCommands (List <String > onRespawnCommands ) {
1384+ this .onRespawnCommands = onRespawnCommands ;
1385+ }
1386+
13231387 /**
13241388 * @return the onJoinResetHealth
13251389 */
@@ -1493,4 +1557,61 @@ public String getDefaultPlayerAction() {
14931557 public void setDefaultPlayerAction (String defaultPlayerAction ) {
14941558 this .defaultPlayerAction = defaultPlayerAction ;
14951559 }
1560+
1561+ /**
1562+ * @return the mobLimitSettings
1563+ */
1564+ @ Override
1565+ public List <String > getMobLimitSettings () {
1566+ return mobLimitSettings ;
1567+ }
1568+
1569+ /**
1570+ * @param mobLimitSettings the mobLimitSettings to set
1571+ */
1572+ public void setMobLimitSettings (List <String > mobLimitSettings ) {
1573+ this .mobLimitSettings = mobLimitSettings ;
1574+ }
1575+
1576+ /**
1577+ * @return the makeNetherPortals
1578+ */
1579+ @ Override
1580+ public boolean isMakeNetherPortals () {
1581+ return makeNetherPortals ;
1582+ }
1583+
1584+ /**
1585+ * @return the makeEndPortals
1586+ */
1587+ @ Override
1588+ public boolean isMakeEndPortals () {
1589+ return makeEndPortals ;
1590+ }
1591+
1592+ /**
1593+ * Sets make nether portals.
1594+ * @param makeNetherPortals the make nether portals
1595+ */
1596+ public void setMakeNetherPortals (boolean makeNetherPortals ) {
1597+ this .makeNetherPortals = makeNetherPortals ;
1598+ }
1599+
1600+ /**
1601+ * Sets make end portals.
1602+ * @param makeEndPortals the make end portals
1603+ */
1604+ public void setMakeEndPortals (boolean makeEndPortals ) {
1605+ this .makeEndPortals = makeEndPortals ;
1606+ }
1607+
1608+ /**
1609+ * SkyGrid should not check for blocks.
1610+ * @return false
1611+ */
1612+ @ Override
1613+ public boolean isCheckForBlocks ()
1614+ {
1615+ return false ;
1616+ }
14961617}
0 commit comments