Merge pull request #2129 from BentoBoxWorld/develop

Version 1.23.2
This commit is contained in:
tastybento 2023-05-28 11:52:07 -07:00 committed by GitHub
commit fdc03df298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 9 deletions

View File

@ -88,7 +88,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>1.23.1</build.version>
<build.version>1.23.2</build.version>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<server.jars>${project.basedir}/lib</server.jars>

View File

@ -15,7 +15,7 @@ import com.google.common.io.Files;
*/
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 abstract class Pladdon extends JavaPlugin {
}
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 @@ public abstract class Pladdon extends JavaPlugin {
} 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.");

View File

@ -11,11 +11,13 @@ import world.bentobox.bentobox.api.flags.FlagListener;
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 class VisitorKeepInventoryListener extends FlagListener {
}
Optional<Island> 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();

View File

@ -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

View File

@ -74,7 +74,7 @@ commands:
remove:
description: "reduces the player's island reset count"
parameters: "<player> <resets>"
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]"

View File

@ -171,6 +171,17 @@ public class PanelListenerManagerTest {
return name;
}
@Override
public String getOriginalTitle() {
// TODO Auto-generated method stub
return "";
}
@Override
public void setTitle(String title) {
// TODO Auto-generated method stub
}
}
@After

View File

@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
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 class VisitorKeepInventoryListenerTest {
/* 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));