mirror of
https://github.com/YouHaveTrouble/YardWatch.git
synced 2026-05-12 06:26:59 +00:00
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.
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.UUID;
|
|||||||
public class GriefPreventionProtection implements Protection {
|
public class GriefPreventionProtection implements Protection {
|
||||||
|
|
||||||
private final YardWatch plugin;
|
private final YardWatch plugin;
|
||||||
|
private final UUID dummyId = UUID.fromString("00000000-0000-0000-0000-000000000000");
|
||||||
|
|
||||||
public GriefPreventionProtection(YardWatch plugin) {
|
public GriefPreventionProtection(YardWatch plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@@ -29,7 +30,7 @@ public class GriefPreventionProtection implements Protection {
|
|||||||
public boolean isProtected(Location location) {
|
public boolean isProtected(Location location) {
|
||||||
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, true, null);
|
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, true, null);
|
||||||
if (claim == null) return false;
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user