From 780477bca53cb34640d84720a10b067cc036240f Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sat, 5 Aug 2023 12:26:28 -0700 Subject: [PATCH] Expand use of strict advancement dim check (#9545) --- ...on-for-strict-advancement-dimension-checks.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/server/Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/Add-option-for-strict-advancement-dimension-checks.patch index b1661a1c4d..65e72bd3da 100644 --- a/patches/server/Add-option-for-strict-advancement-dimension-checks.patch +++ b/patches/server/Add-option-for-strict-advancement-dimension-checks.patch @@ -10,6 +10,19 @@ criteria trigger, or whether to trigger the `NETHER_TRAVEL` distance trigger. This adds a config option to ignore that and use the exact dimension key of the worlds involved. +diff --git a/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java b/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java ++++ b/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java +@@ -0,0 +0,0 @@ public class LocationPredicate { + return false; + } else if (!this.z.matches(z)) { + return false; +- } else if (this.dimension != null && this.dimension != world.dimension()) { ++ } else if (this.dimension != null && this.dimension != (io.papermc.paper.configuration.GlobalConfiguration.get().misc.strictAdvancementDimensionCheck ? world.dimension() : org.bukkit.craftbukkit.util.CraftDimensionUtil.getMainDimensionKey(world))) { // Paper + return false; + } else { + BlockPos blockPos = BlockPos.containing(x, y, z); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java