Skip to content

Commit 5b57e9b

Browse files
committed
Fix purge-stale-tickets-frequency unloading chunks too fast
1 parent 505eb7f commit 5b57e9b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/net/minecraft/server/level/TicketType.java
2+
+++ b/net/minecraft/server/level/TicketType.java
3+
@@ -4,6 +_,8 @@
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
+
8+
+import io.multipaper.shreddedpaper.config.ShreddedPaperConfiguration;
9+
import net.minecraft.core.Registry;
10+
import net.minecraft.core.registries.BuiltInRegistries;
11+
12+
@@ -98,7 +_,7 @@
13+
private final int flags;
14+
15+
public TicketType(long timeout, int flags) {
16+
- this.timeout = timeout;
17+
+ this.timeout = timeout == 0 ? 0 : Math.max(ShreddedPaperConfiguration.get().optimizations.purgeStaleTicketsFrequency + 1L, timeout); // ShreddedPaper - purgeStaleTicketsFrequency - ensure tickets live for at least 1 tick
18+
this.flags = flags;
19+
} // long timeout, int flags
20+

0 commit comments

Comments
 (0)