diff --git a/patches/api/Missing-Entity-Behavior-API.patch b/patches/api/Missing-Entity-Behavior-API.patch index 42a9998fa3..ff58445a1a 100644 --- a/patches/api/Missing-Entity-Behavior-API.patch +++ b/patches/api/Missing-Entity-Behavior-API.patch @@ -1238,14 +1238,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Gets the number of ticks that this hopper minecart cannot pickup items up for. + * + * @return ticks left on cooldown ++ * @deprecated Hopper minecarts don't have cooldowns anymore + */ ++ @Deprecated(forRemoval = true) + int getPickupCooldown(); + + /** + * Sets the number of ticks that this hopper minecart cannot pickup items for. + * + * @param cooldown cooldown length in ticks ++ * @deprecated Hopper minecarts don't have cooldowns anymore + */ ++ @Deprecated(forRemoval = true) + void setPickupCooldown(int cooldown); + // Paper end } diff --git a/patches/api/More-Teleport-API.patch b/patches/api/More-Teleport-API.patch index 6afecaca92..5c5193817f 100644 --- a/patches/api/More-Teleport-API.patch +++ b/patches/api/More-Teleport-API.patch @@ -243,10 +243,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Teleport API + @org.jetbrains.annotations.ApiStatus.Experimental -+ public PlayerTeleportEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to, @NotNull final TeleportCause cause, boolean dismounted, @NotNull java.util.Set teleportFlagSet) { ++ public PlayerTeleportEvent(@NotNull final Player player, @NotNull final Location from, @Nullable final Location to, @NotNull final TeleportCause cause, @NotNull java.util.Set teleportFlagSet) { + super(player, from, to); -+ -+ this.dismounted = dismounted; + this.teleportFlagSet = teleportFlagSet; + this.cause = cause; + } @@ -264,8 +262,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Gets if the player will be dismounted in this teleportation. + * + * @return dismounted or not ++ * @deprecated dismounting on tp is no longer controlled by the server + */ -+ @org.jetbrains.annotations.ApiStatus.Experimental ++ @Deprecated(forRemoval = true) + public boolean willDismountPlayer() { + return this.dismounted; + } diff --git a/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch index a8c4a7675a..96fd41be15 100644 --- a/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch +++ b/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch @@ -4,19 +4,6 @@ Date: Sun, 8 Aug 2021 19:56:02 +0200 Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent -diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java -+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java -@@ -0,0 +0,0 @@ public class WorkAtComposter extends WorkAtPoi { - i -= p; - - for(int q = 0; q < p; ++q) { -- blockState = ComposterBlock.insertItem(entity, blockState, world, itemStack, blockPos); -+ blockState = ComposterBlock.insertItem(entity, blockState, world, itemStack, blockPos, entity); // Paper - if (blockState.getValue(ComposterBlock.LEVEL) == 7) { - this.spawnComposterFillEffects(world, composterState, blockPos, blockState); - return; diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java diff --git a/patches/server/Add-PrepareResultEvent.patch b/patches/server/Add-PrepareResultEvent.patch index 0007473564..3a455309e8 100644 --- a/patches/server/Add-PrepareResultEvent.patch +++ b/patches/server/Add-PrepareResultEvent.patch @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 super.slotsChanged(inventory); if (inventory == this.inputSlots) { this.createResult(); -+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper ++ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, this instanceof SmithingMenu ? 3 : 2); // Paper } } diff --git a/patches/server/Add-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch index 2eea76241a..870060835f 100644 --- a/patches/server/Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/Add-Velocity-IP-Forwarding-Support.patch @@ -163,7 +163,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); - java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, // Spigot end diff --git a/patches/server/Add-missing-block-data-mins-and-maxes.patch b/patches/server/Add-missing-block-data-mins-and-maxes.patch index 7a882ecb17..e0891c359a 100644 --- a/patches/server/Add-missing-block-data-mins-and-maxes.patch +++ b/patches/server/Add-missing-block-data-mins-and-maxes.patch @@ -21,6 +21,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // org.bukkit.craftbukkit.block.data.CraftLightable +diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java +@@ -0,0 +0,0 @@ public final class CraftCherryLeaves extends org.bukkit.craftbukkit.block.data.C + public void setWaterlogged(boolean waterlogged) { + set(CraftCherryLeaves.WATERLOGGED, waterlogged); + } ++ ++ // Paper start ++ @Override ++ public int getMaximumDistance() { ++ return getMax(DISTANCE); ++ } ++ ++ @Override ++ public int getMinimumDistance() { ++ return getMin(DISTANCE); ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java diff --git a/patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch index 5f9e532f1d..97bc03473a 100644 --- a/patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void fireEvents() throws Exception { String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); -+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper ++ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 96004a9f7c..6fb3fe4ffc 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import net.kyori.adventure.text.minimessage.MiniMessage; +import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; +import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; -+import net.minecraft.Util; ++import net.minecraft.Optionull; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.network.chat.ChatDecorator; +import net.minecraft.server.MinecraftServer; @@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + private ChatDecorator.Result processModern(final ChatDecorator.Result input) { -+ final @Nullable CraftPlayer player = Util.mapNullable(this.player, ServerPlayer::getBukkitEntity); ++ final @Nullable CraftPlayer player = Optionull.map(this.player, ServerPlayer::getBukkitEntity); + + final Component initialResult = input.message().component(); + final AsyncChatDecorateEvent event; @@ -280,6 +280,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import net.kyori.adventure.audience.ForwardingAudience; +import net.kyori.adventure.key.Key; +import net.kyori.adventure.text.Component; ++import net.minecraft.Optionull; +import net.minecraft.Util; +import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.ChatDecorator; @@ -551,7 +552,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (acceptsNative(viewer)) { + this.sendNative(viewer, chatType, msgFunction); + } else { -+ final net.minecraft.network.chat.@Nullable Component unsigned = Util.mapNullable(msgFunction, f -> f.apply(viewer)); ++ final net.minecraft.network.chat.@Nullable Component unsigned = Optionull.map(msgFunction, f -> f.apply(viewer)); + final PlayerChatMessage msg = unsigned == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(unsigned); + viewer.sendMessage(msg.adventureView(), this.adventure(chatType)); + } @@ -601,7 +602,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (viewer instanceof ConsoleCommandSender) { + this.sendToServer(chatType, msgFunction); + } else if (viewer instanceof CraftPlayer craftPlayer) { -+ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Util.mapNullable(msgFunction, f -> f.apply(viewer))); ++ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Optionull.map(msgFunction, f -> f.apply(viewer))); + } else if (viewer instanceof ForwardingAudience.Single single) { + this.sendNative(single.audience(), chatType, msgFunction); + } else { diff --git a/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index ec08abdd37..ccc17c9d1a 100644 --- a/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.getJumpControl().tick(); + } + if (this.isSensitiveToWater() && isInWaterRainOrBubble()) { -+ hurt(DamageSource.DROWN, 1.0F); ++ hurt(this.damageSources().drown(), 1.0F); + } + return; + } diff --git a/patches/server/Allow-to-change-the-podium-for-the-EnderDragon.patch b/patches/server/Allow-to-change-the-podium-for-the-EnderDragon.patch index 6a925178cb..c3d1f2b7cc 100644 --- a/patches/server/Allow-to-change-the-podium-for-the-EnderDragon.patch +++ b/patches/server/Allow-to-change-the-podium-for-the-EnderDragon.patch @@ -144,7 +144,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.getHandle().setPodium(null); + } else { + org.apache.commons.lang.Validate.isTrue(location.getWorld() == null || location.getWorld().equals(getWorld()), "You cannot set a podium in a different world to where the dragon is"); -+ this.getHandle().setPodium(new net.minecraft.core.BlockPos(location.getX(), location.getY(), location.getZ())); ++ this.getHandle().setPodium(io.papermc.paper.util.MCUtil.toBlockPos(location)); + } + } + // Paper end diff --git a/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch index 96bfc9f520..c5c405cf11 100644 --- a/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch +++ b/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + // Paper start -+ private static final int CURRENT_DATA_VERSION = SharedConstants.getCurrentVersion().getDataVersion().getVersion(); ++ private static final int CURRENT_DATA_VERSION = net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion(); + private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); + // Paper end public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) { diff --git a/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index 935106ac41..bfc8a4d50b 100644 --- a/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Nullable private Advancement lastSelectedTab; private boolean isFirstPacket = true; -+ public final Map> criterionData = Maps.newIdentityHashMap(); // Paper - fix advancement data player leakage ++ public final Map> criterionData = new java.util.IdentityHashMap<>(); // Paper - fix advancement data player leakage public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, Path filePath, ServerPlayer owner) { this.dataFixer = dataFixer; diff --git a/patches/server/Implement-extended-PaperServerListPingEvent.patch b/patches/server/Implement-extended-PaperServerListPingEvent.patch index f0380287c7..18f8425c53 100644 --- a/patches/server/Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/Implement-extended-PaperServerListPingEvent.patch @@ -72,24 +72,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import com.google.common.base.Strings; +import com.mojang.authlib.GameProfile; +import io.papermc.paper.adventure.AdventureComponent; ++import java.util.ArrayList; ++import java.util.Collections; +import java.util.List; ++import java.util.Optional; +import java.util.UUID; +import javax.annotation.Nonnull; +import net.minecraft.network.Connection; ++import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket; +import net.minecraft.network.protocol.status.ServerStatus; +import net.minecraft.server.MinecraftServer; ++import org.bukkit.craftbukkit.util.CraftIconCache; + +public final class StandardPaperServerListPingEventImpl extends PaperServerListPingEventImpl { + -+ private static final GameProfile[] EMPTY_PROFILES = new GameProfile[0]; ++ // private static final GameProfile[] EMPTY_PROFILES = new GameProfile[0]; + private static final UUID FAKE_UUID = new UUID(0, 0); + -+ private GameProfile[] originalSample; ++ private List originalSample; + + private StandardPaperServerListPingEventImpl(MinecraftServer server, Connection networkManager, ServerStatus ping) { -+ super(server, new PaperStatusClient(networkManager), ping.getVersion() != null ? ping.getVersion().getProtocol() : -1, server.server.getServerIcon()); -+ this.originalSample = ping.getPlayers() == null ? null : ping.getPlayers().getSample(); // GH-1473 - pre-tick race condition NPE ++ super(server, new PaperStatusClient(networkManager), ping.version().map(ServerStatus.Version::protocol).orElse(-1), server.server.getServerIcon()); ++ this.originalSample = ping.players().map(ServerStatus.Players::sample).orElse(null); // GH-1473 - pre-tick race condition NPE + } + + @Nonnull @@ -107,18 +112,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return sample; + } + -+ private GameProfile[] getPlayerSampleHandle() { ++ private List getPlayerSampleHandle() { + if (this.originalSample != null) { + return this.originalSample; + } + + List entries = super.getPlayerSample(); + if (entries.isEmpty()) { -+ return EMPTY_PROFILES; ++ return Collections.emptyList(); + } + -+ GameProfile[] profiles = new GameProfile[entries.size()]; -+ for (int i = 0; i < profiles.length; i++) { ++ final List profiles = new ArrayList<>(); ++ for (PlayerProfile profile : entries) { + /* + * Avoid null UUIDs/names since that will make the response invalid + * on the client. @@ -126,19 +131,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * This can be used to create custom lines in the player list that do not + * refer to a specific player. + */ -+ -+ PlayerProfile profile = entries.get(i); + if (profile.getId() != null && profile.getName() != null) { -+ profiles[i] = CraftPlayerProfile.asAuthlib(profile); ++ profiles.add(CraftPlayerProfile.asAuthlib(profile)); + } else { -+ profiles[i] = new GameProfile(MoreObjects.firstNonNull(profile.getId(), FAKE_UUID), Strings.nullToEmpty(profile.getName())); ++ profiles.add(new GameProfile(MoreObjects.firstNonNull(profile.getId(), FAKE_UUID), Strings.nullToEmpty(profile.getName()))); + } + } -+ + return profiles; + } + -+ @SuppressWarnings("deprecation") + public static void processRequest(MinecraftServer server, Connection networkManager) { + StandardPaperServerListPingEventImpl event = new StandardPaperServerListPingEventImpl(server, networkManager, server.getStatus()); + server.server.getPluginManager().callEvent(event); @@ -150,24 +151,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + // Setup response -+ ServerStatus ping = new ServerStatus(); + + // Description -+ ping.setDescription(new AdventureComponent(event.motd())); ++ final Component description = new AdventureComponent(event.motd()); + + // Players ++ final Optional players; + if (!event.shouldHidePlayers()) { -+ ping.setPlayers(new ServerStatus.Players(event.getMaxPlayers(), event.getNumPlayers())); -+ ping.getPlayers().setSample(event.getPlayerSampleHandle()); ++ players = Optional.of(new ServerStatus.Players(event.getMaxPlayers(), event.getNumPlayers(), event.getPlayerSampleHandle())); ++ } else { ++ players = Optional.empty(); + } + + // Version -+ ping.setVersion(new ServerStatus.Version(event.getVersion(), event.getProtocolVersion())); ++ final ServerStatus.Version version = new ServerStatus.Version(event.getVersion(), event.getProtocolVersion()); + + // Favicon ++ final Optional favicon; + if (event.getServerIcon() != null) { -+ ping.setFavicon(event.getServerIcon().getData()); ++ favicon = Optional.of(new ServerStatus.Favicon(((CraftIconCache) event.getServerIcon()).value)); ++ } else { ++ favicon = Optional.empty(); + } ++ final ServerStatus ping = new ServerStatus(description, players, Optional.of(version), favicon, server.enforceSecureProfile()); + + // Send response + networkManager.send(new ClientboundStatusResponsePacket(ping)); @@ -215,7 +221,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.connection.send(new ClientboundStatusResponsePacket(ping)); // CraftBukkit end + */ -+ com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection); ++ com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(MinecraftServer.getServer(), this.connection); + // Paper end } } diff --git a/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch index ca624a0b94..3e92efb9eb 100644 --- a/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch @@ -719,6 +719,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public CraftLootable(World world, T tileEntity) { super(world, tileEntity); +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSuspiciousSand.java +@@ -0,0 +0,0 @@ public class CraftSuspiciousSand extends CraftBlockEntityState relativeFlags = java.util.EnumSet.noneOf(io.papermc.paper.entity.TeleportFlag.Relative.class); -+ for (net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument relativeArgument : set) { ++ for (RelativeMovement relativeArgument : set) { + relativeFlags.add(org.bukkit.craftbukkit.entity.CraftPlayer.toApiRelativeFlag(relativeArgument)); + } -+ PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, flag, java.util.Set.copyOf(relativeFlags)); ++ PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags)); + // Paper end this.cserver.getPluginManager().callEvent(event); diff --git a/patches/server/More-World-API.patch b/patches/server/More-World-API.patch index 43b21c0be9..d9eecfcc3a 100644 --- a/patches/server/More-World-API.patch +++ b/patches/server/More-World-API.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public Location locateNearestBiome(Location origin, Biome biome, int radius, int step) { -+ BlockPos originPos = new BlockPos(origin.getX(), origin.getY(), origin.getZ()); ++ BlockPos originPos = io.papermc.paper.util.MCUtil.toBlockPos(origin); + Pair> pair = getHandle().findClosestBiome3d(holder -> holder.is(CraftNamespacedKey.toMinecraft(biome.getKey())), originPos, radius, step, step); + if (pair == null) { + return null; @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + public static net.minecraft.core.BlockPos toBlockPos(org.bukkit.util.Vector bukkit) { -+ return new net.minecraft.core.BlockPos(bukkit.getX(), bukkit.getY(), bukkit.getZ()); ++ return net.minecraft.core.BlockPos.containing(bukkit.getX(), bukkit.getY(), bukkit.getZ()); + } + // Paper end } diff --git a/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch index dda82b18c4..1840822982 100644 --- a/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch +++ b/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch @@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 CraftItemStack result = CraftItemStack.asCraftMirror(this.result); - CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition)); -+ CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition), this.copyNbt); // Paper ++ CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition), this.copyNBT); // Paper return recipe; } diff --git a/patches/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch index f368750ddf..b99f6cde4d 100644 --- a/patches/server/Player.setPlayerProfile-API.patch +++ b/patches/server/Player.setPlayerProfile-API.patch @@ -136,7 +136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + for (ServerPlayer player : players) { + CraftPlayer bukkitPlayer = player.getBukkitEntity(); + if (bukkitPlayer.canSee(this)) { -+ bukkitPlayer.trackAndShowEntity(self); ++ bukkitPlayer.trackAndShowEntity(self.getBukkitEntity()); + } + } + // Refresh misc player things AFTER sending game profile diff --git a/patches/server/Rewrite-dataconverter-system.patch b/patches/server/Rewrite-dataconverter-system.patch index fd860f3e3d..468967abd7 100644 --- a/patches/server/Rewrite-dataconverter-system.patch +++ b/patches/server/Rewrite-dataconverter-system.patch @@ -23142,7 +23142,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - Dynamic dynamic2 = this.type.update(this.fixerUpper, dynamic, j, k); + // Paper start - route to new converter system + Dynamic dynamic2; -+ if (this.type.getType() == net.minecraft.util.datafix.fixes.References.POI_CHUNK) { ++ if (this.type == net.minecraft.util.datafix.DataFixTypes.POI_CHUNK) { + dynamic2 = new Dynamic<>(dynamic.getOps(), (T)ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.POI_CHUNK, (CompoundTag)dynamic.getValue(), j, k)); + } else { + dynamic2 = this.type.update(this.fixerUpper, dynamic, j, k); diff --git a/patches/server/Use-single-player-info-update-packet-on-join.patch b/patches/server/Use-single-player-info-update-packet-on-join.patch index 67451cc3a5..08c33f4cf6 100644 --- a/patches/server/Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/Use-single-player-info-update-packet-on-join.patch @@ -58,16 +58,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 player.sentListPacket = true; player.supressTrackerForLogin = false; // Paper ((ServerLevel)player.level).getChunkSource().chunkMap.addEntity(player); // Paper - track entity now -diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java -+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java -@@ -0,0 +0,0 @@ public class DamageSources { - public DamageSource sonicBoom(Entity attacker) { - return this.source(DamageTypes.SONIC_BOOM, attacker); - } -- -- public DamageSource badRespawnPointExplosion(Vec3 position) { -- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position); -- } - } diff --git a/patches/server/add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/add-isDeeplySleeping-to-HumanEntity.patch index 42f780666f..9ad688a7d1 100644 --- a/patches/server/add-isDeeplySleeping-to-HumanEntity.patch +++ b/patches/server/add-isDeeplySleeping-to-HumanEntity.patch @@ -13,6 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper end + // Paper start ++ @Override + public boolean isDeeplySleeping() { + return getHandle().isSleepingLongEnough(); + }