diff --git a/pom.xml b/pom.xml
index c4b5ccd78..5f5b6f725 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,7 +88,7 @@
-LOCAL
- 2.5.3
+ 2.5.4
bentobox-world
https://sonarcloud.io
${project.basedir}/lib
@@ -157,10 +157,6 @@
codemc-repo
https://repo.codemc.org/repository/maven-public
-
- placeholderapi-repo
- https://repo.extendedclip.com/content/repositories/placeholderapi/
-
dynmap-repo
https://repo.mikeprimm.com/
diff --git a/src/main/java/world/bentobox/bentobox/Settings.java b/src/main/java/world/bentobox/bentobox/Settings.java
index c149907b2..992aa0333 100644
--- a/src/main/java/world/bentobox/bentobox/Settings.java
+++ b/src/main/java/world/bentobox/bentobox/Settings.java
@@ -141,7 +141,6 @@ public class Settings implements ConfigObject {
private Set fakePlayers = new HashSet<>();
/* PANELS */
-
@ConfigComment("Toggle whether panels should be closed or not when the player clicks anywhere outside of the inventory view.")
@ConfigEntry(path = "panel.close-on-click-outside")
private boolean closePanelOnClickOutside = true;
@@ -189,6 +188,13 @@ public class Settings implements ConfigObject {
/*
* Island
*/
+ @ConfigComment("Override island distance mismatch checking. BentoBox normally refuses to run if")
+ @ConfigComment("the island distance in the gamemode config is different to the one stored in the database")
+ @ConfigComment("for safety. This overrides that check. You should never need this, and if you do not understand it")
+ @ConfigComment("keep it as false")
+ @ConfigEntry(path = "island.override-safety-check")
+ private boolean overrideSafetyCheck = false;
+
// Number of islands
@ConfigComment("The default number of concurrent islands a player may have.")
@ConfigComment("This may be overridden by individual game mode config settings.")
@@ -1034,4 +1040,18 @@ public void setHideUsedBlueprints(boolean hideUsedBlueprints) {
this.hideUsedBlueprints = hideUsedBlueprints;
}
+ /**
+ * @return the overrideSafetyCheck
+ */
+ public boolean isOverrideSafetyCheck() {
+ return overrideSafetyCheck;
+ }
+
+ /**
+ * @param overrideSafetyCheck the overrideSafetyCheck to set
+ */
+ public void setOverrideSafetyCheck(boolean overrideSafetyCheck) {
+ this.overrideSafetyCheck = overrideSafetyCheck;
+ }
+
}
diff --git a/src/main/java/world/bentobox/bentobox/api/commands/admin/purge/AdminPurgeCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/admin/purge/AdminPurgeCommand.java
index a5c6fe6cc..1e90aa431 100644
--- a/src/main/java/world/bentobox/bentobox/api/commands/admin/purge/AdminPurgeCommand.java
+++ b/src/main/java/world/bentobox/bentobox/api/commands/admin/purge/AdminPurgeCommand.java
@@ -133,6 +133,7 @@ Set getOldIslands(int days) {
// Process islands in one pass, logging and adding to the set if applicable
getPlugin().getIslands().getIslands().stream()
.filter(i -> !i.isSpawn()).filter(i -> !i.getPurgeProtected())
+ .filter(i -> i.getWorld() != null) // to handle currently unloaded world islands
.filter(i -> i.getWorld().equals(this.getWorld())).filter(Island::isOwned).filter(
i -> i.getMemberSet().stream()
.allMatch(member -> (currentTimeMillis
diff --git a/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelItemBuilder.java b/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelItemBuilder.java
index ebe17e3c4..75d4a95e9 100644
--- a/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelItemBuilder.java
+++ b/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelItemBuilder.java
@@ -104,7 +104,9 @@ public PanelItemBuilder description(String... description) {
* @return PanelItemBuilder
*/
public PanelItemBuilder description(String description) {
- Collections.addAll(this.description, description.split("\n"));
+ if (description != null) {
+ Collections.addAll(this.description, description.split("\n"));
+ }
return this;
}
@@ -168,7 +170,7 @@ public PanelItem.ClickHandler getClickHandler() {
public boolean isPlayerHead() {
return playerHeadName != null && !playerHeadName.isEmpty();
}
-
+
/**
* @return the playerHead
* @since 1.9.0
diff --git a/src/main/java/world/bentobox/bentobox/database/json/adapters/ProfessionTypeAdapter.java b/src/main/java/world/bentobox/bentobox/database/json/adapters/ProfessionTypeAdapter.java
index bd40494ec..e083e3ece 100644
--- a/src/main/java/world/bentobox/bentobox/database/json/adapters/ProfessionTypeAdapter.java
+++ b/src/main/java/world/bentobox/bentobox/database/json/adapters/ProfessionTypeAdapter.java
@@ -12,8 +12,12 @@
public class ProfessionTypeAdapter extends TypeAdapter {
@Override
- public void write(JsonWriter out, Profession profession) throws IOException {
- out.value(profession.name());
+ public void write(JsonWriter out, Profession profession) throws IOException {
+ if (profession != null) {
+ out.value(profession.name());
+ return;
+ }
+ out.nullValue();
}
@Override
diff --git a/src/main/java/world/bentobox/bentobox/database/json/adapters/VillagerTypeAdapter.java b/src/main/java/world/bentobox/bentobox/database/json/adapters/VillagerTypeAdapter.java
index 050142ad6..9752f17a6 100644
--- a/src/main/java/world/bentobox/bentobox/database/json/adapters/VillagerTypeAdapter.java
+++ b/src/main/java/world/bentobox/bentobox/database/json/adapters/VillagerTypeAdapter.java
@@ -12,7 +12,11 @@
public class VillagerTypeAdapter extends TypeAdapter {
@Override
- public void write(JsonWriter out, Villager.Type type) throws IOException {
+ public void write(JsonWriter out, Villager.Type type) throws IOException {
+ if (type == null) {
+ out.nullValue();
+ return;
+ }
out.value(type.name());
}
diff --git a/src/main/java/world/bentobox/bentobox/database/objects/Players.java b/src/main/java/world/bentobox/bentobox/database/objects/Players.java
index ca384ed12..883072d7c 100644
--- a/src/main/java/world/bentobox/bentobox/database/objects/Players.java
+++ b/src/main/java/world/bentobox/bentobox/database/objects/Players.java
@@ -253,10 +253,32 @@ public void addToPendingKick(World world)
public Optional