Add hasCollision methods to various places

This commit is contained in:
Jake Potrebic
2021-11-04 11:50:35 -07:00
parent 450f5fe793
commit 1de93777a5
4 changed files with 40 additions and 0 deletions

View File

@@ -4877,6 +4877,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
// Paper end - item default attributes API
// Paper start - isCollidable API
/**
* Checks if this material is collidable.
*
* @return true if collidable
* @throws IllegalArgumentException if {@link #isBlock()} is false
*/
public boolean isCollidable() {
if (this.isBlock()) {
return this.asBlockType().hasCollision();
}
throw new IllegalArgumentException(this + " isn't a block type");
}
// Paper end - isCollidable API
/**
* Do not use for any reason.
*