Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>3.9.3</build.version>
<build.version>3.10.0</build.version>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<server.jars>${project.basedir}/lib</server.jars>
Expand Down
20 changes: 17 additions & 3 deletions src/main/java/world/bentobox/bentobox/managers/IslandsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,23 @@ public Island createIsland(@NonNull Location location) {
*/
@Nullable
public Island createIsland(@NonNull Location location, @Nullable UUID owner) {
Island island = new Island(location, owner, plugin.getIWM().getIslandProtectionRange(location.getWorld()));
return createIsland(location, owner, plugin.getIWM().getIslandProtectionRange(location.getWorld()));
}

/**
* Create an island with owner, and a specified protection range. Note this does not paste blocks. It just creates
* the island data object.
*
* @param location the location, not null
* @param owner the island owner UUID, may be null
* @param protectionRange size of protection range
* @return Island or null if the island could not be created for some reason
* @since 3.10.0
*/
public Island createIsland(@NonNull Location location, @Nullable UUID owner, int protectionRange) {
Island island = new Island(location, owner, protectionRange);
// Game the gamemode name and prefix the uniqueId
String gmName = plugin.getIWM().getAddon(location.getWorld()).map(gm -> gm.getDescription().getName())
.orElse("");
String gmName = plugin.getIWM().getAddon(location.getWorld()).map(gm -> gm.getDescription().getName()).orElse("");
island.setGameMode(gmName);
island.setUniqueId(gmName + island.getUniqueId());
if (islandCache.addIsland(island)) {
Expand All @@ -265,6 +278,7 @@ public Island createIsland(@NonNull Location location, @Nullable UUID owner) {
}
return null;
}


/**
* Deletes island.
Expand Down