PaperMC/Spigot-Server-Patches/0405-Fix-MC-154214.patch
Shane Freeder 73983e4c16
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
3dc4cdcd Update to Minecraft 1.14.3-pre4
88b25a8c SPIGOT-5098: Add a method to allow colored sign changes
6d913552 Update to Minecraft 1.14.3-pre4

CraftBukkit Changes:
f1f33559 Update to Minecraft 1.14.3
8a3d3f49 SPIGOT-5098: Add a method to allow colored sign changes
533290e2 SPIGOT-5100: Console warning from pig zombie targeting
6dde4b9f SPIGOT-5094: Allow opening merchant for wandering traders and hide the xp bar for custom merchants
9af90077 SPIGOT-5097: Bukkit.clearRecipes() no longer working
38fa220f Fix setting game rules via the API
fe3930ce Update to Minecraft 1.14.3-pre4
da071ec5 Remove outdated build delay.

Spigot Changes:
4d2f30f1 Update to Minecraft 1.14.3
f16400e3 Update to Minecraft 1.14.3-pre4
2019-06-25 03:46:54 +01:00

50 lines
2.2 KiB
Diff

From 09f840156671701b31ae0d7f3c9d8cf45146040e Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 16 Jun 2019 23:30:25 -0700
Subject: [PATCH] Fix MC-154214
Avoid adding player tickets when they're out of range of the closest player
diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java
index 0c562a5f34..7a76db08fc 100644
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
@@ -333,12 +333,18 @@ public abstract class ChunkMapDistance {
}
private void a(long i, int j, boolean flag, boolean flag1) {
+ final long chunkPosition = i; // Paper - conflict on variable change
if (flag != flag1) {
Ticket<?> ticket = new Ticket<>(TicketType.PLAYER, ChunkMapDistance.b, new ChunkCoordIntPair(i), ChunkMapDistance.this.currentTick);
if (flag1) {
ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile fix
ChunkMapDistance.this.m.execute(() -> {
+ // Paper start - Fix MC-154214
+ if (!this.inRange(this.getNearestDistanceFromPlayerMap().get(chunkPosition))) {
+ return;
+ }
+ // Paper end
ChunkMapDistance.this.a(i, ticket);
ChunkMapDistance.this.l.add(i);
});
@@ -382,6 +388,7 @@ public abstract class ChunkMapDistance {
}
+ private final boolean inRange(int distance) { return this.c(distance); } // Paper - OBFHELPER
private boolean c(int i) {
return i <= this.e - 2;
}
@@ -389,7 +396,7 @@ public abstract class ChunkMapDistance {
class b extends ChunkMap {
- protected final Long2ByteMap a = new Long2ByteOpenHashMap();
+ protected final Long2ByteMap a = new Long2ByteOpenHashMap(); protected final Long2ByteMap getNearestDistanceFromPlayerMap() { return this.a; } // Paper - OBFHELPER
protected final int b;
protected b(int i) {
--
2.22.0