mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-09-18 21:54:50 +00:00
Add Preconditions check in CraftBlock#setType() to verify Material is block
This commit is contained in:
parent
76fd7c056d
commit
6ab95355b2
1 changed files with 1 additions and 0 deletions
|
@ -174,6 +174,7 @@ public class CraftBlock implements Block {
|
|||
@Override
|
||||
public void setType(Material type, boolean applyPhysics) {
|
||||
Preconditions.checkArgument(type != null, "Material cannot be null");
|
||||
Preconditions.checkArgument(type.isBlock(), "Material must be a block type. Given %s, which is not a block", type.getKey());
|
||||
setBlockData(type.createBlockData(), applyPhysics);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue