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.
The class
DragonAIReturnToRoost
that was added by Mellohi as part of the lightning dragons PR was broken because any calls toEntityDragonBase#getHomePosition()
usedEntityCreature#getHomePosition()
, which usesEntityCreature#homePosition
.EntityDragonBase
uses/updates its ownhomePos
, notEntityCreature#homePosition
, so an override forgetHomePosition()
is necessary. Should fix #41 behavior for new and existing worlds.Also backports
HomePosition
forEntityDragonBase
because: a)homePos
would be redundant as the providedEntityCreature#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.