Skip to content

Commit 32fef5d

Browse files
committed
do the fix in Ticket record getter instead
1 parent e21bf45 commit 32fef5d

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

paper-server/patches/sources/net/minecraft/server/level/Ticket.java.patch

-19
This file was deleted.

paper-server/patches/sources/net/minecraft/server/level/TicketType.java.patch

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/server/level/TicketType.java
22
+++ b/net/minecraft/server/level/TicketType.java
3-
@@ -13,6 +_,10 @@
3+
@@ -13,10 +_,22 @@
44
public static final TicketType PORTAL = register("portal", 300L, true, TicketType.TicketUse.LOADING_AND_SIMULATION);
55
public static final TicketType ENDER_PEARL = register("ender_pearl", 40L, false, TicketType.TicketUse.LOADING_AND_SIMULATION);
66
public static final TicketType UNKNOWN = register("unknown", 1L, false, TicketType.TicketUse.LOADING);
@@ -11,3 +11,15 @@
1111

1212
public static TicketType register(String name, long timeout, boolean persist, TicketType.TicketUse use) {
1313
return Registry.register(BuiltInRegistries.TICKET_TYPE, name, new TicketType(timeout, persist, use));
14+
}
15+
+
16+
+ // Paper start - chunk-gc config
17+
+ public static int PLUGIN_TYPE_TIMEOUT = 600;
18+
+ @Override
19+
+ public long timeout() {
20+
+ return this == PLUGIN ? PLUGIN_TYPE_TIMEOUT : this.timeout;
21+
+ }
22+
+ // Paper end - chunk-gc config
23+
24+
public boolean doesLoad() {
25+
return this.use == TicketType.TicketUse.LOADING || this.use == TicketType.TicketUse.LOADING_AND_SIMULATION;

paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
import net.minecraft.server.dedicated.DedicatedServerSettings;
6565
import net.minecraft.server.level.ServerLevel;
6666
import net.minecraft.server.level.ServerPlayer;
67-
import net.minecraft.server.level.Ticket;
67+
import net.minecraft.server.level.TicketType;
6868
import net.minecraft.server.players.IpBanListEntry;
6969
import net.minecraft.server.players.PlayerList;
7070
import net.minecraft.server.players.ServerOpListEntry;
@@ -475,7 +475,7 @@ public CraftPlayer apply(ServerPlayer player) {
475475
this.overrideSpawnLimits();
476476
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
477477
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
478-
Ticket.PLUGIN_TYPE_TIMEOUT = this.configuration.getInt("chunk-gc.period-in-ticks");
478+
TicketType.PLUGIN_TYPE_TIMEOUT = this.configuration.getInt("chunk-gc.period-in-ticks");
479479
this.minimumAPI = ApiVersion.getOrCreateVersion(this.configuration.getString("settings.minimum-api"));
480480
this.loadIcon();
481481
this.loadCompatibilities();
@@ -1043,7 +1043,7 @@ public void reload() {
10431043
this.console.setMotd(config.motd);
10441044
this.overrideSpawnLimits();
10451045
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
1046-
Ticket.PLUGIN_TYPE_TIMEOUT = this.configuration.getInt("chunk-gc.period-in-ticks");
1046+
TicketType.PLUGIN_TYPE_TIMEOUT = this.configuration.getInt("chunk-gc.period-in-ticks");
10471047
this.minimumAPI = ApiVersion.getOrCreateVersion(this.configuration.getString("settings.minimum-api"));
10481048
this.printSaveWarning = false;
10491049
this.console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");

0 commit comments

Comments
 (0)