From c605be20c72009e0bab1b7adbaaab103f7559688 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 29 May 2019 04:25:08 +0100 Subject: [PATCH] ChunkMapDistance-CME --- Spigot-Server-Patches/0003-MC-Dev-fixes.patch | 42 ++++++++++++++++++- ...ityAreaEffectCloud-from-going-negat.patch} | 6 +-- .../0398-ChunkMapDistance-CME.patch | 37 ++++++++++++++++ 3 files changed, 81 insertions(+), 4 deletions(-) rename Spigot-Server-Patches/{0398-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch => 0397-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch} (93%) create mode 100644 Spigot-Server-Patches/0398-ChunkMapDistance-CME.patch diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 96dca2e5b1..8ab89c36d3 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -1,4 +1,4 @@ -From 6608e2ef74ee495cca724bfe80cc943c33981653 Mon Sep 17 00:00:00 2001 +From cf11aafeb1a4dbcca311cf32504a70ae4dfed163 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes @@ -108,6 +108,46 @@ index b4c8722f04..59d86fc66e 100644 String s1 = ((INamable) t0).getName(); if (this.b.containsKey(s1)) { +diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java +index ebfc588539..ba4b9fa59c 100644 +--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java +@@ -79,7 +79,7 @@ public abstract class ChunkMapDistance { + while (objectiterator.hasNext()) { + Entry>> entry = (Entry) objectiterator.next(); + +- if (((ObjectSortedSet) entry.getValue()).removeIf((ticket) -> { ++ if ((entry.getValue()).removeIf((ticket) -> { // Paper - decompile fix + return ticket.a(this.currentTick); + })) { + this.f.b(entry.getLongKey(), this.a((ObjectSortedSet) entry.getValue()), false); +@@ -143,7 +143,7 @@ public abstract class ChunkMapDistance { + + completablefuture.thenAccept((either) -> { + this.p.execute(() -> { +- this.n.a((Object) ChunkTaskQueueSorter.a(() -> { ++ this.n.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile fix + }, j, false)); + }); + }); +@@ -367,7 +367,7 @@ public abstract class ChunkMapDistance { + Ticket ticket = new Ticket<>(TicketType.PLAYER, ChunkMapDistance.b, new ChunkCoordIntPair(i), ChunkMapDistance.this.currentTick); + + if (flag1) { +- ChunkMapDistance.this.m.a((Object) ChunkTaskQueueSorter.a(() -> { ++ ChunkMapDistance.this.m.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile fix + ChunkMapDistance.this.p.execute(() -> { + ChunkMapDistance.this.a(i, ticket); + ChunkMapDistance.this.o.add(i); +@@ -376,7 +376,7 @@ public abstract class ChunkMapDistance { + return j; + })); + } else { +- ChunkMapDistance.this.n.a((Object) ChunkTaskQueueSorter.a(() -> { ++ ChunkMapDistance.this.n.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile fix + ChunkMapDistance.this.p.execute(() -> { + ChunkMapDistance.this.b(i, ticket); + }); diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java index c973ab6076..30701fd7f3 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java diff --git a/Spigot-Server-Patches/0398-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch b/Spigot-Server-Patches/0397-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch similarity index 93% rename from Spigot-Server-Patches/0398-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch rename to Spigot-Server-Patches/0397-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch index 3bd62329cb..753985e0c9 100644 --- a/Spigot-Server-Patches/0398-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch +++ b/Spigot-Server-Patches/0397-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch @@ -1,4 +1,4 @@ -From ac63e7e69a76ece9487793c7fd88d96c54d51f9e Mon Sep 17 00:00:00 2001 +From f35d09dad58c40e66449cc78b81e80771c5f46c8 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Mon, 27 May 2019 17:35:39 -0500 Subject: [PATCH] MC-114618 - Fix EntityAreaEffectCloud from going negative @@ -6,7 +6,7 @@ Subject: [PATCH] MC-114618 - Fix EntityAreaEffectCloud from going negative diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java -index 418c638d3..2eaed1cd6 100644 +index 418c638d31..2eaed1cd63 100644 --- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java +++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java @@ -163,6 +163,12 @@ public class EntityAreaEffectCloud extends Entity { @@ -40,5 +40,5 @@ index 418c638d3..2eaed1cd6 100644 this.setRadius(f); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0398-ChunkMapDistance-CME.patch b/Spigot-Server-Patches/0398-ChunkMapDistance-CME.patch new file mode 100644 index 0000000000..714edf9824 --- /dev/null +++ b/Spigot-Server-Patches/0398-ChunkMapDistance-CME.patch @@ -0,0 +1,37 @@ +From f48fe8c4496fd1625f481df4d088f8938dde05c3 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Wed, 29 May 2019 04:01:22 +0100 +Subject: [PATCH] ChunkMapDistance CME + + +diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java +index ba4b9fa59c..d3c2ad3c40 100644 +--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java +@@ -39,7 +39,7 @@ public abstract class ChunkMapDistance { + private int entitydistance; + private final ChunkMapDistance.b i = new ChunkMapDistance.b(8); + private final ChunkMapDistance.d j = new ChunkMapDistance.d(33); +- private final Set k = Sets.newHashSet(); ++ private Set k = Sets.newHashSet(); // Paper - -final + private final PlayerChunk.c l; + private final Mailbox> m; + private final Mailbox n; +@@ -117,8 +117,12 @@ public abstract class ChunkMapDistance { + ; + } + +- if (!this.k.isEmpty()) { +- this.k.forEach((playerchunk) -> { ++ // Paper start ++ Set currentPending = this.k; ++ this.k = Sets.newHashSet(); ++ if (!currentPending.isEmpty()) { ++ currentPending.forEach((playerchunk) -> { ++ // Paper end + playerchunk.a(playerchunkmap); + }); + this.k.clear(); +-- +2.21.0 +