From 5184216f2788fb1bd722dfe1ac53ee2f4c2f4177 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 27 Oct 2018 08:21:49 +1100 Subject: [PATCH] SPIGOT-4447: Clear error for people trying to set an item as a block --- src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java index 13ac9bf279..f432abe19b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -124,6 +124,8 @@ public class CraftBlockState implements BlockState { public void setType(final Material type) { Preconditions.checkArgument(type != null, "Material cannot be null"); + Preconditions.checkArgument(type.isBlock(), "Material must be a block!"); + if (this.getType() != type) { this.data = CraftMagicNumbers.getBlock(type).getBlockData(); }