Skip to content

Commit

Permalink
Merge pull request #2129 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Version 1.23.2
  • Loading branch information
tastybento committed May 28, 2023
2 parents ce5830e + eb76d00 commit fdc03df
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/world/bentobox/bentobox/api/addons/Pladdon.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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());
Expand All @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +34,7 @@ public void onVisitorDeath(PlayerDeathEvent e) {
}

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();
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit fdc03df

Please sign in to comment.