Additional work for Issue #8
This commit is contained in:
parent
02262880da
commit
0dacfaa79b
@ -37,14 +37,14 @@ public class PluginPortalListener implements Listener
|
|||||||
Gate closestGate = GateUtil.closestGate(playerLocation);
|
Gate closestGate = GateUtil.closestGate(playerLocation);
|
||||||
|
|
||||||
if (closestGate != null)
|
if (closestGate != null)
|
||||||
{
|
{
|
||||||
// Make sure gate and player locations are on the same height (y-value).
|
// Make sure gate and player locations are on the same height (y-value).
|
||||||
// Otherwise the distance will be messed up when players are flying.
|
// Otherwise the distance will be messed up when players are flying.
|
||||||
// FIX ME: this could potentially let a nearby nether portal fail!
|
// FIX ME: this could potentially let a nearby nether portal fail!
|
||||||
playerLocation.setY(closestGate.getLocation().getY());
|
playerLocation.setY(closestGate.getLocation().getY());
|
||||||
double distToClosestGate = closestGate.getLocation().distance(playerLocation);
|
double distToClosestGate = closestGate.getLocation().distance(playerLocation);
|
||||||
|
|
||||||
if (distToClosestGate < 1.0)
|
if (distToClosestGate <= 5.0) // the player location is often not very accurate
|
||||||
{
|
{
|
||||||
gateAtLocation = closestGate;
|
gateAtLocation = closestGate;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user