0
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-05-03 00:02:30 +00:00
Files
Nassim Jahnke f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00

42 lines
1.6 KiB
Diff

--- a/net/minecraft/server/level/Ticket.java
+++ b/net/minecraft/server/level/Ticket.java
@@ -14,17 +_,36 @@
ExtraCodecs.NON_NEGATIVE_INT.fieldOf("level").forGetter(Ticket::getTicketLevel),
Codec.LONG.optionalFieldOf("ticks_left", 0L).forGetter(ticket -> ticket.ticksLeft)
)
- .apply(instance, Ticket::new)
+ .apply(instance, (type, level, ticks) -> new Ticket(type, level.intValue(), ticks.longValue())) // Paper - add identifier
);
private final TicketType type;
private final int ticketLevel;
private long ticksLeft;
+ // Paper start - add identifier
+ private Object identifier;
+
+ public Object getIdentifier() {
+ return this.identifier;
+ }
+ // Paper end - add identifier
+
public Ticket(TicketType type, int ticketLevel) {
- this(type, ticketLevel, type.timeout());
+ // Paper start - add identifier
+ this(type, ticketLevel, null);
+ }
+ public Ticket(TicketType type, int ticketLevel, Object identifier) {
+ this(type, ticketLevel, type.timeout(), identifier);
+ // Paper end - add identifier
}
private Ticket(TicketType type, int ticketLevel, long ticksLeft) {
+ // Paper start - add identifier
+ this(type, ticketLevel, ticksLeft, null);
+ }
+ private Ticket(TicketType type, int ticketLevel, long ticksLeft, Object identifier) {
+ this.identifier = identifier;
+ // Paper end - add identifier
this.type = type;
this.ticketLevel = ticketLevel;
this.ticksLeft = ticksLeft;