diff --git a/pom.xml b/pom.xml
index 1f80faa..5beb31e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,13 +41,9 @@
-
- codemc-snapshots
- https://repo.codemc.org/repository/maven-snapshots
-
- codemc-releases
- https://repo.codemc.org/repository/maven-releases
+ bentoboxworld
+ https://repo.codemc.org/repository/bentoboxworld/
@@ -58,12 +54,12 @@
2.0.2
- 1.16.4-R0.1-SNAPSHOT
+ 1.21.3-R0.1-SNAPSHOT
1.7
- 1.20.0
+ 2.7.1-SNAPSHOT
1.12.0
@@ -73,7 +69,7 @@
2.1.1
- 1.0.0
+ 1.2.0
${build.version}-SNAPSHOT
@@ -128,6 +124,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots
+
+ bentoboxworld
+ https://repo.codemc.org/repository/bentoboxworld/
+
codemc
https://repo.codemc.org/repository/maven-snapshots/
@@ -293,7 +293,7 @@
org.jacoco
jacoco-maven-plugin
- 0.8.3
+ 0.8.10
true
diff --git a/src/main/java/world/bentobox/checkmeout/CheckMeOutPladdon.java b/src/main/java/world/bentobox/checkmeout/CheckMeOutPladdon.java
index d4b0843..e9f1ea6 100644
--- a/src/main/java/world/bentobox/checkmeout/CheckMeOutPladdon.java
+++ b/src/main/java/world/bentobox/checkmeout/CheckMeOutPladdon.java
@@ -10,8 +10,13 @@
*/
public class CheckMeOutPladdon extends Pladdon {
+ private Addon addon;
+
@Override
public Addon getAddon() {
- return new CheckMeOut();
+ if (addon == null) {
+ addon = new CheckMeOut();
+ }
+ return addon;
}
}
diff --git a/src/main/java/world/bentobox/checkmeout/managers/SubmissionsManager.java b/src/main/java/world/bentobox/checkmeout/managers/SubmissionsManager.java
index 709561e..88637c5 100644
--- a/src/main/java/world/bentobox/checkmeout/managers/SubmissionsManager.java
+++ b/src/main/java/world/bentobox/checkmeout/managers/SubmissionsManager.java
@@ -76,7 +76,6 @@ public SubmissionsManager(CheckMeOut addon, BentoBox plugin) {
* @return true if successful, false if not
*/
public boolean addSubmission(final UUID playerUUID, final Location loc) {
- BentoBox.getInstance().logDebug("add ing submittion " + playerUUID + " " + loc);
// Do not allow null players to set submissions
if (playerUUID == null || loc == null) {
return false;
diff --git a/src/main/java/world/bentobox/checkmeout/panels/ViewSubmissionsPanel.java b/src/main/java/world/bentobox/checkmeout/panels/ViewSubmissionsPanel.java
index e4e1aa4..27d05ce 100644
--- a/src/main/java/world/bentobox/checkmeout/panels/ViewSubmissionsPanel.java
+++ b/src/main/java/world/bentobox/checkmeout/panels/ViewSubmissionsPanel.java
@@ -34,9 +34,9 @@
*/
public class ViewSubmissionsPanel
{
-// ---------------------------------------------------------------------
-// Section: Constructor
-// ---------------------------------------------------------------------
+ // ---------------------------------------------------------------------
+ // Section: Constructor
+ // ---------------------------------------------------------------------
/**
@@ -47,8 +47,8 @@ public class ViewSubmissionsPanel
* @param user User who opens panel
*/
private ViewSubmissionsPanel(CheckMeOut addon,
- World world,
- User user)
+ World world,
+ User user)
{
this.addon = addon;
this.user = user;
@@ -58,9 +58,9 @@ private ViewSubmissionsPanel(CheckMeOut addon,
}
-// ---------------------------------------------------------------------
-// Section: Methods
-// ---------------------------------------------------------------------
+ // ---------------------------------------------------------------------
+ // Section: Methods
+ // ---------------------------------------------------------------------
/**
@@ -98,9 +98,9 @@ private void build()
}
-// ---------------------------------------------------------------------
-// Section: Buttons
-// ---------------------------------------------------------------------
+ // ---------------------------------------------------------------------
+ // Section: Buttons
+ // ---------------------------------------------------------------------
/**
@@ -116,7 +116,7 @@ private PanelItem createNextButton(@NonNull ItemTemplateRecord template, Templat
int size = this.elementList.size();
if (size <= slot.amountMap().getOrDefault("ISLAND", 1) ||
- 1.0 * size / slot.amountMap().getOrDefault("ISLAND", 1) <= this.pageIndex + 1)
+ 1.0 * size / slot.amountMap().getOrDefault("ISLAND", 1) <= this.pageIndex + 1)
{
// There are no next elements
return null;
@@ -146,7 +146,7 @@ private PanelItem createNextButton(@NonNull ItemTemplateRecord template, Templat
if (template.description() != null)
{
builder.description(this.user.getTranslation(this.world, template.description(),
- "[number]", String.valueOf(nextPageIndex)));
+ "[number]", String.valueOf(nextPageIndex)));
}
// Add ClickHandler
@@ -170,10 +170,10 @@ private PanelItem createNextButton(@NonNull ItemTemplateRecord template, Templat
// Collect tooltips.
List tooltips = template.actions().stream().
- filter(action -> action.tooltip() != null).
- map(action -> this.user.getTranslation(this.world, action.tooltip())).
- filter(text -> !text.isBlank()).
- collect(Collectors.toCollection(() -> new ArrayList<>(template.actions().size())));
+ filter(action -> action.tooltip() != null).
+ map(action -> this.user.getTranslation(this.world, action.tooltip())).
+ filter(text -> !text.isBlank()).
+ collect(Collectors.toCollection(() -> new ArrayList<>(template.actions().size())));
// Add tooltips.
if (!tooltips.isEmpty())
@@ -227,7 +227,7 @@ private PanelItem createPreviousButton(@NonNull ItemTemplateRecord template, Tem
if (template.description() != null)
{
builder.description(this.user.getTranslation(this.world, template.description(),
- "[number]", String.valueOf(previousPageIndex)));
+ "[number]", String.valueOf(previousPageIndex)));
}
// Add ClickHandler
@@ -252,10 +252,10 @@ private PanelItem createPreviousButton(@NonNull ItemTemplateRecord template, Tem
// Collect tooltips.
List tooltips = template.actions().stream().
- filter(action -> action.tooltip() != null).
- map(action -> this.user.getTranslation(this.world, action.tooltip())).
- filter(text -> !text.isBlank()).
- collect(Collectors.toCollection(() -> new ArrayList<>(template.actions().size())));
+ filter(action -> action.tooltip() != null).
+ map(action -> this.user.getTranslation(this.world, action.tooltip())).
+ filter(text -> !text.isBlank()).
+ collect(Collectors.toCollection(() -> new ArrayList<>(template.actions().size())));
// Add tooltips.
if (!tooltips.isEmpty())
@@ -314,9 +314,9 @@ private PanelItem createRandomButton(ItemTemplateRecord template, TemplatedPanel
}
-// ---------------------------------------------------------------------
-// Section: Other methods
-// ---------------------------------------------------------------------
+ // ---------------------------------------------------------------------
+ // Section: Other methods
+ // ---------------------------------------------------------------------
/**
@@ -355,8 +355,8 @@ private PanelItem createIslandButton(ItemTemplateRecord template, UUID ownerUUID
{
// Check owner for a specific icon
Material material = Material.matchMaterial(
- Utils.getPermissionValue(owner, "checkmeout.icon",
- this.addon.getSettings().getIslandIcon().name()));
+ Utils.getPermissionValue(owner, "checkmeout.icon",
+ this.addon.getSettings().getIslandIcon().name()));
if (material == null)
{
@@ -377,21 +377,21 @@ private PanelItem createIslandButton(ItemTemplateRecord template, UUID ownerUUID
if (template.title() != null)
{
builder.name(this.user.getTranslation(this.world, template.title(),
- "[name]", island.getName() != null ?
- island.getName() : owner.getName()));
+ "[name]", island.getName() != null ?
+ island.getName() : owner.getName()));
}
else
{
builder.name(this.user.getTranslation(reference + "name",
- "[name]", island.getName() != null ?
- island.getName() : owner.getName()));
+ "[name]", island.getName() != null ?
+ island.getName() : owner.getName()));
}
// Process Description of the button.
// Generate [owner] text.
String ownerText = this.user.getTranslationOrNothing(reference + "owner",
- "[player]", owner.getName());
+ "[player]", owner.getName());
// Generate [members] text
String memberText;
@@ -399,20 +399,20 @@ private PanelItem createIslandButton(ItemTemplateRecord template, UUID ownerUUID
if (island.getMemberSet().size() > 1)
{
StringBuilder memberBuilder = new StringBuilder(
- this.user.getTranslationOrNothing(reference + "members-title"));
+ this.user.getTranslationOrNothing(reference + "members-title"));
island.getMemberSet().stream().
- map(this.addon.getPlayers()::getName).
- forEach(user -> {
- if (memberBuilder.length() > 0)
- {
- memberBuilder.append("\n");
- }
+ map(this.addon.getPlayers()::getName).
+ forEach(user -> {
+ if (memberBuilder.length() > 0)
+ {
+ memberBuilder.append("\n");
+ }
- memberBuilder.append(
+ memberBuilder.append(
this.user.getTranslationOrNothing(reference + "member",
- "[player]", user));
- });
+ "[player]", user));
+ });
memberText = memberBuilder.toString();
}
@@ -436,22 +436,22 @@ private PanelItem createIslandButton(ItemTemplateRecord template, UUID ownerUUID
"[members]", memberText,
"[level]", levelText,
"[likes]", likesText).
- replaceAll("(?m)^[ \\t]*\\r?\\n", "").
- replaceAll("(?
{
- switch (action.actionType().toUpperCase())
- {
- case "WARP" -> {
- return island.getOwner() == null ||
- this.addon.getWarpAddon() == null ||
- !this.addon.getWarpAddon().getWarpSignsManager().hasWarp(this.world, island.getOwner());
- }
- case "VISIT" -> {
- return island.getOwner() == null ||
- this.addon.getVisitAddon() == null ||
- !this.addon.getVisitAddon().getAddonManager().preprocessTeleportation(this.user, island, true);
- }
- case "CHECK" -> {
- String gamemode = Utils.getGameMode(this.world);
+ return switch (action.actionType().toUpperCase())
+ {
+ case "WARP" -> island.getOwner() == null ||
+ this.addon.getWarpAddon() == null ||
+ !this.addon.getWarpAddon().getWarpSignsManager().hasWarp(this.world, island.getOwner());
- return gamemode.isBlank() || !this.user.hasPermission(gamemode + ".checkmeout.admin.check");
- }
- default -> {
- return false;
- }
- }
+ case "VISIT" -> island.getOwner() == null ||
+ this.addon.getVisitAddon() == null ||
+ !this.addon.getVisitAddon().getAddonManager().preprocessTeleportation(this.user, island, true);
+
+ case "CHECK" -> {
+ String gamemode = Utils.getGameMode(this.world);
+ yield gamemode.isBlank() || !this.user.hasPermission(gamemode + ".checkmeout.admin.check");
+ }
+ default -> false;
+ };
});
// Remove duplicated actions
@@ -510,25 +505,25 @@ private PanelItem createIslandButton(ItemTemplateRecord template, UUID ownerUUID
{
switch (action.actionType().toUpperCase())
{
- case "WARP" -> {
- this.user.closeInventory();
- this.addon.getWarpAddon().getWarpSignsManager().warpPlayer(this.world, this.user, island.getOwner());
- }
- case "VISIT" -> {
- // Use Visit command because of delay. Delay is implemented via command executing.
- String visitCommand = this.addon.getVisitAddon().getSettings().getPlayerMainCommand().split(" ")[0];
-
- this.addon.getPlugin().getIWM().getAddon(this.world).
- flatMap(GameModeAddon::getPlayerCommand).ifPresent(command ->
- {
- this.user.performCommand(command.getTopLabel() + " " + visitCommand + " " + island.getOwner());
- this.user.closeInventory();
- });
- }
- case "CHECK" -> {
+ case "WARP" -> {
+ this.user.closeInventory();
+ this.addon.getWarpAddon().getWarpSignsManager().warpPlayer(this.world, this.user, island.getOwner());
+ }
+ case "VISIT" -> {
+ // Use Visit command because of delay. Delay is implemented via command executing.
+ String visitCommand = this.addon.getVisitAddon().getSettings().getPlayerMainCommand().split(" ")[0];
+
+ this.addon.getPlugin().getIWM().getAddon(this.world).
+ flatMap(GameModeAddon::getPlayerCommand).ifPresent(command ->
+ {
+ this.user.performCommand(command.getTopLabel() + " " + visitCommand + " " + island.getOwner());
this.user.closeInventory();
- this.addon.getSubmissionsManager().warpPlayer(this.world, user, ownerUUID);
- }
+ });
+ }
+ case "CHECK" -> {
+ this.user.closeInventory();
+ this.addon.getSubmissionsManager().warpPlayer(this.world, user, ownerUUID);
+ }
}
}
}
@@ -538,10 +533,10 @@ private PanelItem createIslandButton(ItemTemplateRecord template, UUID ownerUUID
// Collect tooltips.
List tooltips = activeActions.stream().
- filter(action -> action.tooltip() != null).
- map(action -> this.user.getTranslation(this.world, action.tooltip())).
- filter(text -> !text.isBlank()).
- collect(Collectors.toCollection(() -> new ArrayList<>(template.actions().size())));
+ filter(action -> action.tooltip() != null).
+ map(action -> this.user.getTranslation(this.world, action.tooltip())).
+ filter(text -> !text.isBlank()).
+ collect(Collectors.toCollection(() -> new ArrayList<>(template.actions().size())));
// Add tooltips.
if (!tooltips.isEmpty())
@@ -571,8 +566,8 @@ private String generateLevelText(UUID ownerUUID)
int place = this.addon.getLevelAddon().getManager().getRank(this.world, ownerUUID);
levelText = this.user.getTranslationOrNothing(reference,
- "[level]", String.valueOf(level),
- "[place]", String.valueOf(place));
+ "[level]", String.valueOf(level),
+ "[place]", String.valueOf(place));
}
else
{
@@ -604,42 +599,42 @@ private String generateLikesText(Island island)
{
switch (likesAddon.getSettings().getMode())
{
- case LIKES -> {
- long likes = existingIslandLikes.getLikes();
- int place = likesAddon.getAddonManager().getIslandRankByLikes(this.world, existingIslandLikes);
+ case LIKES -> {
+ long likes = existingIslandLikes.getLikes();
+ int place = likesAddon.getAddonManager().getIslandRankByLikes(this.world, existingIslandLikes);
- likesText = this.user.getTranslationOrNothing(reference + "likes",
+ likesText = this.user.getTranslationOrNothing(reference + "likes",
"[likes]", String.valueOf(likes),
"[place]", String.valueOf(place));
- }
- case LIKES_DISLIKES -> {
- long likes = existingIslandLikes.getLikes();
- long dislikes = existingIslandLikes.getDislikes();
- long rank = existingIslandLikes.getRank();
+ }
+ case LIKES_DISLIKES -> {
+ long likes = existingIslandLikes.getLikes();
+ long dislikes = existingIslandLikes.getDislikes();
+ long rank = existingIslandLikes.getRank();
- int placeLikes = likesAddon.getAddonManager().getIslandRankByLikes(this.world, existingIslandLikes);
- int placeDislikes = likesAddon.getAddonManager().getIslandRankByDislikes(this.world, existingIslandLikes);
- int placeRank = likesAddon.getAddonManager().getIslandRankByRank(this.world, existingIslandLikes);
+ int placeLikes = likesAddon.getAddonManager().getIslandRankByLikes(this.world, existingIslandLikes);
+ int placeDislikes = likesAddon.getAddonManager().getIslandRankByDislikes(this.world, existingIslandLikes);
+ int placeRank = likesAddon.getAddonManager().getIslandRankByRank(this.world, existingIslandLikes);
- likesText = this.user.getTranslationOrNothing(reference + "likes_dislikes",
+ likesText = this.user.getTranslationOrNothing(reference + "likes_dislikes",
"[likes]", String.valueOf(likes),
"[dislikes]", String.valueOf(dislikes),
"[rank]", String.valueOf(rank),
"[place_likes]", String.valueOf(placeLikes),
"[place_dislikes]", String.valueOf(placeDislikes),
"[place_rank]", String.valueOf(placeRank));
- }
- case STARS -> {
- double stars = existingIslandLikes.getStarsValue();
- int place = likesAddon.getAddonManager().getIslandRankByStars(this.world, existingIslandLikes);
+ }
+ case STARS -> {
+ double stars = existingIslandLikes.getStarsValue();
+ int place = likesAddon.getAddonManager().getIslandRankByStars(this.world, existingIslandLikes);
- likesText = this.user.getTranslationOrNothing(reference + "stars",
+ likesText = this.user.getTranslationOrNothing(reference + "stars",
"[stars]", String.valueOf(stars),
"[place]", String.valueOf(place));
- }
- default -> {
- likesText = "";
- }
+ }
+ default -> {
+ likesText = "";
+ }
}
}
else
@@ -656,9 +651,9 @@ private String generateLikesText(Island island)
}
-// ---------------------------------------------------------------------
-// Section: Static methods
-// ---------------------------------------------------------------------
+ // ---------------------------------------------------------------------
+ // Section: Static methods
+ // ---------------------------------------------------------------------
/**
@@ -670,16 +665,16 @@ private String generateLikesText(Island island)
* @param user User who opens panel
*/
public static void openPanel(CheckMeOut addon,
- World world,
- User user)
+ World world,
+ User user)
{
new ViewSubmissionsPanel(addon, world, user).build();
}
-// ---------------------------------------------------------------------
-// Section: Variables
-// ---------------------------------------------------------------------
+ // ---------------------------------------------------------------------
+ // Section: Variables
+ // ---------------------------------------------------------------------
/**
diff --git a/src/main/resources/panels/view_panel.yml b/src/main/resources/panels/view_panel.yml
index ba0eb6a..a08b7db 100644
--- a/src/main/resources/panels/view_panel.yml
+++ b/src/main/resources/panels/view_panel.yml
@@ -19,7 +19,7 @@ view_panel:
8: island_button
3:
1:
- icon: TIPPED_ARROW:INSTANT_HEAL::::1
+ icon: tipped_arrow{CustomPotionColor:11546150}
title: checkmeout.gui.buttons.previous.name
description: checkmeout.gui.buttons.previous.description
data:
@@ -37,7 +37,7 @@ view_panel:
7: island_button
8: island_button
9:
- icon: TIPPED_ARROW:JUMP::::1
+ icon: tipped_arrow{CustomPotionColor:8439583}
title: checkmeout.gui.buttons.next.name
description: checkmeout.gui.buttons.next.description
data: