Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<mockito.version>5.11.0</mockito.version>
<mock-bukkit.version>v1.21-SNAPSHOT</mock-bukkit.version>
<!-- More visible way how to change dependency versions -->
<bentobox.version>3.13.0</bentobox.version>
<bentobox.version>3.15.0-SNAPSHOT</bentobox.version>
<items-adder.version>4.0.10</items-adder.version>
<nexo.version>1.8.0</nexo.version>
<craftengine.version>0.0.67</craftengine.version>
Expand Down Expand Up @@ -280,18 +280,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.momirealms</groupId>
<artifactId>craft-engine-core</artifactId>
<version>${craftengine.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.momirealms</groupId>
<artifactId>craft-engine-bukkit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
import org.bukkit.Material;
import org.bukkit.block.Block;

import net.momirealms.craftengine.bukkit.api.CraftEngineBlocks;
import net.momirealms.craftengine.core.block.CustomBlock;
import net.momirealms.craftengine.core.util.Key;
import world.bentobox.aoneblock.AOneBlock;
import world.bentobox.aoneblock.oneblocks.OneBlockCustomBlock;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.hooks.CraftEngineHook;

public class CraftEngineCustomBlock implements OneBlockCustomBlock {
private final String blockId;
Expand All @@ -22,8 +20,7 @@ public CraftEngineCustomBlock(String blockId) {
}

public static Optional<CraftEngineCustomBlock> fromId(String id) {
CustomBlock block = CraftEngineBlocks.byId(Key.of(id));
if (block != null) {
if (CraftEngineHook.exists(id)) {
return Optional.of(new CraftEngineCustomBlock(id));
}
return Optional.empty();
Expand All @@ -39,7 +36,10 @@ public static Optional<CraftEngineCustomBlock> fromMap(Map<?, ?> map) {
public void execute(AOneBlock addon, Block block) {
try {
block.setType(Material.AIR);
CraftEngineBlocks.place(block.getLocation(), Key.of(blockId), false);
if (!CraftEngineHook.placeBlock(block.getLocation(), blockId)) {
BentoBox.getInstance().logError("Could not place CraftEngine block " + blockId);
block.setType(Material.STONE);
}
} catch (Exception e) {
BentoBox.getInstance().logError("Could not place CraftEngine block " + blockId + ": " + e.getMessage());
block.setType(Material.STONE);
Expand Down
Loading