diff options
Diffstat (limited to 'patches/server/0009-MC-Utils.patch')
-rw-r--r-- | patches/server/0009-MC-Utils.patch | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 5ce66ed29c..00db4c45d0 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -5530,7 +5530,7 @@ index ad2d29b106df33965090be521d4f945601965a00..261943f1f188643793a72bd239dfc5fe protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) { super(workerExecutor, mainThreadExecutor); diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java -index 83f9360d7c645c7bfca34627e40c86e2aa31143b..e7bca3db8c7d29fe984decddda83569ef921cc31 100644 +index 83f9360d7c645c7bfca34627e40c86e2aa31143b..6c2339d6a93172e25040c4868a3a47473a1f5336 100644 --- a/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java @@ -385,7 +385,7 @@ public abstract class DistanceManager { @@ -5538,7 +5538,7 @@ index 83f9360d7c645c7bfca34627e40c86e2aa31143b..e7bca3db8c7d29fe984decddda83569e public void removeTicketsOnClosing() { - ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN); -+ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve ++ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve ObjectIterator<Entry<SortedArraySet<Ticket<?>>>> objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); while (objectiterator.hasNext()) { @@ -5745,7 +5745,7 @@ index 97a670499f4ce50239d8c09cf10c03a7520c8753..50c255c5226d50f78ead4c0a0694ac9d public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java -index 1ab1d4054c3fc343325d60f55b6af9bdac12305a..0fdb65a1e474950a50480f4e6f99c69f8e015a50 100644 +index 1ab1d4054c3fc343325d60f55b6af9bdac12305a..4d3f7d4a8e05a8d84aa5202134eda1ce9621712e 100644 --- a/src/main/java/net/minecraft/server/level/TicketType.java +++ b/src/main/java/net/minecraft/server/level/TicketType.java @@ -7,6 +7,7 @@ import net.minecraft.util.Unit; @@ -5756,6 +5756,14 @@ index 1ab1d4054c3fc343325d60f55b6af9bdac12305a..0fdb65a1e474950a50480f4e6f99c69f private final String name; private final Comparator<T> comparator; +@@ -24,6 +25,7 @@ public class TicketType<T> { + public static final TicketType<ChunkPos> UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1); + public static final TicketType<Unit> PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit + public static final TicketType<org.bukkit.plugin.Plugin> PLUGIN_TICKET = TicketType.create("plugin_ticket", (plugin1, plugin2) -> plugin1.getClass().getName().compareTo(plugin2.getClass().getName())); // CraftBukkit ++ public static final TicketType<Integer> POST_TELEPORT = TicketType.create("post_teleport", Integer::compare, 5); // Paper - post teleport ticket type + + public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) { + return new TicketType<>(name, argumentComparator, 0L); diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java index a1f4ebcd0877a6d0c41493eff5d70a408bf98e59..f1725ef766c35aa623ace58fe8bf31fc9b2bb6b3 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -5788,7 +5796,7 @@ index a1f4ebcd0877a6d0c41493eff5d70a408bf98e59..f1725ef766c35aa623ace58fe8bf31fc public BlockState getBlockState(BlockPos pos) { return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d7095aab94a9f3b9f06a033ba4d414dfae42f620..7bb87d2bdf0ead0fdca38a9685e2e15b249ec2cb 100644 +index d7095aab94a9f3b9f06a033ba4d414dfae42f620..c8957caa797a6f4c3d3fc5f0b74b7fefeb1aa2c3 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -181,6 +181,7 @@ public abstract class PlayerList { @@ -5799,6 +5807,14 @@ index d7095aab94a9f3b9f06a033ba4d414dfae42f620..7bb87d2bdf0ead0fdca38a9685e2e15b GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); // Optional optional; // CraftBukkit - decompile error +@@ -700,6 +701,7 @@ public abstract class PlayerList { + Vec3 vec3d = teleporttransition.position(); + + entityplayer1.forceSetPositionRotation(vec3d.x, vec3d.y, vec3d.z, teleporttransition.yRot(), teleporttransition.xRot()); ++ worldserver.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(net.minecraft.util.Mth.floor(vec3d.x()) >> 4, net.minecraft.util.Mth.floor(vec3d.z()) >> 4), 1, entityplayer.getId()); // Paper - post teleport ticket type + // CraftBukkit end + if (teleporttransition.missingRespawnBlock()) { + entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F)); diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java index ae25aec117a7272735c824a00c1ed117fa52a921..d6e942aca1bcc769c390504a4119d6619872c4d4 100644 --- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java |