From e253e95cecc69b05e27a2bf25ce4ae819076d5b2 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Sun, 12 Sep 2021 15:23:22 +0200 Subject: [PATCH] Minor function cleaning --- .../java/net/knarcraft/stargate/Stargate.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/stargate/Stargate.java b/src/main/java/net/knarcraft/stargate/Stargate.java index 18790e9..956aa94 100644 --- a/src/main/java/net/knarcraft/stargate/Stargate.java +++ b/src/main/java/net/knarcraft/stargate/Stargate.java @@ -342,11 +342,25 @@ public class Stargate extends JavaPlugin { /* * Check whether the player can see this gate (Hidden property check) */ + + /** + * Checks whether the player can see this gate (Hidden property check) + * + *

This decides if the player can see the gate on the network selection screen

+ * + * @param player

The player to check

+ * @param portal

The portal to check

+ * @return

True if the given player can see the given portal

+ */ public static boolean canSee(Player player, Portal portal) { // The gate is not hidden - if (!portal.isHidden()) return true; + if (!portal.isHidden()) { + return true; + } // The player is an admin with the ability to see hidden gates - if (hasPerm(player, "stargate.admin") || hasPerm(player, "stargate.admin.hidden")) return true; + if (hasPerm(player, "stargate.admin") || hasPerm(player, "stargate.admin.hidden")) { + return true; + } // The player is the owner of the gate return portal.isOwner(player); }