Fixed arrow flight and spawning bugs, fixed critical trail, close #420

This commit is contained in:
Dylan K. Taylor
2017-04-26 18:55:48 +01:00
parent 2f87dfdcb0
commit caf4937222
4 changed files with 69 additions and 46 deletions

View File

@ -2620,8 +2620,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
new DoubleTag("", cos($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI))
]),
"Rotation" => new ListTag("Rotation", [
new FloatTag("", $this->yaw),
new FloatTag("", $this->pitch)
//yaw/pitch for arrows taken crosswise, not along the arrow shaft.
new FloatTag("", ($this->yaw > 180 ? 360 : 0) - $this->yaw), //arrow yaw must range from -180 to +180
new FloatTag("", -$this->pitch)
]),
"Fire" => new ShortTag("Fire", $this->isOnFire() ? 45 * 60 : 0)
]);