mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
Added the hasGravity method to Blocks. Adds BUKKIT-3832
By: nitnelave <nitnelave1@gmail.com>
This commit is contained in:
@@ -952,4 +952,21 @@ public enum Material {
|
|||||||
return false;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user