mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 9dfe1321 Delay Chunk Unloads based on Player Movement f0409edc Drop Close region files patch, doesn't add any value. 700070c5 Fix undesirable behavior around world level changes due to priority
This commit is contained in:
2
Paper
2
Paper
Submodule Paper updated: 34e5942bf0...9dfe1321d5
@@ -1 +1 @@
|
|||||||
1.15.2--f1507da451593fc5580a991d5516a795ca627417
|
1.15.2--01d75a1ec6f80206ead9ab685cdc0897e4264b7e
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 88a8d3aec51dfc78c1498fa45575995062528f28 Mon Sep 17 00:00:00 2001
|
From 7583059e4b66cf1353a7aa4c45371a03478266d7 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||||
Date: Sun, 7 Jun 2020 13:16:02 -0500
|
Date: Sun, 7 Jun 2020 13:16:02 -0500
|
||||||
Subject: [PATCH] Do not strip colors from death messages
|
Subject: [PATCH] Do not strip colors from death messages
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 355f6b170c3e1cb367f53ab93d8c10c0694f1329 Mon Sep 17 00:00:00 2001
|
From a92cfb0d4a86b7bb1b1c7472f1844b11014dcb69 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||||
Date: Fri, 21 Feb 2020 17:04:51 -0600
|
Date: Fri, 21 Feb 2020 17:04:51 -0600
|
||||||
Subject: [PATCH] MC-125757 Fix - Always increment arrow despawn counter
|
Subject: [PATCH] MC-125757 Fix - Always increment arrow despawn counter
|
||||||
@@ -38,5 +38,5 @@ index 48da1e662a..11d1dc8763 100644
|
|||||||
++this.despawnCounter;
|
++this.despawnCounter;
|
||||||
if (this.despawnCounter >= (fromPlayer == PickupStatus.CREATIVE_ONLY ? world.paperConfig.creativeArrowDespawnRate : (fromPlayer == PickupStatus.DISALLOWED ? world.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof EntityThrownTrident) ? world.spigotConfig.tridentDespawnRate : world.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init?
|
if (this.despawnCounter >= (fromPlayer == PickupStatus.CREATIVE_ONLY ? world.paperConfig.creativeArrowDespawnRate : (fromPlayer == PickupStatus.DISALLOWED ? world.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof EntityThrownTrident) ? world.spigotConfig.tridentDespawnRate : world.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init?
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 9b43b8d6100c89708ca556051ff8b5df0bdec753 Mon Sep 17 00:00:00 2001
|
From a2e4cc2b1c6edb9a05f4ae40490c228442f6293c Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Thu, 6 Jun 2019 22:15:46 -0500
|
Date: Thu, 6 Jun 2019 22:15:46 -0500
|
||||||
Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
|
Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
|
||||||
@@ -58,5 +58,5 @@ index 81969d2dc9..296274896e 100644
|
|||||||
public float armorstandStepHeight = 0.0F;
|
public float armorstandStepHeight = 0.0F;
|
||||||
public boolean controllableMinecarts = false;
|
public boolean controllableMinecarts = false;
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 1e6d612a1824e5709bda2199218af4610166a678 Mon Sep 17 00:00:00 2001
|
From 51abcd28f8b674ab671d50a661ecdb0607e142a9 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Sat, 6 Jul 2019 21:12:58 -0500
|
Date: Sat, 6 Jul 2019 21:12:58 -0500
|
||||||
Subject: [PATCH] MC-4 Fix - Item position desync
|
Subject: [PATCH] MC-4 Fix - Item position desync
|
||||||
@@ -59,5 +59,5 @@ index 68bad6a13a..ab88636cad 100644
|
|||||||
|
|
||||||
public static boolean barrelSixRows = false;
|
public static boolean barrelSixRows = false;
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From da674165b50d62d2d433c19f4b50941e06b01782 Mon Sep 17 00:00:00 2001
|
From 61fae64183bd5209977c521146bc1db1788ba13a Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
||||||
Subject: [PATCH] MC-56653 Fix - pig zombies aggro
|
Subject: [PATCH] MC-56653 Fix - pig zombies aggro
|
||||||
@@ -63,5 +63,5 @@ index 296274896e..7e7f10351b 100644
|
|||||||
|
|
||||||
public boolean zombieVillagerRidable = false;
|
public boolean zombieVillagerRidable = false;
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From cdd3086978fd12ec425adef6ae3a21d20230352e Mon Sep 17 00:00:00 2001
|
From 2cda63fae2890ae6a9b36b656a0b27f783be8657 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Sat, 20 Jul 2013 22:40:56 -0400
|
Date: Sat, 20 Jul 2013 22:40:56 -0400
|
||||||
Subject: [PATCH] EMC - MonsterEggSpawn Event
|
Subject: [PATCH] EMC - MonsterEggSpawn Event
|
||||||
@@ -59,5 +59,5 @@ index 8e8d392a15..ff11baa7c5 100644
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From dd59c9d44aa90f5ee82eaa1ce53a4273584bc21c Mon Sep 17 00:00:00 2001
|
From af0ccd63a3f9f4c93e5a3ccc1dc6d6ce70b8622c Mon Sep 17 00:00:00 2001
|
||||||
From: Eearslya Sleiarion <eearslya@gmail.com>
|
From: Eearslya Sleiarion <eearslya@gmail.com>
|
||||||
Date: Mon, 24 Jun 2019 21:27:32 -0700
|
Date: Mon, 24 Jun 2019 21:27:32 -0700
|
||||||
Subject: [PATCH] PaperPR - Add BellRingEvent
|
Subject: [PATCH] PaperPR - Add BellRingEvent
|
||||||
@@ -45,5 +45,5 @@ index dbdbfb8ad9..0bbd1e1594 100644
|
|||||||
|
|
||||||
if (flag2 && entityhuman != null) {
|
if (flag2 && entityhuman != null) {
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 1b796add1a226554384471e84cfbd7f39f253e92 Mon Sep 17 00:00:00 2001
|
From 6f1e3968ebb8f81a84e28d28cd64f48c5fc7f9c9 Mon Sep 17 00:00:00 2001
|
||||||
From: chase <chasewhip20@gmail.com>
|
From: chase <chasewhip20@gmail.com>
|
||||||
Date: Sun, 15 Mar 2020 18:32:22 -0600
|
Date: Sun, 15 Mar 2020 18:32:22 -0600
|
||||||
Subject: [PATCH] PaperPR - Per World Spawn limits
|
Subject: [PATCH] PaperPR - Per World Spawn limits
|
||||||
@@ -49,5 +49,5 @@ index e54cff571c..cc1fb7108a 100644
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 0d10025c6a251f2c362d2adaf372fce754ac92fb Mon Sep 17 00:00:00 2001
|
From 13c58b12b39ccbb8c0edfaeb2140675662054e12 Mon Sep 17 00:00:00 2001
|
||||||
From: KennyTV <kennytv@t-online.de>
|
From: KennyTV <kennytv@t-online.de>
|
||||||
Date: Mon, 20 Apr 2020 13:57:06 +0200
|
Date: Mon, 20 Apr 2020 13:57:06 +0200
|
||||||
Subject: [PATCH] PaperPR - PlayerItemCooldownEvent
|
Subject: [PATCH] PaperPR - PlayerItemCooldownEvent
|
||||||
@@ -37,5 +37,5 @@ index 27cde8c155..3c3bcc7f91 100644
|
|||||||
protected void b(Item item, int i) {
|
protected void b(Item item, int i) {
|
||||||
super.b(item, i);
|
super.b(item, i);
|
||||||
--
|
--
|
||||||
2.24.0
|
2.26.2
|
||||||
|
|
||||||
@@ -1,225 +0,0 @@
|
|||||||
From c84c8fd87b181d5fa8c3d6b1623e38d00aeb96cc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
||||||
Date: Fri, 25 Oct 2019 02:11:30 -0700
|
|
||||||
Subject: [PATCH] Tuinity - Delay chunk unloads
|
|
||||||
|
|
||||||
Chunk unloads are now delayed by 10s. Specifically, ticket level
|
|
||||||
reduction is delayed by 10s. This is done to allow players to
|
|
||||||
teleport and have their pets follow them, as the chunks will no longer
|
|
||||||
unload or have entity ticking status removed.
|
|
||||||
|
|
||||||
It's also targetted to reduce performance regressions when
|
|
||||||
plugins or edge cases in code do not spam sync loads since chunks
|
|
||||||
without tickets get unloaded immediately.
|
|
||||||
|
|
||||||
Configurable under `delay-chunkunloads-by` in config.
|
|
||||||
---
|
|
||||||
.../java/net/minecraft/server/ChunkMap.java | 1 +
|
|
||||||
.../minecraft/server/ChunkMapDistance.java | 68 ++++++++++++++++++-
|
|
||||||
.../java/net/minecraft/server/Ticket.java | 6 +-
|
|
||||||
.../java/net/minecraft/server/TicketType.java | 1 +
|
|
||||||
.../java/net/pl3x/purpur/PurpurConfig.java | 9 +++
|
|
||||||
.../org/bukkit/craftbukkit/CraftWorld.java | 1 +
|
|
||||||
6 files changed, 82 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
|
|
||||||
index 55f9f4e6e7..ac21fdb4c9 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkMap.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
|
|
||||||
@@ -68,6 +68,7 @@ public abstract class ChunkMap extends LightEngineGraph {
|
|
||||||
|
|
||||||
protected abstract int b(long i);
|
|
||||||
|
|
||||||
+ public final void update(long coordinate, int level, boolean increaseInLevel) { this.b(coordinate, level, increaseInLevel); } // Purpur - OBFHELPER
|
|
||||||
public void b(long i, int j, boolean flag) {
|
|
||||||
this.a(ChunkCoordIntPair.a, i, j, flag);
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
||||||
index a4a4235f42..5d0789813f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
||||||
@@ -31,7 +31,7 @@ public abstract class ChunkMapDistance {
|
|
||||||
private static final int b = 33 + ChunkStatus.a(ChunkStatus.FULL) - 2;
|
|
||||||
private final Long2ObjectMap<ObjectSet<EntityPlayer>> c = new Long2ObjectOpenHashMap();
|
|
||||||
public final Long2ObjectOpenHashMap<ArraySetSorted<Ticket<?>>> tickets = new Long2ObjectOpenHashMap();
|
|
||||||
- private final ChunkMapDistance.a e = new ChunkMapDistance.a();
|
|
||||||
+ private final ChunkMapDistance.a e = new ChunkMapDistance.a(); final ChunkMapDistance.a getTicketTracker() { return this.e; } // Purpur - OBFHELPER
|
|
||||||
public static final int MOB_SPAWN_RANGE = 8; //private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); // Paper - no longer used
|
|
||||||
private final ChunkMapDistance.c g = new ChunkMapDistance.c(33);
|
|
||||||
// Paper start use a queue, but still keep unique requirement
|
|
||||||
@@ -52,6 +52,46 @@ public abstract class ChunkMapDistance {
|
|
||||||
private long currentTick;
|
|
||||||
|
|
||||||
PlayerChunkMap chunkMap; // Paper
|
|
||||||
+ // Purpur start
|
|
||||||
+ private long nextUnloadId;
|
|
||||||
+ private final Long2ObjectOpenHashMap<Ticket<Long>> delayedChunks = new Long2ObjectOpenHashMap<>();
|
|
||||||
+ public final void removeTickets(long chunk, TicketType<?> type) {
|
|
||||||
+ ArraySetSorted<Ticket<?>> tickets = this.tickets.get(chunk);
|
|
||||||
+ if (tickets == null) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ if (type == TicketType.DELAYED_UNLOAD) {
|
|
||||||
+ this.delayedChunks.remove(chunk);
|
|
||||||
+ }
|
|
||||||
+ boolean changed = tickets.removeIf((Ticket<?> ticket) -> {
|
|
||||||
+ return ticket.getTicketType() == type;
|
|
||||||
+ });
|
|
||||||
+ if (changed) {
|
|
||||||
+ this.getTicketTracker().update(chunk, getLowestTicketLevel(tickets), false);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private final java.util.function.LongFunction<Ticket<Long>> computeFuntion = (long key) -> {
|
|
||||||
+ Ticket<Long> ret = new Ticket<>(TicketType.DELAYED_UNLOAD, -1, ++ChunkMapDistance.this.nextUnloadId);
|
|
||||||
+ ret.isCached = true;
|
|
||||||
+ return ret;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ private void computeDelayedTicketFor(long chunk, int removedLevel, ArraySetSorted<Ticket<?>> tickets) {
|
|
||||||
+ int lowestLevel = getLowestTicketLevel(tickets);
|
|
||||||
+ if (removedLevel > lowestLevel) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ final Ticket<Long> ticket = this.delayedChunks.computeIfAbsent(chunk, this.computeFuntion);
|
|
||||||
+ if (ticket.getTicketLevel() != -1) {
|
|
||||||
+ // since we modify data used in sorting, we need to remove before
|
|
||||||
+ tickets.remove(ticket);
|
|
||||||
+ }
|
|
||||||
+ ticket.setCreationTick(this.currentTick);
|
|
||||||
+ ticket.setTicketLevel(removedLevel);
|
|
||||||
+ tickets.add(ticket); // re-add with new expire time and ticket level
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
|
|
||||||
protected ChunkMapDistance(Executor executor, Executor executor1) {
|
|
||||||
executor1.getClass();
|
|
||||||
@@ -68,12 +108,30 @@ public abstract class ChunkMapDistance {
|
|
||||||
++this.currentTick;
|
|
||||||
ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().fastIterator();
|
|
||||||
|
|
||||||
+ int[] tempLevel = new int[] { PlayerChunkMap.GOLDEN_TICKET + 1 }; // Purpur
|
|
||||||
while (objectiterator.hasNext()) {
|
|
||||||
Entry<ArraySetSorted<Ticket<?>>> entry = (Entry) objectiterator.next();
|
|
||||||
|
|
||||||
if ((entry.getValue()).removeIf((ticket) -> { // CraftBukkit - decompile error
|
|
||||||
- return ticket.b(this.currentTick);
|
|
||||||
+ // Purpur start
|
|
||||||
+ boolean ret = ticket.isExpired(this.currentTick);
|
|
||||||
+ if (net.pl3x.purpur.PurpurConfig.delayChunkUnloadsBy <= 0) {
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+ if (ret && ticket.getTicketType() != TicketType.DELAYED_UNLOAD && ticket.getTicketLevel() < tempLevel[0]) {
|
|
||||||
+ tempLevel[0] = ticket.getTicketLevel();
|
|
||||||
+ }
|
|
||||||
+ if (ticket.getTicketType() == TicketType.DELAYED_UNLOAD && ticket.isCached) {
|
|
||||||
+ this.delayedChunks.remove(entry.getLongKey(), ticket); // clean up ticket...
|
|
||||||
+ }
|
|
||||||
+ return ret;
|
|
||||||
+ // Purpur end
|
|
||||||
})) {
|
|
||||||
+ // Purpur start
|
|
||||||
+ if (tempLevel[0] < (PlayerChunkMap.GOLDEN_TICKET + 1)) {
|
|
||||||
+ this.computeDelayedTicketFor(entry.getLongKey(), tempLevel[0], entry.getValue());
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
this.e.b(entry.getLongKey(), a((ArraySetSorted) entry.getValue()), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -84,6 +142,7 @@ public abstract class ChunkMapDistance {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
+ private static int getLowestTicketLevel(ArraySetSorted<Ticket<?>> arraysetsorted) { return a(arraysetsorted); } // Purpur - OBFHELPER
|
|
||||||
private static int a(ArraySetSorted<Ticket<?>> arraysetsorted) {
|
|
||||||
AsyncCatcher.catchOp("ChunkMapDistance::getHighestTicketLevel"); // Paper
|
|
||||||
return !arraysetsorted.isEmpty() ? ((Ticket) arraysetsorted.b()).b() : PlayerChunkMap.GOLDEN_TICKET + 1;
|
|
||||||
@@ -175,6 +234,11 @@ public abstract class ChunkMapDistance {
|
|
||||||
boolean removed = false; // CraftBukkit
|
|
||||||
if (arraysetsorted.remove(ticket)) {
|
|
||||||
removed = true; // CraftBukkit
|
|
||||||
+ // Purpur start
|
|
||||||
+ if (net.pl3x.purpur.PurpurConfig.delayChunkUnloadsBy > 0 && ticket.getTicketType() != TicketType.DELAYED_UNLOAD) {
|
|
||||||
+ this.computeDelayedTicketFor(i, ticket.getTicketLevel(), arraysetsorted);
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arraysetsorted.isEmpty()) {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
|
|
||||||
index 0d6e0f2dda..ce0aef25c6 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/Ticket.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/Ticket.java
|
|
||||||
@@ -5,9 +5,10 @@ import java.util.Objects;
|
|
||||||
public final class Ticket<T> implements Comparable<Ticket<?>> {
|
|
||||||
|
|
||||||
private final TicketType<T> a;
|
|
||||||
- private final int b;
|
|
||||||
+ private int b; public final void setTicketLevel(final int value) { this.b = value; } // Purpur - remove final - OBFHELPER
|
|
||||||
public final T identifier; public final T getObjectReason() { return this.identifier; } // Paper - OBFHELPER
|
|
||||||
- private long d; public final long getCreationTick() { return this.d; } // Paper - OBFHELPER
|
|
||||||
+ private long d; public final long getCreationTick() { return this.d; } public final void setCreationTick(final long value) { this.d = value; } // Paper - OBFHELPER // Purpur - OBFHELPER
|
|
||||||
+ boolean isCached; // Purpur - delay chunk unloads, this defends against really stupid plugins
|
|
||||||
public int priority = 0; // Paper
|
|
||||||
|
|
||||||
protected Ticket(TicketType<T> tickettype, int i, T t0) {
|
|
||||||
@@ -61,6 +62,7 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
|
|
||||||
this.d = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ protected final boolean isExpired(long time) { return this.b(time); } // Purpur - OBFHELPER
|
|
||||||
protected boolean b(long i) {
|
|
||||||
long j = this.a.b();
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java
|
|
||||||
index 24ec5d77ca..1243134bc2 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/TicketType.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/TicketType.java
|
|
||||||
@@ -25,6 +25,7 @@ public class TicketType<T> {
|
|
||||||
public static final TicketType<Long> ASYNC_LOAD = a("async_load", Long::compareTo); // Paper
|
|
||||||
public static final TicketType<ChunkCoordIntPair> PRIORITY = a("priority", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper
|
|
||||||
public static final TicketType<ChunkCoordIntPair> URGENT = a("urgent", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper
|
|
||||||
+ public static final TicketType<Long> DELAYED_UNLOAD = a("delayed_unload", Long::compareTo); // Purpur
|
|
||||||
|
|
||||||
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
|
|
||||||
return new TicketType<>(s, comparator, 0L);
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
index ab88636cad..becb13e0e0 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
@@ -4,6 +4,7 @@ import com.google.common.base.Throwables;
|
|
||||||
import net.minecraft.server.Enchantment;
|
|
||||||
import net.minecraft.server.IRegistry;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
+import net.minecraft.server.TicketType;
|
|
||||||
import net.pl3x.purpur.command.PurpurCommand;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
@@ -206,4 +207,12 @@ public class PurpurConfig {
|
|
||||||
enchantment.setMaxLevel(maxLevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public static int delayChunkUnloadsBy;
|
|
||||||
+ private static void delayChunkUnloadsBy() {
|
|
||||||
+ delayChunkUnloadsBy = getInt("settings.delay-chunk-unloads-by", 1) * 20;
|
|
||||||
+ if (delayChunkUnloadsBy >= 0) {
|
|
||||||
+ TicketType.DELAYED_UNLOAD.loadPeriod = delayChunkUnloadsBy;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
||||||
index cc1fb7108a..159c7673d5 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
||||||
@@ -488,6 +488,7 @@ public class CraftWorld implements World {
|
|
||||||
net.minecraft.server.IChunkAccess chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z); // Paper
|
|
||||||
if (chunk != null) {
|
|
||||||
world.getChunkProvider().removeTicket(TicketType.PLUGIN, chunk.getPos(), 1, Unit.INSTANCE);
|
|
||||||
+ ((ChunkMapDistance)world.getChunkProvider().playerChunkMap.getChunkMapDistanceManager()).removeTickets(ChunkCoordIntPair.pair(x, z), TicketType.DELAYED_UNLOAD); // Purpur - delay chunk unloads - let plugins override
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
--
|
|
||||||
2.24.0
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user