From f52150ec1d8cd36bd66dc4ee77ac1b8856591ea5 Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 18 Apr 2023 16:22:15 -0700 Subject: [PATCH 1/5] Version 1.23.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a809d62a7..f857231fa 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ -LOCAL - 1.23.1 + 1.23.2 bentobox-world https://sonarcloud.io ${project.basedir}/lib From e991f099216767bd9fae9ad4ca8a4d281db31efb Mon Sep 17 00:00:00 2001 From: steve4744 Date: Fri, 21 Apr 2023 11:05:00 +0100 Subject: [PATCH 2/5] replace hardcoded file separator (#2121) --- .../java/world/bentobox/bentobox/api/addons/Pladdon.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/api/addons/Pladdon.java b/src/main/java/world/bentobox/bentobox/api/addons/Pladdon.java index 9f1197870..55d0e2d49 100644 --- a/src/main/java/world/bentobox/bentobox/api/addons/Pladdon.java +++ b/src/main/java/world/bentobox/bentobox/api/addons/Pladdon.java @@ -15,7 +15,7 @@ */ public abstract class Pladdon extends JavaPlugin { - private static final String ADDONS_FOLDER = "BentoBox/addons"; + private static final String ADDONS_FOLDER = "BentoBox" + File.separator + "addons"; /** * This must return a new instance of the addon. It is called when the Pladdon is loaded. @@ -33,7 +33,7 @@ public void onLoad() { } protected void moveJar() { - getLogger().severe(getFile().getName() + " must be in the BentoBox/addons folder! Trying to move it there..."); + getLogger().severe(getFile().getName() + " must be in the " + ADDONS_FOLDER + " folder! Trying to move it there..."); File addons = new File(getFile().getParent(), ADDONS_FOLDER); if (addons.exists() || addons.mkdirs()) { File to = new File(addons, getFile().getName()); @@ -44,7 +44,7 @@ protected void moveJar() { } catch (IOException ex) { getLogger().severe("Failed to move it. " + ex.getMessage()); - getLogger().severe("Move " + getFile().getName() + " manually into the BentoBox/addons folder. Then restart server."); + getLogger().severe("Move " + getFile().getName() + " manually into the " + ADDONS_FOLDER + " folder. Then restart server."); } } else { getLogger().warning(getFile().getName() + " already is in the addons folder. Delete the one in the plugins folder."); From 84adfaa622a87e53864f9f0826ab227a69827f67 Mon Sep 17 00:00:00 2001 From: zrdzn <87321869+zrdzn@users.noreply.github.com> Date: Thu, 4 May 2023 13:48:53 +0200 Subject: [PATCH 3/5] Fix typo in config --- src/main/resources/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 2911d5a8a..3be69031b 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -59,11 +59,11 @@ general: # This helps prevent issues if the server crashes. # Data is also saved at important points in the game. backup-period: 5 - # How many players will be saved in one tick. Default is 200 + # How many players will be saved in one tick. Default is 20 # Reduce if you experience lag while saving. # Do not set this too low or data might get lost! max-saved-players-per-tick: 20 - # How many islands will be saved in one tick. Default is 200 + # How many islands will be saved in one tick. Default is 20 # Reduce if you experience lag while saving. # Do not set this too low or data might get lost! max-saved-islands-per-tick: 20 From 8f954090e7d0ee3dcf2041f29f44d2c8300f2282 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 13 May 2023 09:20:47 -0700 Subject: [PATCH 4/5] Fixes VisitorKeepInventory to disregard coops and trusted #2126 Also fixes some tests. --- .../worldsettings/VisitorKeepInventoryListener.java | 4 +++- .../bentobox/listeners/PanelListenerManagerTest.java | 11 +++++++++++ .../VisitorKeepInventoryListenerTest.java | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListener.java b/src/main/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListener.java index 3bae913f8..03d40c724 100644 --- a/src/main/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListener.java +++ b/src/main/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListener.java @@ -11,11 +11,13 @@ import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.lists.Flags; +import world.bentobox.bentobox.managers.RanksManager; import world.bentobox.bentobox.util.Util; /** * Prevents visitors from losing their items if they * die on an island in which they are a visitor. + * Coops and above are not considered visitors. * Handles {@link world.bentobox.bentobox.lists.Flags#VISITOR_KEEP_INVENTORY}. * @author jstnf * @since 1.17.0 @@ -32,7 +34,7 @@ public void onVisitorDeath(PlayerDeathEvent e) { } Optional island = getIslands().getProtectedIslandAt(e.getEntity().getLocation()); - if (island.isPresent() && !island.get().getMemberSet().contains(e.getEntity().getUniqueId())) { + if (island.isPresent() && !island.get().getMemberSet(RanksManager.COOP_RANK).contains(e.getEntity().getUniqueId())) { e.setKeepInventory(true); e.setKeepLevel(true); e.getDrops().clear(); diff --git a/src/test/java/world/bentobox/bentobox/listeners/PanelListenerManagerTest.java b/src/test/java/world/bentobox/bentobox/listeners/PanelListenerManagerTest.java index b5448eca5..278b499de 100644 --- a/src/test/java/world/bentobox/bentobox/listeners/PanelListenerManagerTest.java +++ b/src/test/java/world/bentobox/bentobox/listeners/PanelListenerManagerTest.java @@ -171,6 +171,17 @@ public String getTitle() { return name; } + @Override + public String getOriginalTitle() { + // TODO Auto-generated method stub + return ""; + } + + @Override + public void setTitle(String title) { + // TODO Auto-generated method stub + } + } @After diff --git a/src/test/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListenerTest.java b/src/test/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListenerTest.java index d6763cc71..9d67d68a9 100644 --- a/src/test/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListenerTest.java +++ b/src/test/java/world/bentobox/bentobox/listeners/flags/worldsettings/VisitorKeepInventoryListenerTest.java @@ -4,6 +4,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -122,7 +123,7 @@ public void setUp() throws Exception { /* Islands */ when(plugin.getIslands()).thenReturn(islandsManager); // Visitor - when(island.getMemberSet()).thenReturn(ImmutableSet.of()); + when(island.getMemberSet(anyInt())).thenReturn(ImmutableSet.of()); // By default, there should be an island. when(islandsManager.getProtectedIslandAt(any())).thenReturn(Optional.of(island)); From d0d01dbc2b42f632aaeaf4cd741c555fe9e2fff8 Mon Sep 17 00:00:00 2001 From: Dusty <102945183+DustyGanteng@users.noreply.github.com> Date: Sun, 21 May 2023 23:42:47 +0700 Subject: [PATCH 5/5] Update en-US.yml Fixed weird remove reset count message --- src/main/resources/locales/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 122dc307b..7fead2e3b 100644 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -74,7 +74,7 @@ commands: remove: description: "reduces the player's island reset count" parameters: " " - success: "&a Successfully removed &b [number] &a resets from &b [name]'s island, decreasing the total to &b [total]&a resets." + success: "&a Successfully removed &b [number] &a resets from &b [name]'s island&a, decreasing the total to &b[total]&a resets." purge: parameters: "[days]" description: "purge islands abandoned for more than [days]"