Skip to content

Commit 8af21d7

Browse files
BONNetastybento
andauthored
Release 1.14.4 with exposed options (#57)
* Version 1.14.4 * Implement options for linking nether portals and crating end obsidian platform. * Implement onRespawnCommands() option from BentoBox 1.14. * Fixes copy-paste issue Co-authored-by: tastybento <[email protected]>
1 parent cbc3832 commit 8af21d7

File tree

3 files changed

+126
-7
lines changed

3 files changed

+126
-7
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<!-- Revision variable removes warning about dynamic version -->
5151
<revision>${build.version}-SNAPSHOT</revision>
5252
<!-- This allows to change between versions and snapshots. -->
53-
<build.version>1.14.3</build.version>
53+
<build.version>1.14.4</build.version>
5454
<build.number>-LOCAL</build.number>
5555
</properties>
5656

src/main/java/world/bentobox/caveblock/Settings.java

+116-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.bukkit.Material;
1414
import org.bukkit.block.Biome;
1515
import org.bukkit.entity.EntityType;
16+
import org.eclipse.jdt.annotation.NonNull;
1617

1718
import com.google.common.base.Enums;
1819

@@ -862,6 +863,36 @@ public String getDefaultNewPlayerAction()
862863
}
863864

864865

866+
/**
867+
* {@inheritDoc}
868+
*/
869+
@Override
870+
public boolean isMakeNetherPortals()
871+
{
872+
return this.makeNetherPortals;
873+
}
874+
875+
876+
/**
877+
* {@inheritDoc}
878+
*/
879+
@Override
880+
public boolean isMakeEndPortals()
881+
{
882+
return this.makeEndPortals;
883+
}
884+
885+
886+
/**
887+
* {@inheritDoc}
888+
*/
889+
@Override
890+
public @NonNull List<String> getOnRespawnCommands()
891+
{
892+
return this.onRespawnCommands;
893+
}
894+
895+
865896
// ---------------------------------------------------------------------
866897
// Section: Setters
867898
// ---------------------------------------------------------------------
@@ -2001,6 +2032,39 @@ public boolean isCheckForBlocks() {
20012032
}
20022033

20032034

