diff --git a/pom.xml b/pom.xml
index 3edab1a..8d7473b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
-LOCAL
- 2.25.0
+ 2.26.0
BentoBoxWorld_Level
bentobox-world
https://sonarcloud.io
diff --git a/src/main/java/world/bentobox/level/Level.java b/src/main/java/world/bentobox/level/Level.java
index 4af0b59..da58a37 100644
--- a/src/main/java/world/bentobox/level/Level.java
+++ b/src/main/java/world/bentobox/level/Level.java
@@ -102,6 +102,7 @@ public void onLoad() {
this.saveResource("panels/top_panel.yml", false);
this.saveResource("panels/detail_panel.yml", false);
this.saveResource("panels/value_panel.yml", false);
+ this.saveResource("panels/donation_panel.yml", false);
}
private boolean loadSettings() {
diff --git a/src/main/java/world/bentobox/level/panels/DonationPanel.java b/src/main/java/world/bentobox/level/panels/DonationPanel.java
index 4dbf373..ccb5ae7 100644
--- a/src/main/java/world/bentobox/level/panels/DonationPanel.java
+++ b/src/main/java/world/bentobox/level/panels/DonationPanel.java
@@ -1,9 +1,12 @@
package world.bentobox.level.panels;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@@ -23,6 +26,8 @@
import net.kyori.adventure.text.format.TextDecoration;
import world.bentobox.bentobox.api.localization.TextVariables;
+import world.bentobox.bentobox.api.panels.reader.PanelTemplateRecord;
+import world.bentobox.bentobox.api.panels.reader.TemplateReader;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.util.Util;
@@ -37,30 +42,15 @@
*/
public class DonationPanel implements Listener {
- private static final int SIZE = 36; // 4 rows
- private static final String TITLE_REF = "island.donate.gui-title";
private static final String POINTS_PLACEHOLDER = "[points]";
- // Slot layout
- private static final int INFO_SLOT = 4;
- private static final int CANCEL_SLOT = 28;
- private static final int PREVIEW_SLOT = 31;
- private static final int CONFIRM_SLOT = 34;
-
- // Donation slots: rows 2 and 3, columns 2-8 (slots 10-16, 19-25)
- private static final int[] DONATION_SLOTS = {
- 10, 11, 12, 13, 14, 15, 16,
- 19, 20, 21, 22, 23, 24, 25
- };
-
- // Border slots: everything else
- private static final Material BORDER_MATERIAL = Material.BLACK_STAINED_GLASS_PANE;
-
private final Level addon;
private final World world;
private final User user;
private final Island island;
private final Inventory inventory;
+ private final DonationPanelLayout layout;
+ private final Set donationSlotSet;
private boolean confirmed = false;
private DonationPanel(Level addon, World world, User user, Island island) {
@@ -68,47 +58,73 @@ private DonationPanel(Level addon, World world, User user, Island island) {
this.world = world;
this.user = user;
this.island = island;
+ this.layout = loadLayout(addon);
+ this.donationSlotSet = HashSet.newHashSet(layout.donationSlots.length);
+ for (int s : layout.donationSlots) {
+ donationSlotSet.add(s);
+ }
- // Create the inventory
+ // Create the inventory — use the title from the template (falls back to the
+ // default translation key when no template title is set).
Component title = removeDefaultItalic(
- Util.parseMiniMessageOrLegacy(user.getTranslation(TITLE_REF)));
- this.inventory = Bukkit.createInventory(null, SIZE, title);
-
- // Fill borders
- ItemStack border = createNamedItem(BORDER_MATERIAL, " ");
- for (int i = 0; i < SIZE; i++) {
- inventory.setItem(i, border);
+ Util.parseMiniMessageOrLegacy(user.getTranslation(layout.panelTitle)));
+ this.inventory = Bukkit.createInventory(null, layout.size, title);
+
+ // Fill borders if a border material is configured
+ if (layout.borderMaterial != null && layout.borderMaterial != Material.AIR) {
+ ItemStack border = createNamedItem(layout.borderMaterial, " ");
+ for (int i = 0; i < layout.size; i++) {
+ if (!donationSlotSet.contains(i)
+ && i != layout.infoSlot && i != layout.cancelSlot
+ && i != layout.previewSlot && i != layout.confirmSlot
+ && !layout.decorativeItems.containsKey(i)) {
+ inventory.setItem(i, border);
+ }
+ }
}
- // Clear donation slots
- for (int slot : DONATION_SLOTS) {
- inventory.setItem(slot, null);
- }
+ // Place decorative items from the template (non-button, non-border entries)
+ layout.decorativeItems.forEach(inventory::setItem);
// Info pane
long currentDonated = addon.getManager().getDonatedPoints(island);
- ItemStack info = createNamedItem(Material.BOOK,
+ ItemStack info = createNamedItem(layout.infoMaterial,
user.getTranslation("island.donate.gui-info",
POINTS_PLACEHOLDER, Utils.formatNumber(user, currentDonated)));
- inventory.setItem(INFO_SLOT, info);
+ inventory.setItem(layout.infoSlot, info);
// Cancel button
- ItemStack cancel = createNamedItem(Material.RED_STAINED_GLASS_PANE,
- user.getTranslation("island.donate.cancel"));
- inventory.setItem(CANCEL_SLOT, cancel);
+ String cancelKey = layout.cancelTitleOverride != null
+ ? layout.cancelTitleOverride : "island.donate.cancel";
+ ItemStack cancel = createNamedItem(layout.cancelMaterial,
+ user.getTranslation(cancelKey));
+ inventory.setItem(layout.cancelSlot, cancel);
// Preview pane (starts at 0)
updatePreview();
// Confirm button
- ItemStack confirm = createNamedItem(Material.LIME_STAINED_GLASS_PANE,
- user.getTranslation("island.donate.confirm"));
- inventory.setItem(CONFIRM_SLOT, confirm);
+ String confirmKey = layout.confirmTitleOverride != null
+ ? layout.confirmTitleOverride : "island.donate.confirm";
+ ItemStack confirm = createNamedItem(layout.confirmMaterial,
+ user.getTranslation(confirmKey));
+ inventory.setItem(layout.confirmSlot, confirm);
// Register listener
Bukkit.getPluginManager().registerEvents(this, addon.getPlugin());
}
+ private static DonationPanelLayout loadLayout(Level addon) {
+ try {
+ File panelFolder = new File(addon.getDataFolder(), "panels");
+ PanelTemplateRecord template = TemplateReader.readTemplatePanel("donation_panel", panelFolder);
+ return DonationPanelLayout.fromTemplate(template);
+ } catch (Exception e) {
+ addon.logError("Could not load donation_panel template, using default layout.");
+ return DonationPanelLayout.defaults();
+ }
+ }
+
private void build() {
user.getPlayer().openInventory(inventory);
}
@@ -118,7 +134,7 @@ private void build() {
*/
private long calculateDonationValue() {
long total = 0;
- for (int slot : DONATION_SLOTS) {
+ for (int slot : layout.donationSlots) {
ItemStack item = inventory.getItem(slot);
if (item != null && !item.getType().isAir()) {
Integer value = addon.getBlockConfig().getValue(world, item.getType());
@@ -135,20 +151,17 @@ private long calculateDonationValue() {
*/
private void updatePreview() {
long points = calculateDonationValue();
- ItemStack preview = createNamedItem(Material.EXPERIENCE_BOTTLE,
+ ItemStack preview = createNamedItem(layout.previewMaterial,
user.getTranslation("island.donate.preview",
POINTS_PLACEHOLDER, Utils.formatNumber(user, points)));
- inventory.setItem(PREVIEW_SLOT, preview);
+ inventory.setItem(layout.previewSlot, preview);
}
/**
* Check if a slot is a donation slot.
*/
private boolean isDonationSlot(int slot) {
- for (int s : DONATION_SLOTS) {
- if (s == slot) return true;
- }
- return false;
+ return donationSlotSet.contains(slot);
}
/**
@@ -160,7 +173,7 @@ private void processDonation() {
long totalPoints = 0;
Player player = user.getPlayer();
- for (int slot : DONATION_SLOTS) {
+ for (int slot : layout.donationSlots) {
ItemStack item = inventory.getItem(slot);
if (item != null && !item.getType().isAir()) {
Material mat = item.getType();
@@ -199,7 +212,7 @@ private void processDonation() {
*/
private void returnItems() {
Player player = user.getPlayer();
- for (int slot : DONATION_SLOTS) {
+ for (int slot : layout.donationSlots) {
ItemStack item = inventory.getItem(slot);
if (item != null && !item.getType().isAir()) {
Map overflow = player.getInventory().addItem(item);
@@ -224,15 +237,15 @@ public void onInventoryClick(InventoryClickEvent event) {
int slot = event.getRawSlot();
- if (slot >= SIZE) {
+ if (slot >= layout.size) {
handlePlayerInventoryClick(event);
return;
}
- if (slot == CANCEL_SLOT) {
+ if (slot == layout.cancelSlot) {
handleCancel(event, player);
return;
}
- if (slot == CONFIRM_SLOT) {
+ if (slot == layout.confirmSlot) {
handleConfirm(event, player);
return;
}
@@ -268,8 +281,8 @@ private void handlePlayerInventoryClick(InventoryClickEvent event) {
*/
private ItemStack distributeIntoDonationSlots(ItemStack remaining) {
int idx = 0;
- while (idx < DONATION_SLOTS.length && remaining.getAmount() > 0) {
- int ds = DONATION_SLOTS[idx];
+ while (idx < layout.donationSlots.length && remaining.getAmount() > 0) {
+ int ds = layout.donationSlots[idx];
ItemStack existing = inventory.getItem(ds);
if (existing == null || existing.getType().isAir()) {
inventory.setItem(ds, remaining.clone());
@@ -336,7 +349,7 @@ public void onInventoryDrag(InventoryDragEvent event) {
if (!event.getInventory().equals(inventory)) return;
// Only allow drags into donation slots
for (int slot : event.getRawSlots()) {
- if (slot < SIZE && !isDonationSlot(slot)) {
+ if (slot < layout.size && !isDonationSlot(slot)) {
event.setCancelled(true);
return;
}
diff --git a/src/main/java/world/bentobox/level/panels/DonationPanelLayout.java b/src/main/java/world/bentobox/level/panels/DonationPanelLayout.java
new file mode 100644
index 0000000..6ea336d
--- /dev/null
+++ b/src/main/java/world/bentobox/level/panels/DonationPanelLayout.java
@@ -0,0 +1,248 @@
+package world.bentobox.level.panels;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
+
+import world.bentobox.bentobox.api.panels.reader.ItemTemplateRecord;
+import world.bentobox.bentobox.api.panels.reader.PanelTemplateRecord;
+
+/**
+ * Resolved slot layout for the donation panel. Built from a
+ * {@link PanelTemplateRecord} (loaded from {@code panels/donation_panel.yml}),
+ * with a hardcoded fallback used when the template is missing or malformed.
+ */
+final class DonationPanelLayout {
+
+ static final int DEFAULT_SIZE = 36;
+ static final int DEFAULT_INFO_SLOT = 4;
+ static final int DEFAULT_CANCEL_SLOT = 28;
+ static final int DEFAULT_PREVIEW_SLOT = 31;
+ static final int DEFAULT_CONFIRM_SLOT = 34;
+ static final Material DEFAULT_BORDER_MATERIAL = Material.BLACK_STAINED_GLASS_PANE;
+ static final String DEFAULT_TITLE_REF = "island.donate.gui-title";
+ static final int[] DEFAULT_DONATION_SLOTS = {
+ 10, 11, 12, 13, 14, 15, 16,
+ 19, 20, 21, 22, 23, 24, 25
+ };
+
+ private static final String DATA_TYPE = "type";
+ private static final String TYPE_INFO = "INFO";
+ private static final String TYPE_CANCEL = "CANCEL";
+ private static final String TYPE_PREVIEW = "PREVIEW";
+ private static final String TYPE_CONFIRM = "CONFIRM";
+
+ final int size;
+ final int infoSlot;
+ final int cancelSlot;
+ final int previewSlot;
+ final int confirmSlot;
+ final int[] donationSlots;
+ final Material borderMaterial;
+ final Material infoMaterial;
+ final Material cancelMaterial;
+ final Material previewMaterial;
+ final Material confirmMaterial;
+ final String cancelTitleOverride;
+ final String confirmTitleOverride;
+ /** Translation key (or literal text) for the inventory title. */
+ final String panelTitle;
+ /**
+ * Decorative items keyed by absolute slot index. These are template entries
+ * whose {@code data.type} is absent or unrecognised. They reserve their slot
+ * (keeping donated blocks out) and should be placed visibly in the inventory.
+ */
+ final Map decorativeItems;
+
+ private DonationPanelLayout(Builder b) {
+ this.size = b.size;
+ this.infoSlot = b.infoSlot;
+ this.cancelSlot = b.cancelSlot;
+ this.previewSlot = b.previewSlot;
+ this.confirmSlot = b.confirmSlot;
+ this.donationSlots = b.donationSlots;
+ this.borderMaterial = b.borderMaterial;
+ this.infoMaterial = b.infoMaterial;
+ this.cancelMaterial = b.cancelMaterial;
+ this.previewMaterial = b.previewMaterial;
+ this.confirmMaterial = b.confirmMaterial;
+ this.cancelTitleOverride = b.cancelTitleOverride;
+ this.confirmTitleOverride = b.confirmTitleOverride;
+ this.panelTitle = b.panelTitle;
+ this.decorativeItems = Collections.unmodifiableMap(b.decorativeItems);
+ }
+
+ /**
+ * The hardcoded 4-row layout used before the template was added, and as a
+ * fallback when the template cannot be parsed.
+ */
+ static DonationPanelLayout defaults() {
+ Builder b = new Builder();
+ b.size = DEFAULT_SIZE;
+ b.infoSlot = DEFAULT_INFO_SLOT;
+ b.cancelSlot = DEFAULT_CANCEL_SLOT;
+ b.previewSlot = DEFAULT_PREVIEW_SLOT;
+ b.confirmSlot = DEFAULT_CONFIRM_SLOT;
+ b.donationSlots = DEFAULT_DONATION_SLOTS.clone();
+ b.borderMaterial = DEFAULT_BORDER_MATERIAL;
+ return new DonationPanelLayout(b);
+ }
+
+ /**
+ * Resolve a layout from a panel template. Returns {@link #defaults()} if the
+ * template is null or doesn't define all four named buttons (INFO, CANCEL,
+ * PREVIEW, CONFIRM) — partial layouts would be unusable.
+ */
+ static DonationPanelLayout fromTemplate(PanelTemplateRecord template) {
+ if (template == null) {
+ return defaults();
+ }
+ int rowCount = computeRowCount(template);
+ if (rowCount < 1) {
+ return defaults();
+ }
+
+ Builder b = new Builder();
+ ItemTemplateRecord[][] content = template.content();
+ for (int r = 0; r < rowCount; r++) {
+ for (int c = 0; c < 9; c++) {
+ processCell(b, r * 9 + c, content[r][c]);
+ }
+ }
+
+ if (b.infoSlot < 0 || b.cancelSlot < 0 || b.previewSlot < 0 || b.confirmSlot < 0) {
+ // A required button is missing - fall back rather than render a broken UI.
+ return defaults();
+ }
+
+ Material borderMat = materialOf(template.border() == null ? null : template.border().icon());
+ boolean hasBorder = borderMat != null && borderMat != Material.AIR;
+ b.borderMaterial = hasBorder ? borderMat : Material.AIR;
+ b.size = rowCount * 9;
+ b.donationSlots = computeDonationSlots(rowCount, b.occupied, hasBorder);
+ b.panelTitle = (template.title() != null && !template.title().isBlank())
+ ? template.title()
+ : DEFAULT_TITLE_REF;
+ return new DonationPanelLayout(b);
+ }
+
+ /**
+ * Apply a single template cell to the builder: reserve its slot, then either
+ * record it as a named button, decorative item, or unrecognised entry.
+ */
+ private static void processCell(Builder b, int slot, ItemTemplateRecord rec) {
+ if (rec == null) {
+ return;
+ }
+ // Any non-null template entry reserves the slot, even if its data.type is
+ // unknown - admins shouldn't see decorative items overwritten by donated blocks.
+ b.occupied.add(slot);
+ Object typeObj = rec.dataMap().get(DATA_TYPE);
+ if (typeObj == null) {
+ addDecorative(b, slot, rec);
+ return;
+ }
+ switch (String.valueOf(typeObj)) {
+ case TYPE_INFO -> {
+ b.infoSlot = slot;
+ Material m = materialOf(rec.icon());
+ if (m != null) b.infoMaterial = m;
+ }
+ case TYPE_CANCEL -> {
+ b.cancelSlot = slot;
+ Material m = materialOf(rec.icon());
+ if (m != null) b.cancelMaterial = m;
+ b.cancelTitleOverride = rec.title();
+ }
+ case TYPE_PREVIEW -> {
+ b.previewSlot = slot;
+ Material m = materialOf(rec.icon());
+ if (m != null) b.previewMaterial = m;
+ }
+ case TYPE_CONFIRM -> {
+ b.confirmSlot = slot;
+ Material m = materialOf(rec.icon());
+ if (m != null) b.confirmMaterial = m;
+ b.confirmTitleOverride = rec.title();
+ }
+ default -> addDecorative(b, slot, rec);
+ }
+ }
+
+ private static void addDecorative(Builder b, int slot, ItemTemplateRecord rec) {
+ ItemStack icon = rec.icon();
+ if (icon != null) {
+ b.decorativeItems.put(slot, icon.clone());
+ }
+ }
+
+ private static int computeRowCount(PanelTemplateRecord template) {
+ int max = 0;
+ boolean[] forced = template.forcedRows();
+ if (forced != null) {
+ for (int i = 0; i < forced.length; i++) {
+ if (forced[i]) max = Math.max(max, i + 1);
+ }
+ }
+ ItemTemplateRecord[][] content = template.content();
+ for (int r = 0; r < content.length; r++) {
+ for (int c = 0; c < content[r].length; c++) {
+ if (content[r][c] != null) {
+ max = Math.max(max, r + 1);
+ break;
+ }
+ }
+ }
+ return Math.min(max, 6);
+ }
+
+ private static int[] computeDonationSlots(int rowCount, Set reserved, boolean hasBorder) {
+ int[] tmp = new int[rowCount * 9];
+ int n = 0;
+ for (int r = 0; r < rowCount; r++) {
+ for (int c = 0; c < 9; c++) {
+ int slot = r * 9 + c;
+ boolean borderEdge = hasBorder
+ && (r == 0 || r == rowCount - 1 || c == 0 || c == 8);
+ if (!reserved.contains(slot) && !borderEdge) {
+ tmp[n++] = slot;
+ }
+ }
+ }
+ return Arrays.copyOf(tmp, n);
+ }
+
+ private static Material materialOf(ItemStack icon) {
+ return icon == null ? null : icon.getType();
+ }
+
+ /**
+ * Mutable accumulator used while resolving a template into a layout. Keeps
+ * the resolution code free of long parameter lists and cross-method state
+ * juggling.
+ */
+ private static final class Builder {
+ int size = DEFAULT_SIZE;
+ int infoSlot = -1;
+ int cancelSlot = -1;
+ int previewSlot = -1;
+ int confirmSlot = -1;
+ int[] donationSlots = DEFAULT_DONATION_SLOTS.clone();
+ Material borderMaterial = DEFAULT_BORDER_MATERIAL;
+ Material infoMaterial = Material.BOOK;
+ Material cancelMaterial = Material.RED_STAINED_GLASS_PANE;
+ Material previewMaterial = Material.EXPERIENCE_BOTTLE;
+ Material confirmMaterial = Material.LIME_STAINED_GLASS_PANE;
+ String cancelTitleOverride;
+ String confirmTitleOverride;
+ String panelTitle = DEFAULT_TITLE_REF;
+ final Set occupied = new LinkedHashSet<>();
+ final Map decorativeItems = new LinkedHashMap<>();
+ }
+}
diff --git a/src/main/resources/panels/donation_panel.yml b/src/main/resources/panels/donation_panel.yml
new file mode 100644
index 0000000..9d425ba
--- /dev/null
+++ b/src/main/resources/panels/donation_panel.yml
@@ -0,0 +1,35 @@
+donation_panel:
+ title: island.donate.gui-title
+ type: INVENTORY
+ border:
+ icon: BLACK_STAINED_GLASS_PANE
+ title: " "
+ # Row numbers that must always be shown (1-6). List all rows you want visible.
+ # The donation grid is every cell that is neither a border slot nor one of the
+ # four named buttons below.
+ force-shown: [1,2,3,4]
+ content:
+ 1:
+ 5:
+ icon: BOOK
+ data:
+ # INFO pane: shows total points already donated.
+ type: INFO
+ 4:
+ 2:
+ icon: RED_STAINED_GLASS_PANE
+ title: island.donate.cancel
+ data:
+ # CANCEL button: returns items and closes the panel.
+ type: CANCEL
+ 5:
+ icon: EXPERIENCE_BOTTLE
+ data:
+ # PREVIEW pane: shows pending point value of items in the grid.
+ type: PREVIEW
+ 8:
+ icon: LIME_STAINED_GLASS_PANE
+ title: island.donate.confirm
+ data:
+ # CONFIRM button: destroys items and credits points.
+ type: CONFIRM
diff --git a/src/test/java/world/bentobox/level/CommonTestSetup.java b/src/test/java/world/bentobox/level/CommonTestSetup.java
index 876424a..2ec1835 100644
--- a/src/test/java/world/bentobox/level/CommonTestSetup.java
+++ b/src/test/java/world/bentobox/level/CommonTestSetup.java
@@ -137,7 +137,7 @@ public abstract class CommonTestSetup {
@BeforeEach
- public void setUp() throws Exception {
+ protected void setUp() throws Exception {
MockitoAnnotations.openMocks(this);
// Processes the @Mock annotations and initializes the field
closeable = MockitoAnnotations.openMocks(this);
@@ -266,7 +266,7 @@ public void setUp() throws Exception {
* @throws Exception
*/
@AfterEach
- public void tearDown() throws Exception {
+ protected void tearDown() throws Exception {
// IMPORTANT: Explicitly close the mock to prevent leakage
mockedBukkit.closeOnDemand();
mockedUtil.closeOnDemand();
diff --git a/src/test/java/world/bentobox/level/LevelTest.java b/src/test/java/world/bentobox/level/LevelTest.java
index c436e27..288fec9 100644
--- a/src/test/java/world/bentobox/level/LevelTest.java
+++ b/src/test/java/world/bentobox/level/LevelTest.java
@@ -58,7 +58,7 @@
* @author tastybento
*
*/
-public class LevelTest extends CommonTestSetup {
+class LevelTest extends CommonTestSetup {
private static File jFile;
@Mock
@@ -91,7 +91,7 @@ public class LevelTest extends CommonTestSetup {
private MockedStatic itemsAdderMock;
@BeforeAll
- public static void beforeClass() throws IOException {
+ protected static void beforeClass() throws IOException {
// Make the addon jar
jFile = new File("addon.jar");
// Copy over config file from src folder
@@ -121,7 +121,7 @@ public static void beforeClass() throws IOException {
*/
@Override
@BeforeEach
- public void setUp() throws Exception {
+ protected void setUp() throws Exception {
super.setUp();
when(plugin.getHooks()).thenReturn(hm);
@@ -198,13 +198,13 @@ public void setUp() throws Exception {
*/
@Override
@AfterEach
- public void tearDown() throws Exception {
+ protected void tearDown() throws Exception {
super.tearDown();
deleteAll(new File("database"));
}
@AfterAll
- public static void cleanUp() throws Exception {
+ protected static void cleanUp() throws Exception {
new File("addon.jar").delete();
new File("config.yml").delete();
new File("blockconfig.yml").delete();
@@ -215,7 +215,7 @@ public static void cleanUp() throws Exception {
* Test method for {@link world.bentobox.level.Level#allLoaded()
*/
@Test
- public void testAllLoaded() {
+ void testAllLoaded() {
mockedBukkit.when(() -> Bukkit.getWorld("acidisland_world")).thenReturn(null);
addon.allLoaded();
verify(plugin).log("[Level] Level hooking into BSkyBlock");
@@ -241,7 +241,7 @@ public void testAllLoaded() {
* Test method for {@link world.bentobox.level.Level#getSettings()}.
*/
@Test
- public void testGetSettings() {
+ void testGetSettings() {
addon.onEnable();
ConfigSettings s = addon.getSettings();
assertEquals(100, s.getLevelCost());
diff --git a/src/test/java/world/bentobox/level/LevelsManagerTest.java b/src/test/java/world/bentobox/level/LevelsManagerTest.java
index c88886c..91d841d 100644
--- a/src/test/java/world/bentobox/level/LevelsManagerTest.java
+++ b/src/test/java/world/bentobox/level/LevelsManagerTest.java
@@ -1,8 +1,8 @@
package world.bentobox.level;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
@@ -23,9 +23,9 @@
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
-import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockedStatic;
@@ -40,7 +40,6 @@
import world.bentobox.bentobox.database.DatabaseSetup;
import world.bentobox.bentobox.database.DatabaseSetup.DatabaseType;
import world.bentobox.bentobox.database.objects.Island;
-import world.bentobox.bentobox.managers.IslandWorldManager;
import world.bentobox.bentobox.managers.PlayersManager;
import world.bentobox.level.calculators.Pipeliner;
import world.bentobox.level.calculators.Results;
@@ -52,7 +51,7 @@
* @author tastybento
*
*/
-public class LevelsManagerTest extends CommonTestSetup {
+class LevelsManagerTest extends CommonTestSetup {
@Mock
private AbstractDatabaseHandler