Added the hasGravity method to Blocks. Adds BUKKIT-3832

This commit is contained in:
nitnelave
2013-02-14 22:40:38 +01:00
committed by GJ
parent 3d44b71712
commit d5caa86741

View File

@@ -952,4 +952,21 @@ public enum Material {
return false;
}
}
/**
* @return True if this material is affected by gravity.
*/
public boolean hasGravity() {
if (!isBlock()) {
return false;
}
switch (this) {
case SAND:
case GRAVEL:
case ANVIL:
return true;
default:
return false;
}
}
}