2035+
/**
2036+
* Sets make nether portals.
2037+
*
2038+
* @param makeNetherPortals the make nether portals
2039+
*/
2040+
public void setMakeNetherPortals(boolean makeNetherPortals)
2041+
{
2042+
this.makeNetherPortals = makeNetherPortals;
2043+
}
2044+
2045+
2046+
/**
2047+
* Sets make end portals.
2048+
*
2049+
* @param makeEndPortals the make end portals
2050+
*/
2051+
public void setMakeEndPortals(boolean makeEndPortals)
2052+
{
2053+
this.makeEndPortals = makeEndPortals;
2054+
}
2055+
2056+
2057+
/**
2058+
* Sets on respawn commands.
2059+
*
2060+
* @param onRespawnCommands the on respawn commands
2061+
*/
2062+
public void setOnRespawnCommands(List<String> onRespawnCommands)
2063+
{
2064+
this.onRespawnCommands = onRespawnCommands;
2065+
}
2066+
2067+
20042068
// ---------------------------------------------------------------------
20052069
// Section: Variables
20062070
// ---------------------------------------------------------------------
@@ -2207,6 +2271,12 @@ public boolean isCheckForBlocks() {
22072271
@ConfigEntry(path = "world.nether.blocks", needsReset = true)
22082272
private List<String> netherBlocks = new ArrayList<>();
22092273

2274+
@ConfigComment("This option indicates if nether portals should be linked via dimensions.")
2275+
@ConfigComment("Option will simulate vanilla portal mechanics that links portals together")
2276+
@ConfigComment("or creates a new portal, if there is not a portal in that dimension.")
2277+
@ConfigEntry(path = "world.nether.create-and-link-portals")
2278+
private boolean makeNetherPortals = false;
2279+
22102280
// End
22112281
@ConfigEntry(path = "world.end.generate")
22122282
private boolean endGenerate = true;
@@ -2245,6 +2315,11 @@ public boolean isCheckForBlocks() {
22452315
@ConfigEntry(path = "world.end.blocks", needsReset = true)
22462316
private List<String> endBlocks = new ArrayList<>();
22472317

2318+
@ConfigComment("This option indicates if obsidian platform in the end should be generated")
2319+
@ConfigComment("when player enters the end world.")
2320+
@ConfigEntry(path = "world.end.create-obsidian-platform")
2321+
private boolean makeEndPortals = false;
2322+
22482323
// Other staff.
22492324

22502325
@ConfigComment("Mob white list - these mobs will NOT be removed when logging in or doing /cave")
@@ -2440,14 +2515,51 @@ public boolean isCheckForBlocks() {
24402515
private boolean pasteMissingIslands = false;
24412516

24422517
// Commands
2443-
@ConfigComment("List of commands to run when a player joins.")
2444-
@ConfigEntry(path = "cave.commands.on-join")
2518+
@ConfigComment("List of commands to run when a player joins an cave or creates one.")
2519+
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
2520+
@ConfigComment("in which case they are executed by the player.")
2521+
@ConfigComment("")
2522+
@ConfigComment("Available placeholders for the commands are the following:")
2523+
@ConfigComment(" * [name]: name of the player")
2524+
@ConfigComment("")
2525+
@ConfigComment("Here are some examples of valid commands to execute:")
2526+
@ConfigComment(" * '[SUDO] bbox version'")
2527+
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
2528+
@ConfigComment("")
2529+
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
2530+
@ConfigEntry(path = "cave.commands.on-join", since = "1.8.0")
24452531
private List<String> onJoinCommands = new ArrayList<>();
24462532

2447-
@ConfigComment("list of commands to run when a player leaves.")
2448-
@ConfigEntry(path = "cave.commands.on-leave")
2533+
@ConfigComment("List of commands to run when a player leaves a cave, resets his cave or gets kicked from it.")
2534+
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
2535+
@ConfigComment("in which case they are executed by the player.")
2536+
@ConfigComment("")
2537+
@ConfigComment("Available placeholders for the commands are the following:")
2538+
@ConfigComment(" * [name]: name of the player")
2539+
@ConfigComment("")
2540+
@ConfigComment("Here are some examples of valid commands to execute:")
2541+
@ConfigComment(" * '[SUDO] bbox version'")
2542+
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
2543+
@ConfigComment("")
2544+
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
2545+
@ConfigEntry(path = "cave.commands.on-leave", since = "1.8.0")
24492546
private List<String> onLeaveCommands = new ArrayList<>();
24502547

2548+
@ConfigComment("List of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.")
2549+
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
2550+
@ConfigComment("in which case they are executed by the player.")
2551+
@ConfigComment("")
2552+
@ConfigComment("Available placeholders for the commands are the following:")
2553+
@ConfigComment(" * [name]: name of the player")
2554+
@ConfigComment("")
2555+
@ConfigComment("Here are some examples of valid commands to execute:")
2556+
@ConfigComment(" * '[SUDO] bbox version'")
2557+
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
2558+
@ConfigComment("")
2559+
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
2560+
@ConfigEntry(path = "cave.commands.on-respawn", since = "1.14.0")
2561+
private List<String> onRespawnCommands = new ArrayList<>();
2562+
24512563
// Sethome
24522564
@ConfigComment("Allow setting home in the nether. Only available on nether islands, not vanilla nether.")
24532565
@ConfigEntry(path = "cave.sethome.nether.allow")

src/main/resources/config.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ world:
181181
- ENTITY:GHAST:0.1:1
182182
- ENTITY:WITHER_SKELETON:0.1:1
183183
- MATERIAL:FIRE:10:1
184+
# This option indicates if nether portals should be linked via dimensions.
185+
# Option will simulate vanilla portal mechanics that links portals together or creates a new portal, if there is not a portal in other dimension.
186+
create-and-link-portals: false
184187
end:
185188
generate: true
186189
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
@@ -213,6 +216,8 @@ world:
213216
- ENTITY:SHULKER:0.2:1
214217
- MATERIAL:OBSIDIAN:1:1
215218
- MATERIAL:CHORUS_PLANT:1:3
219+
# This option indicates if obsidian platform in the end should be generated when player enters the end world.
220+
create-obsidian-platform: false
216221
# Mob white list - these mobs will NOT be removed when logging in or doing /cave
217222
remove-mobs-whitelist:
218223
- WITHER
@@ -454,10 +459,12 @@ cave:
454459
# Added since 1.10.0.
455460
create-missing-nether-end-caves: false
456461
commands:
457-
# List of commands to run when a player joins.
462+
# List of commands to run when a player joins an cave or creates one.
458463
on-join: []
459-
# list of commands to run when a player leaves.
464+
# List of commands to run when a player leaves a cave, resets his cave or gets kicked from it.
460465
on-leave: []
466+
# Returns a list of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.
467+
on-respawn: []
461468
sethome:
462469
nether:
463470
# Allow setting home in the nether. Only available on nether islands, not vanilla nether.

0 commit comments

Comments
 (0)