From 00a81efef8256e907cfc1c027b993a6f7c4d4031 Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Thu, 21 Mar 2024 23:33:19 +0100 Subject: [PATCH] Replace hardcoded UUID in GriefPreventionProtection Introduced a class variable `dummyId` to replace the previously hardcoded UUID in the `isProtected` method of the GriefPreventionProtection class. This change improves code maintainability and readability. --- .../yardwatch/hooks/GriefPreventionProtection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java b/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java index 0c2384b..984a622 100644 --- a/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java +++ b/src/main/java/me/youhavetrouble/yardwatch/hooks/GriefPreventionProtection.java @@ -15,6 +15,7 @@ import java.util.UUID; public class GriefPreventionProtection implements Protection { private final YardWatch plugin; + private final UUID dummyId = UUID.fromString("00000000-0000-0000-0000-000000000000"); public GriefPreventionProtection(YardWatch plugin) { this.plugin = plugin; @@ -29,7 +30,7 @@ public class GriefPreventionProtection implements Protection { public boolean isProtected(Location location) { Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, true, null); if (claim == null) return false; - return claim.checkPermission(UUID.fromString("00000000-0000-0000-0000-000000000000"), ClaimPermission.Build, null) != null; + return claim.checkPermission(dummyId, ClaimPermission.Build, null) != null; } @Override