diff --git a/blockregen-plugin/src/main/java/nl/aurorion/blockregen/version/current/LatestNodeData.java b/blockregen-plugin/src/main/java/nl/aurorion/blockregen/version/current/LatestNodeData.java index 9f066865..5ce0f952 100644 --- a/blockregen-plugin/src/main/java/nl/aurorion/blockregen/version/current/LatestNodeData.java +++ b/blockregen-plugin/src/main/java/nl/aurorion/blockregen/version/current/LatestNodeData.java @@ -12,6 +12,7 @@ import org.bukkit.Axis; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.block.Skull; import org.bukkit.block.data.*; import org.bukkit.block.data.type.Stairs; @@ -42,7 +43,7 @@ public boolean check(Block block) { log.fine(String.format("Checking against data %s", this)); - if (this.skull != null) { + if (this.skull != null && block.getState() instanceof Skull) { try { String profileString = XSkull.of(block).getProfileString(); @@ -92,10 +93,8 @@ public boolean check(Block block) { public void load(Block block) { BlockData data = block.getBlockData(); - try { + if (block.getState() instanceof Skull) { this.skull = XSkull.of(block).getProfileString(); - } catch (InvalidProfileContainerException e) { - // not a skull } if (data instanceof Directional directional) { @@ -147,7 +146,7 @@ public void place(Block block) { block.setBlockData(blockData); - if (this.skull != null) { + if (this.skull != null && block.getState() instanceof Skull) { XSkull.of(block) .profile(Profileable.detect(this.skull)) .apply();