浏览代码

Small refactoring

RedstoneFuture 2 年之前
父节点
当前提交
0e47db4a8c

+ 2 - 5
missilewars-plugin/src/main/java/de/butzlabben/missilewars/util/geometry/Geometry.java

@@ -33,9 +33,7 @@ public class Geometry {
      * @return true, if the statement is correct
      * @return true, if the statement is correct
      */
      */
     public static boolean isCloser(Location targetLocation, Location closerLocation, Location furtherAwayLocation) {
     public static boolean isCloser(Location targetLocation, Location closerLocation, Location furtherAwayLocation) {
-        if (targetLocation.distanceSquared(closerLocation) < targetLocation.distanceSquared(furtherAwayLocation)) return true;
-
-        return false;
+        return (targetLocation.distanceSquared(closerLocation) < targetLocation.distanceSquared(furtherAwayLocation));
     }
     }
 
 
     /**
     /**
@@ -83,8 +81,7 @@ public class Geometry {
      * @return true, if the statement is correct
      * @return true, if the statement is correct
      */
      */
     public static boolean isInWorld(Location targetLocation, World world) {
     public static boolean isInWorld(Location targetLocation, World world) {
-        if (targetLocation.getWorld().getName().equals(world.getName())) return true;
-        return false;
+        return (targetLocation.getWorld().getName().equals(world.getName()));
     }
     }
     
     
 }
 }