api: Simplify if statements
This commit is contained in:
@@ -104,10 +104,6 @@ public class Point
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (this.y != other.y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return this.y == other.y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,11 +427,8 @@ public class WorldArea
|
||||
}
|
||||
if (height == 1)
|
||||
{
|
||||
if ((collisionDataFlags[checkX - dx][checkY] & yFlags) != 0 &&
|
||||
extraCondition.test(WorldPoint.fromScene(client, startX, checkY, client.getPlane())))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return (collisionDataFlags[checkX - dx][checkY] & yFlags) == 0 ||
|
||||
!extraCondition.test(WorldPoint.fromScene(client, startX, checkY, client.getPlane()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -370,16 +370,12 @@ public class WorldPoint
|
||||
*/
|
||||
public static boolean isInZone(WorldPoint lowerBound, WorldPoint upperBound, WorldPoint userLocation)
|
||||
{
|
||||
if (userLocation.getX() < lowerBound.getX()
|
||||
|| userLocation.getX() > upperBound.getX()
|
||||
|| userLocation.getY() < lowerBound.getY()
|
||||
|| userLocation.getY() > upperBound.getY()
|
||||
|| userLocation.getPlane() < lowerBound.getPlane()
|
||||
|| userLocation.getPlane() > upperBound.getPlane())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return userLocation.getX() >= lowerBound.getX()
|
||||
&& userLocation.getX() <= upperBound.getX()
|
||||
&& userLocation.getY() >= lowerBound.getY()
|
||||
&& userLocation.getY() <= upperBound.getY()
|
||||
&& userLocation.getPlane() >= lowerBound.getPlane()
|
||||
&& userLocation.getPlane() <= upperBound.getPlane();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user