SPIGOT-4447: Clear error for people trying to set an item as a block

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2018-10-27 08:21:49 +11:00
parent 77d92cd515
commit b092fdb392

View file

@ -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();
}