From 5cf8037f2f5cfc67c7f75dccf9d2dc6638ca379f Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 1 Nov 2020 12:12:28 +0100 Subject: [PATCH] Optimize FilterScript --- .../misslewars/scripts/implemented/FilterScript.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/de/steamwar/misslewars/scripts/implemented/FilterScript.java b/src/de/steamwar/misslewars/scripts/implemented/FilterScript.java index 9088c4e..e9fd427 100644 --- a/src/de/steamwar/misslewars/scripts/implemented/FilterScript.java +++ b/src/de/steamwar/misslewars/scripts/implemented/FilterScript.java @@ -48,13 +48,10 @@ public class FilterScript implements RunnableScript { int blockZ = location.getBlockZ(); if (offset > 0) { - if (blockZ > bz - offset) return true; - if (blockZ < rz + offset) return true; + return (blockZ > bz - offset) || (blockZ < rz + offset); } else { - if (blockZ < bz - offset) return true; - if (blockZ > rz + offset) return true; + return (blockZ < bz - offset) || (blockZ > rz + offset); } - return false; }; break; default: