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