diff --git a/pom.xml b/pom.xml
index 0f8a672..3edab1a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@
v1.21-SNAPSHOT
1.21.11-R0.1-SNAPSHOT
- 3.14.1-SNAPSHOT
+ 3.15.0-SNAPSHOT
1.12.0
@@ -69,7 +69,7 @@
-LOCAL
- 2.24.1
+ 2.25.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 20f2094..4af0b59 100644
--- a/src/main/java/world/bentobox/level/Level.java
+++ b/src/main/java/world/bentobox/level/Level.java
@@ -515,4 +515,12 @@ public boolean isNexo() {
&& Bukkit.getPluginManager().isPluginEnabled("Nexo");
}
+ /**
+ * @return true if the CraftEngine plugin is hooked and not disabled in config
+ */
+ public boolean isCraftEngine() {
+ return !getSettings().getDisabledPluginHooks().contains("CraftEngine")
+ && getPlugin().getHooks().getHook("CraftEngine").isPresent();
+ }
+
}
diff --git a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java
index 0769a29..146540d 100644
--- a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java
+++ b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java
@@ -54,6 +54,7 @@
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.gui.page.ChestPage;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.database.objects.Island;
+import world.bentobox.bentobox.hooks.CraftEngineHook;
import world.bentobox.bentobox.hooks.ItemsAdderHook;
import world.bentobox.bentobox.hooks.OraxenHook;
import world.bentobox.bentobox.util.Pair;
@@ -562,11 +563,11 @@ private void processBlock(ChunkPair cp, int x, int y, int z, int globalX, int gl
// Create a Location object only when needed for more complex checks.
Location loc = null;
- // === Custom Block Hooks (ItemsAdder, Oraxen, Nexo) ===
+ // === Custom Block Hooks (ItemsAdder, Oraxen, Nexo, CraftEngine) ===
// These hooks can define custom blocks that override vanilla behavior.
// They must be checked first.
if (addon.isItemsAdder() || BentoBox.getInstance().getHooks().getHook("Oraxen").isPresent()
- || addon.isNexo()) {
+ || addon.isNexo() || addon.isCraftEngine()) {
loc = new Location(cp.world, globalX, y, globalZ);
String customBlockId = null;
if (addon.isItemsAdder()) {
@@ -584,6 +585,9 @@ private void processBlock(ChunkPair cp, int x, int y, int z, int globalX, int gl
customBlockId = "nexo:" + nexoMechanic.getItemID();
}
}
+ if (customBlockId == null && addon.isCraftEngine()) {
+ customBlockId = CraftEngineHook.getBlockId(loc);
+ }
if (customBlockId != null) {
// If a custom block is found, count it and stop further processing for this block.
diff --git a/src/main/java/world/bentobox/level/commands/IslandDonateCommand.java b/src/main/java/world/bentobox/level/commands/IslandDonateCommand.java
index 37e1f28..fa76d70 100644
--- a/src/main/java/world/bentobox/level/commands/IslandDonateCommand.java
+++ b/src/main/java/world/bentobox/level/commands/IslandDonateCommand.java
@@ -60,8 +60,8 @@ public boolean execute(User user, String label, List args) {
return false;
}
- // Handle "hand" subcommand
- if (!args.isEmpty() && "hand".equalsIgnoreCase(args.get(0))) {
+ // Handle "hand" subcommand (accepts English "hand" or the localized keyword)
+ if (!args.isEmpty() && isHandKeyword(user, args.get(0))) {
return handleHandDonation(user, island, args);
}
@@ -145,10 +145,11 @@ private void performHandDonation(User user, Island island, Material material, in
@Override
public Optional> tabComplete(User user, String alias, List args) {
String lastArg = !args.isEmpty() ? args.get(args.size() - 1) : "";
+ String handKeyword = user.getTranslation("island.donate.hand.keyword");
if (args.size() <= 1) {
- return Optional.of(Util.tabLimit(List.of("hand"), lastArg));
+ return Optional.of(Util.tabLimit(List.of(handKeyword), lastArg));
}
- if (args.size() == 2 && "hand".equalsIgnoreCase(args.get(0)) && user.isPlayer()) {
+ if (args.size() == 2 && isHandKeyword(user, args.get(0)) && user.isPlayer()) {
int held = user.getPlayer().getInventory().getItemInMainHand().getAmount();
if (held > 0) {
return Optional.of(Util.tabLimit(List.of(String.valueOf(held)), lastArg));
@@ -156,4 +157,9 @@ public Optional> tabComplete(User user, String alias, List
}
return Optional.of(List.of());
}
+
+ private boolean isHandKeyword(User user, String arg) {
+ String localized = user.getTranslation("island.donate.hand.keyword");
+ return "hand".equalsIgnoreCase(arg) || localized.equalsIgnoreCase(arg);
+ }
}
diff --git a/src/main/java/world/bentobox/level/commands/IslandValueCommand.java b/src/main/java/world/bentobox/level/commands/IslandValueCommand.java
index c4011f7..92141ff 100644
--- a/src/main/java/world/bentobox/level/commands/IslandValueCommand.java
+++ b/src/main/java/world/bentobox/level/commands/IslandValueCommand.java
@@ -60,7 +60,8 @@ public boolean execute(User user, String label, List args) {
}
String arg = args.get(0);
- if ("HAND".equalsIgnoreCase(arg)) {
+ String handKeyword = user.getTranslation("island.donate.hand.keyword");
+ if ("HAND".equalsIgnoreCase(arg) || handKeyword.equalsIgnoreCase(arg)) {
executeHandCommand(user);
return true;
}
@@ -158,7 +159,7 @@ public Optional> tabComplete(User user, String alias, List
List options = new ArrayList<>(
Arrays.stream(Material.values()).filter(Material::isBlock).map(Material::name).map(String::toLowerCase).toList());
- options.add("HAND");
+ options.add(user.getTranslation("island.donate.hand.keyword"));
return Optional.of(Util.tabLimit(options, lastArg));
}
diff --git a/src/main/java/world/bentobox/level/config/BlockConfig.java b/src/main/java/world/bentobox/level/config/BlockConfig.java
index 2c9793a..62350c3 100644
--- a/src/main/java/world/bentobox/level/config/BlockConfig.java
+++ b/src/main/java/world/bentobox/level/config/BlockConfig.java
@@ -22,6 +22,7 @@
import com.nexomc.nexo.api.NexoItems;
import world.bentobox.bentobox.BentoBox;
+import world.bentobox.bentobox.hooks.CraftEngineHook;
import world.bentobox.bentobox.hooks.ItemsAdderHook;
import world.bentobox.bentobox.hooks.OraxenHook;
import world.bentobox.level.Level;
@@ -111,7 +112,11 @@ private boolean isOther(String key) {
return NexoItems.exists(key.substring(5));
}
// Check ItemsAdder
- return addon.isItemsAdder() && ItemsAdderHook.isInRegistry(key);
+ if (addon.isItemsAdder() && ItemsAdderHook.isInRegistry(key)) {
+ return true;
+ }
+ // Check CraftEngine — block IDs are already namespaced (e.g. "mynamespace:my_block")
+ return addon.isCraftEngine() && CraftEngineHook.exists(key);
}
private boolean isSpawner(String key) {
diff --git a/src/main/resources/locales/cs.yml b/src/main/resources/locales/cs.yml
index 9e7e836..35ec78b 100644
--- a/src/main/resources/locales/cs.yml
+++ b/src/main/resources/locales/cs.yml
@@ -53,6 +53,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Darovat lze pouze bloky s nakonfigurovanou hodnotou úrovně."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -62,6 +63,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "ruka"
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."
diff --git a/src/main/resources/locales/de.yml b/src/main/resources/locales/de.yml
index 2adfc2f..b05dab9 100644
--- a/src/main/resources/locales/de.yml
+++ b/src/main/resources/locales/de.yml
@@ -54,6 +54,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Es können nur Blöcke mit einem konfigurierten Levelwert gespendet werden."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -63,6 +64,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "hand"
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."
diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml
index 08f3835..ff81550 100755
--- a/src/main/resources/locales/en-US.yml
+++ b/src/main/resources/locales/en-US.yml
@@ -68,6 +68,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "hand"
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."
diff --git a/src/main/resources/locales/es.yml b/src/main/resources/locales/es.yml
index 47f583c..0d93e3f 100644
--- a/src/main/resources/locales/es.yml
+++ b/src/main/resources/locales/es.yml
@@ -51,6 +51,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Solo se pueden donar bloques con un valor de nivel configurado."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -60,6 +61,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "mano"
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."
diff --git a/src/main/resources/locales/fr.yml b/src/main/resources/locales/fr.yml
index 27a1bd8..e1265d1 100644
--- a/src/main/resources/locales/fr.yml
+++ b/src/main/resources/locales/fr.yml
@@ -53,6 +53,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Seuls les blocs avec une valeur de niveau configurée peuvent être donnés."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -62,6 +63,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "main"
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."
diff --git a/src/main/resources/locales/hu.yml b/src/main/resources/locales/hu.yml
index afff3ef..7be400a 100644
--- a/src/main/resources/locales/hu.yml
+++ b/src/main/resources/locales/hu.yml
@@ -54,6 +54,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Csak konfigurált szintértékkel rendelkező blokkok adományozhatók."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -63,6 +64,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "kez"
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."
diff --git a/src/main/resources/locales/id.yml b/src/main/resources/locales/id.yml
index f0c6574..539666b 100644
--- a/src/main/resources/locales/id.yml
+++ b/src/main/resources/locales/id.yml
@@ -51,6 +51,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Hanya blok dengan nilai level yang dikonfigurasi yang dapat didonasikan."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -60,6 +61,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "tangan"
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."
diff --git a/src/main/resources/locales/ko.yml b/src/main/resources/locales/ko.yml
index 6cbb516..f846737 100644
--- a/src/main/resources/locales/ko.yml
+++ b/src/main/resources/locales/ko.yml
@@ -54,6 +54,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "설정된 레벨 값이 있는 블록만 기부할 수 있습니다."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -63,6 +64,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "hand"
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."
diff --git a/src/main/resources/locales/lv.yml b/src/main/resources/locales/lv.yml
index 5792196..7ec2474 100644
--- a/src/main/resources/locales/lv.yml
+++ b/src/main/resources/locales/lv.yml
@@ -54,6 +54,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Var ziedot tikai blokus ar konfigurētu līmeņa vērtību."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -63,6 +64,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: [points] points|Warning: donated items are|destroyed and cannot be returned!"
preview: "Points to add: [points]|These items will be destroyed!"
hand:
+ keyword: "roka"
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."
diff --git a/src/main/resources/locales/nl.yml b/src/main/resources/locales/nl.yml
index 6fe42e4..324b896 100644
--- a/src/main/resources/locales/nl.yml
+++ b/src/main/resources/locales/nl.yml
@@ -51,6 +51,7 @@ island:
no-permission: "You do not have permission to donate blocks on this island."
no-value: "That block has no level value."
invalid-amount: "Invalid amount. Use a positive number."
+ invalid-item: "Alleen blokken met een geconfigureerde niveauwaarde kunnen worden gedoneerd."
empty: "There are no valid blocks to donate."
cancelled: "Donation cancelled. Items returned."
success: "Donated [number] blocks for [points] points! These points are permanent."
@@ -60,6 +61,7 @@ island:
gui-info: "Donate blocks to your island|Currently donated: