getCustomBlockItemStack(Level addon, String id) {
+ if (id == null) {
+ return Optional.empty();
+ }
+ if (id.startsWith("oraxen:") && BentoBox.getInstance().getHooks().getHook("Oraxen").isPresent()) {
+ return OraxenHook.getOptionalItemById(id.substring(7)).map(itemBuilder -> itemBuilder.build());
+ }
+ if (id.startsWith("nexo:") && addon.isNexo()) {
+ com.nexomc.nexo.items.ItemBuilder nexoBuilder = NexoItems.itemFromId(id.substring(5));
+ return nexoBuilder != null ? Optional.of(nexoBuilder.build()) : Optional.empty();
+ }
+ if (addon.isItemsAdder() && ItemsAdderHook.isInRegistry(id)) {
+ return ItemsAdderHook.getItemStack(id);
+ }
+ if (addon.isCraftEngine()) {
+ return CraftEngineHook.getItemStack(id);
+ }
+ return Optional.empty();
+ }
+
+ /**
+ * Returns the display name from an ItemStack's meta when present, otherwise falls back to
+ * {@link #prettifyObject(Object, User)} on the original key.
+ *
+ * Checks the legacy {@code display.Name} (used by Oraxen, Nexo, ItemsAdder) and then the
+ * modern {@code minecraft:item_name} component (used by CraftEngine and other 1.20.5+ items).
+ *
+ * @param itemStack the optional ItemStack (typically from a custom-block plugin)
+ * @param key the raw key used as a fallback for prettification
+ * @param user the user for translation lookups
+ * @return the human-readable display name
+ */
+ public static String getCustomBlockDisplayName(Optional itemStack, String key, User user) {
+ if (itemStack.isEmpty() || itemStack.get().getItemMeta() == null) {
+ return prettifyObject(key, user);
+ }
+ org.bukkit.inventory.meta.ItemMeta meta = itemStack.get().getItemMeta();
+ if (meta.hasDisplayName()) {
+ return meta.getDisplayName();
+ }
+ if (meta.hasItemName()) {
+ return meta.getItemName();
+ }
+ return prettifyObject(key, user);
+ }
+
public static String prettifyDescription(Object object, User user) {
if (object instanceof String key) {
String translation = user.getTranslationOrNothing(LEVEL_MATERIALS + key + DESCRIPTION);
diff --git a/src/main/resources/addon.yml b/src/main/resources/addon.yml
index e99df00..61e4c89 100755
--- a/src/main/resources/addon.yml
+++ b/src/main/resources/addon.yml
@@ -2,7 +2,7 @@ name: Level
main: world.bentobox.level.Level
version: ${version}${build.number}
icon: DIAMOND
-api-version: 3.14.0
+api-version: 3.16.0
authors: tastybento
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 11aacec..c101ad8 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -20,13 +20,22 @@ concurrent-island-calcs: 1
# If an island takes longer that this time to calculate, then the calculation will abort.
# Generally, calculation should only take a few seconds, so if this ever triggers then something is not right.
calculation-timeout: 5
-#
+#
# Zero island levels on new island or island reset
# If true, Level will calculate the starter island's level and remove it from any future level calculations.
# If false, the player's starter island blocks will count towards their level.
# This will reduce CPU if false.
zero-new-island-levels: true
-#
+#
+# Donations-only mode
+# If true, the island block scan is skipped entirely and the island level
+# is computed only from blocks donated via /island donate. This removes the
+# per-recalculation CPU cost of scanning the island.
+# The /island detail command is not registered in this mode, since there
+# are no scanned blocks to break down. /island level still works and reports
+# the level based on donated blocks.
+donations-only: false
+#
# Calculate island level on login
# This silently calculates the player's island level when they login
# This applies to all islands the player has on the server, e.g., BSkyBlock, AcidIsland
diff --git a/src/main/resources/locales/cs.yml b/src/main/resources/locales/cs.yml
index 35ec78b..7c1da5b 100644
--- a/src/main/resources/locales/cs.yml
+++ b/src/main/resources/locales/cs.yml
@@ -67,6 +67,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Tyto bloky budou ZNIČENY z tvého inventáře:"
+ confirm-line: "[number] x [material] = [points] bodů"
+ confirm-total: "Celkem: [points] trvalých bodů."
detail:
description: "zobrazit podrobnosti o blocích vašeho ostrova"
top:
diff --git a/src/main/resources/locales/de.yml b/src/main/resources/locales/de.yml
index b05dab9..75ebec9 100644
--- a/src/main/resources/locales/de.yml
+++ b/src/main/resources/locales/de.yml
@@ -68,6 +68,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Diese Blöcke werden aus deinem Inventar ZERSTÖRT:"
+ confirm-line: "[number] x [material] = [points] Punkte"
+ confirm-total: "Gesamt: [points] permanente Punkte."
detail:
description: "zeigt Details der Blöcke deiner Insel"
top:
diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml
index ff81550..e18ba4a 100755
--- a/src/main/resources/locales/en-US.yml
+++ b/src/main/resources/locales/en-US.yml
@@ -52,7 +52,7 @@ island:
in-progress: "Island level calculation is in progress..."
time-out: "The level calculation took too long. Please try again later."
donate:
- parameters: "[hand [amount]]"
+ parameters: "[hand [amount]] [inv]"
description: "donate blocks to permanently raise island level"
must-be-on-island: "You must be on your island to donate blocks."
no-permission: "You do not have permission to donate blocks on this island."
@@ -72,6 +72,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "About to DESTROY these blocks from your inventory:"
+ confirm-line: "[number] x [material] = [points] points"
+ confirm-total: "Total: [points] permanent points."
detail:
description: "shows detail of your island blocks"
top:
diff --git a/src/main/resources/locales/es.yml b/src/main/resources/locales/es.yml
index 0d93e3f..8571223 100644
--- a/src/main/resources/locales/es.yml
+++ b/src/main/resources/locales/es.yml
@@ -65,6 +65,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Estos bloques serán DESTRUIDOS de tu inventario:"
+ confirm-line: "[number] x [material] = [points] puntos"
+ confirm-total: "Total: [points] puntos permanentes."
detail:
description: "muestra el detalle de los bloques de tu isla"
top:
diff --git a/src/main/resources/locales/fr.yml b/src/main/resources/locales/fr.yml
index e1265d1..d939b6b 100644
--- a/src/main/resources/locales/fr.yml
+++ b/src/main/resources/locales/fr.yml
@@ -67,6 +67,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Ces blocs vont être DÉTRUITS de votre inventaire :"
+ confirm-line: "[number] x [material] = [points] points"
+ confirm-total: "Total : [points] points permanents."
top:
description: affiche le top 10
gui-title: "Top 10"
diff --git a/src/main/resources/locales/hu.yml b/src/main/resources/locales/hu.yml
index 7be400a..e9113e5 100644
--- a/src/main/resources/locales/hu.yml
+++ b/src/main/resources/locales/hu.yml
@@ -68,6 +68,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Ezeket a blokkokat MEGSEMMISÍTI a leltáradból:"
+ confirm-line: "[number] x [material] = [points] pont"
+ confirm-total: "Összesen: [points] állandó pont."
detail:
description: "megmutatja a szigeted blokkjainak részleteit"
top:
diff --git a/src/main/resources/locales/id.yml b/src/main/resources/locales/id.yml
index 539666b..ff360f0 100644
--- a/src/main/resources/locales/id.yml
+++ b/src/main/resources/locales/id.yml
@@ -65,6 +65,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Akan MENGHANCURKAN blok-blok ini dari inventaris Anda:"
+ confirm-line: "[number] x [material] = [points] poin"
+ confirm-total: "Total: [points] poin permanen."
top:
description: menunjukkan Sepuluh Besar
gui-title: " Sepuluh Besar"
diff --git a/src/main/resources/locales/ko.yml b/src/main/resources/locales/ko.yml
index f846737..073e26c 100644
--- a/src/main/resources/locales/ko.yml
+++ b/src/main/resources/locales/ko.yml
@@ -68,6 +68,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "인벤토리에서 다음 블록을 파괴합니다:"
+ confirm-line: "[number] x [material] = [points] 점"
+ confirm-total: "총: [points] 영구 점수."
detail:
description: "섬 블록의 세부 정보를 표시합니다"
top:
diff --git a/src/main/resources/locales/lv.yml b/src/main/resources/locales/lv.yml
index 7ec2474..a9f6feb 100644
--- a/src/main/resources/locales/lv.yml
+++ b/src/main/resources/locales/lv.yml
@@ -68,6 +68,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Šie bloki tiks IZNĪCINĀTI no tavas somas:"
+ confirm-line: "[number] x [material] = [points] punkti"
+ confirm-total: "Kopā: [points] pastāvīgi punkti."
detail:
description: "rāda tavas salas bloku detaļas"
top:
diff --git a/src/main/resources/locales/nl.yml b/src/main/resources/locales/nl.yml
index 324b896..9ddd410 100644
--- a/src/main/resources/locales/nl.yml
+++ b/src/main/resources/locales/nl.yml
@@ -65,6 +65,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Deze blokken worden VERNIETIGD uit je inventaris:"
+ confirm-line: "[number] x [material] = [points] punten"
+ confirm-total: "Totaal: [points] permanente punten."
top:
description: Toon de Top tien
gui-title: " Top tien"
diff --git a/src/main/resources/locales/pl.yml b/src/main/resources/locales/pl.yml
index da6ad80..67b6940 100644
--- a/src/main/resources/locales/pl.yml
+++ b/src/main/resources/locales/pl.yml
@@ -65,6 +65,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Te bloki zostaną ZNISZCZONE z twojego ekwipunku:"
+ confirm-line: "[number] x [material] = [points] punktów"
+ confirm-total: "Łącznie: [points] punktów stałych."
top:
description: pokauje Top 10 wysp
gui-title: "Top 10"
diff --git a/src/main/resources/locales/pt.yml b/src/main/resources/locales/pt.yml
index 57fbabe..ffb289c 100644
--- a/src/main/resources/locales/pt.yml
+++ b/src/main/resources/locales/pt.yml
@@ -68,6 +68,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Estes blocos serão DESTRUÍDOS do seu inventário:"
+ confirm-line: "[number] x [material] = [points] pontos"
+ confirm-total: "Total: [points] pontos permanentes."
detail:
description: "mostra os detalhes dos blocos da sua ilha"
top:
diff --git a/src/main/resources/locales/ru.yml b/src/main/resources/locales/ru.yml
index 2dc53da..e483b21 100644
--- a/src/main/resources/locales/ru.yml
+++ b/src/main/resources/locales/ru.yml
@@ -68,6 +68,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY [number] x [material] for [points] permanent points."
+ inv:
+ keyword: "inv"
+ confirm-header: "Эти блоки будут УНИЧТОЖЕНЫ из вашего инвентаря:"
+ confirm-line: "[number] x [material] = [points] очков"
+ confirm-total: "Всего: [points] постоянных очков."
detail:
description: показать информацию о блоках на вашем острове
top:
diff --git a/src/main/resources/locales/tr.yml b/src/main/resources/locales/tr.yml
index 689f9b8..2f8ae2b 100644
--- a/src/main/resources/locales/tr.yml
+++ b/src/main/resources/locales/tr.yml
@@ -72,6 +72,11 @@ island:
success: "Donated [number] x [material] for [points] permanent points!"
not-block: "You must be holding a placeable block to donate."
confirm-prompt: "About to DESTROY