diff options
Diffstat (limited to 'patches/server/0961-Lazily-create-LootContext-for-criterions.patch')
-rw-r--r-- | patches/server/0961-Lazily-create-LootContext-for-criterions.patch | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0961-Lazily-create-LootContext-for-criterions.patch b/patches/server/0961-Lazily-create-LootContext-for-criterions.patch index 293dfbd694..7ef28810ed 100644 --- a/patches/server/0961-Lazily-create-LootContext-for-criterions.patch +++ b/patches/server/0961-Lazily-create-LootContext-for-criterions.patch @@ -8,10 +8,10 @@ For each player on each tick, enter block triggers are invoked, and these create To avoid this, we now lazily create the LootContext if the criterion passes the predicate AND if any of the listener triggers require a loot context instance diff --git a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java -index 805459ba815520165c86a537fbb1f3e04b85bfbd..a327973e37b5b8d4e15683ef24548482ac3dc3d5 100644 +index 670e59432979740caf283d839c2f42c9748fe215..9c95c83e74c84e15c8d03503fc3cd0ee10044fd3 100644 --- a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java +++ b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java -@@ -45,14 +45,14 @@ public abstract class SimpleCriterionTrigger<T extends SimpleCriterionTrigger.Si +@@ -44,14 +44,14 @@ public abstract class SimpleCriterionTrigger<T extends SimpleCriterionTrigger.Si PlayerAdvancements playerAdvancements = player.getAdvancements(); Set<CriterionTrigger.Listener<T>> set = (Set) playerAdvancements.criterionData.get(this); // Paper - fix AdvancementDataPlayer leak if (set != null && !set.isEmpty()) { @@ -19,7 +19,7 @@ index 805459ba815520165c86a537fbb1f3e04b85bfbd..a327973e37b5b8d4e15683ef24548482 + LootContext lootContext = null; // EntityPredicate.createContext(player, player); // Paper - Perf: lazily create LootContext for criterions List<CriterionTrigger.Listener<T>> list = null; - for(CriterionTrigger.Listener<T> listener : set) { + for (CriterionTrigger.Listener<T> listener : set) { T simpleInstance = listener.trigger(); if (predicate.test(simpleInstance)) { Optional<ContextAwarePredicate> optional = simpleInstance.player(); |