avoid type juggling in conditions, always use explicit boolean conditions

This commit is contained in:
Dylan K. Taylor
2020-02-05 15:44:06 +00:00
parent b96bb7d824
commit e5a2cfb65f
17 changed files with 43 additions and 43 deletions

View File

@ -424,9 +424,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
new DoubleTag("", $pos->z)
]),
new ListTag("Motion", [
new DoubleTag("", $motion ? $motion->x : 0.0),
new DoubleTag("", $motion ? $motion->y : 0.0),
new DoubleTag("", $motion ? $motion->z : 0.0)
new DoubleTag("", $motion !== null ? $motion->x : 0.0),
new DoubleTag("", $motion !== null ? $motion->y : 0.0),
new DoubleTag("", $motion !== null ? $motion->z : 0.0)
]),
new ListTag("Rotation", [
new FloatTag("", $yaw),