diff options
author | md_5 <git@md-5.net> | 2018-10-27 08:21:49 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-10-27 08:21:49 +1100 |
commit | 5184216f2788fb1bd722dfe1ac53ee2f4c2f4177 (patch) | |
tree | caad19cc272adba0deb1a47e186cd55700ee1433 | |
parent | d6b57bd96328eb4d11db12b8b9b309700d2fc9e6 (diff) | |
download | craftbukkit-5184216f2788fb1bd722dfe1ac53ee2f4c2f4177.tar craftbukkit-5184216f2788fb1bd722dfe1ac53ee2f4c2f4177.tar.gz craftbukkit-5184216f2788fb1bd722dfe1ac53ee2f4c2f4177.tar.lz craftbukkit-5184216f2788fb1bd722dfe1ac53ee2f4c2f4177.tar.xz craftbukkit-5184216f2788fb1bd722dfe1ac53ee2f4c2f4177.zip |
SPIGOT-4447: Clear error for people trying to set an item as a block
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java index 13ac9bf2..f432abe1 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(); } |