Check whether worlds are equal before performing distance checks

Steps to reproduce:
1) Open treasure on one account
2) Go to Mavericks World on another account, tp to coords of treasure
This commit is contained in:
samczsun 2017-02-26 13:10:56 -05:00 committed by cnr
parent ff6a3e915e
commit 4d3301da56

View File

@ -325,7 +325,8 @@ public class TreasureLocation implements Listener
event.setTo(newTo);
}
}
else
else if (event.getFrom().getWorld().equals(_currentTreasure.getCenterBlock().getWorld()) &&
event.getTo().getWorld().equals(_currentTreasure.getCenterBlock().getWorld()))
{
Location fromLocation = event.getFrom();
Location toLocation = event.getTo();