Rebirth-of-the-Night / Ice_and_Fire

Minecraft mystical mod
7 stars 7 forks source link

Fix ReturnToRoost dragon AI #45

Closed jchung01 closed 1 year ago

jchung01 commented 1 year ago

The class DragonAIReturnToRoost that was added by Mellohi as part of the lightning dragons PR was broken because any calls to EntityDragonBase#getHomePosition() used EntityCreature#getHomePosition(), which uses EntityCreature#homePosition. EntityDragonBase uses/updates its own homePos, not EntityCreature#homePosition, so an override for getHomePosition() is necessary. Should fix #41 behavior for new and existing worlds.

Also backports HomePosition for EntityDragonBase because: a) homePos would be redundant as the provided EntityCreature#homePosition should be used b) HomePosition keeps track of the dragon's home dimension to handle the edge case of the dragon being in a different dimension.

sainagh commented 1 year ago

Playtested it for a few days, and can confirm it works.