mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-03 13:36:44 +01:00
SPIGOT-4447: Clear error for people trying to set an item as a block
This commit is contained in:
parent
d6b57bd963
commit
5184216f27
1 changed files with 2 additions and 0 deletions
|
@ -124,6 +124,8 @@ public class CraftBlockState implements BlockState {
|
||||||
|
|
||||||
public void setType(final Material type) {
|
public void setType(final Material type) {
|
||||||
Preconditions.checkArgument(type != null, "Material cannot be null");
|
Preconditions.checkArgument(type != null, "Material cannot be null");
|
||||||
|
Preconditions.checkArgument(type.isBlock(), "Material must be a block!");
|
||||||
|
|
||||||
if (this.getType() != type) {
|
if (this.getType() != type) {
|
||||||
this.data = CraftMagicNumbers.getBlock(type).getBlockData();
|
this.data = CraftMagicNumbers.getBlock(type).getBlockData();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue