From 3ae07c9380a97f2e389853d56aad1791481eaebb Mon Sep 17 00:00:00 2001 From: ThiagoROX <51332006+SrBedrock@users.noreply.github.com> Date: Thu, 27 Jun 2024 19:17:39 -0300 Subject: [PATCH] Add bedrock bypass --- dependency-reduced-pom.xml | 90 +++++++++++++++++++ pom.xml | 2 +- .../gpclaimexpiration/GPClaimExpiration.java | 14 ++- 3 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 dependency-reduced-pom.xml diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml new file mode 100644 index 0000000..df4745c --- /dev/null +++ b/dependency-reduced-pom.xml @@ -0,0 +1,90 @@ + + + 4.0.0 + com.github.gpaddons + gpclaimexpiration + GPClaimExpiration + 1.0.6-SNAPSHOT + Automatic expiration of GP claims. + + + Jikoo + + + + clean package + + + true + ${basedir}/src/main/resources + + *.yml + + + + ${project.name} + + + maven-compiler-plugin + 3.13.0 + + + maven-shade-plugin + 3.6.0 + + + package + + shade + + + true + + + com.github.jikoo.planarwrappers + com.github.gpaddons.gpclaimexpiration.planarwrappers + + + + + + + + + + + jitpack.io + https://jitpack.io + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots + + + + + org.spigotmc + spigot-api + 1.16.4-R0.1-SNAPSHOT + provided + + + org.jetbrains + annotations + 24.1.0 + provided + + + com.github.TechFortress + GriefPrevention + 3562a238dd + provided + + + + 17 + 1.16 + 17 + UTF-8 + + diff --git a/pom.xml b/pom.xml index 7721808..d641abf 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.gpaddons gpclaimexpiration - 1.0.1-SNAPSHOT + 1.0.7-SNAPSHOT GPClaimExpiration Automatic expiration of GP claims. diff --git a/src/main/java/com/github/gpaddons/gpclaimexpiration/GPClaimExpiration.java b/src/main/java/com/github/gpaddons/gpclaimexpiration/GPClaimExpiration.java index d24bf05..4cbbaa7 100644 --- a/src/main/java/com/github/gpaddons/gpclaimexpiration/GPClaimExpiration.java +++ b/src/main/java/com/github/gpaddons/gpclaimexpiration/GPClaimExpiration.java @@ -7,6 +7,7 @@ import com.github.gpaddons.util.lang.Lang; import com.github.gpaddons.util.lang.MessageReplacement; import me.ryanhamshire.GriefPrevention.Claim; +import me.ryanhamshire.GriefPrevention.CustomLogEntryTypes; import me.ryanhamshire.GriefPrevention.GriefPrevention; import me.ryanhamshire.GriefPrevention.PlayerData; import org.bukkit.OfflinePlayer; @@ -20,6 +21,7 @@ import java.util.Map; import java.util.Optional; import java.util.TreeMap; +import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -41,6 +43,8 @@ public void onEnable() // Load configured claim durations. loadAreaDurations(); + getLogger().warning(String.format("Claim expiration durations loaded. Shortest duration is %d", getShortestClaimExpiration())); + // Unregister existing listeners. HandlerList.unregisterAll(this); @@ -128,7 +132,15 @@ public boolean isExempt(@NotNull OfflinePlayer player) { if (player.isOnline()) return true; - PlayerData playerData = GriefPrevention.instance.dataStore.getPlayerData(player.getUniqueId()); + UUID uuid = player.getUniqueId(); + + if (uuid.toString().startsWith("00000000-0000-0000")) { + GriefPrevention.AddLogEntry(String.format("[GPClaimExpiration] %s is exempt from expiration due to bedrock.", + uuid), CustomLogEntryTypes.Debug, true); + return true; + } + + PlayerData playerData = GriefPrevention.instance.dataStore.getPlayerData(uuid); if (exceedsConfigInt("expiration.bypass.claim_blocks", playerData::getAccruedClaimBlocks)) return true;