diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index b818b96e27..2a6e32ff20 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -8,3 +8,5 @@ # To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java + +minecraft net.minecraft.WorldVersion diff --git a/build.gradle.kts b/build.gradle.kts index 11609e3881..f358c8b36a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.0" apply false - id("io.papermc.paperweight.core") version "1.5.2" + id("io.papermc.paperweight.core") version "1.5.3" } allprojects { diff --git a/patches/unapplied/server/Add-TickThread.patch b/patches/server/Add-TickThread.patch similarity index 100% rename from patches/unapplied/server/Add-TickThread.patch rename to patches/server/Add-TickThread.patch diff --git a/patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch similarity index 100% rename from patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch rename to patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch diff --git a/patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/Add-configurable-despawn-distances-for-living-entiti.patch similarity index 94% rename from patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/Add-configurable-despawn-distances-for-living-entiti.patch index c7d27a86ea..d76f287d38 100644 --- a/patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch +++ b/patches/server/Add-configurable-despawn-distances-for-living-entiti.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/patches/unapplied/server/Add-version-history-to-version-command.patch b/patches/server/Add-version-history-to-version-command.patch similarity index 100% rename from patches/unapplied/server/Add-version-history-to-version-command.patch rename to patches/server/Add-version-history-to-version-command.patch diff --git a/patches/unapplied/server/Adventure.patch b/patches/server/Adventure.patch similarity index 99% rename from patches/unapplied/server/Adventure.patch rename to patches/server/Adventure.patch index baea0ccec2..6dcff7c5e8 100644 --- a/patches/unapplied/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -1589,11 +1589,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder> { } else { FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf); - friendlyByteBuf.writeVarInt(integer); + friendlyByteBuf.writeVarInt(i); + friendlyByteBuf.adventure$locale = channelHandlerContext.channel().attr(PaperAdventure.LOCALE_ATTRIBUTE).get(); // Paper try { - int i = friendlyByteBuf.writerIndex(); + int j = friendlyByteBuf.writerIndex(); diff --git a/src/main/java/net/minecraft/network/chat/ChatDecorator.java b/src/main/java/net/minecraft/network/chat/ChatDecorator.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/chat/ChatDecorator.java @@ -2274,14 +2274,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.broadcastChatMessage(playerchatmessage1); }, this.server.chatExecutor); // CraftBukkit - async chat @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); - return Optional.empty(); - } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales -- this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); -+ this.send(new ClientboundSystemChatPacket(PaperAdventure.asAdventure(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED)), false)); // Paper - Adventure - return Optional.empty(); - } else { Optional optional = this.unpackAndApplyLastSeen(acknowledgment); + + if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales +- this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); ++ this.send(new ClientboundSystemChatPacket(PaperAdventure.asAdventure(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED)), false)); // Paper - Adventure + return Optional.empty(); + } else { + this.player.resetLastActionTime(); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { @@ -2379,8 +2379,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 CraftIconCache icon = server.server.getServerIcon(); ServerListPingEvent() { -- super(connection.hostname, ((InetSocketAddress) ServerStatusPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(), ServerStatusPacketListenerImpl.this.server.getMotd(), ServerStatusPacketListenerImpl.this.server.getPlayerList().getMaxPlayers()); -+ super(connection.hostname, ((InetSocketAddress) ServerStatusPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(), ServerStatusPacketListenerImpl.this.server.server.motd(), ServerStatusPacketListenerImpl.this.server.getPlayerList().getMaxPlayers()); // Paper - Adventure +- super(connection.hostname, ((InetSocketAddress) ServerStatusPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(), server.getMotd(), server.getPlayerList().getMaxPlayers()); ++ super(connection.hostname, ((InetSocketAddress) ServerStatusPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(), server.server.motd(), server.getPlayerList().getMaxPlayers()); // Paper - Adventure } @Override @@ -2404,7 +2404,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Component joinMessage = ichatmutablecomponent; // Paper - Adventure playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); - player.sendServerStatus(this.server.getStatus()); + ServerStatus serverping = this.server.getStatus(); @@ -0,0 +0,0 @@ public abstract class PlayerList { // Ensure that player inventory is populated with its viewer player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); @@ -2413,7 +2413,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(bukkitPlayer, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure this.cserver.getPluginManager().callEvent(playerJoinEvent); - if (!player.connection.connection.isConnected()) { + if (!player.connection.isAcceptingMessages()) { return; } diff --git a/patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch b/patches/server/Allow-for-toggling-of-spawn-chunks.patch similarity index 100% rename from patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/Allow-for-toggling-of-spawn-chunks.patch diff --git a/patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch similarity index 93% rename from patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch rename to patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index 92dc643a4c..ec08abdd37 100644 --- a/patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public GoalSelector targetSelector; @Nullable private LivingEntity target; -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override protected final void serverAiStep() { ++this.noActionTime; diff --git a/patches/unapplied/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch similarity index 96% rename from patches/unapplied/server/Build-system-changes.patch rename to patches/server/Build-system-changes.patch index 3d8da87d0e..42849a7c26 100644 --- a/patches/unapplied/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") - runtimeOnly("mysql:mysql-connector-java:8.0.29") + runtimeOnly("com.mysql:mysql-connector-j:8.0.32") @@ -0,0 +0,0 @@ dependencies { testImplementation("junit:junit:4.13.2") @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty } - val craftbukkitPackageVersion = "1_19_R2" // Paper + val craftbukkitPackageVersion = "1_19_R3" // Paper @@ -0,0 +0,0 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" @@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -28); + deadline.add(Calendar.DAY_OF_YEAR, -3); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/unapplied/server/CB-fixes.patch b/patches/server/CB-fixes.patch similarity index 98% rename from patches/unapplied/server/CB-fixes.patch rename to patches/server/CB-fixes.patch index 541cb59c34..128a77f0d2 100644 --- a/patches/unapplied/server/CB-fixes.patch +++ b/patches/server/CB-fixes.patch @@ -38,9 +38,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override - protected void addPassenger(Entity passenger) { -+ protected boolean addPassenger(Entity passenger) { // Paper - fix upstream - passenger.stopRiding(); -+ return false; // Paper - fix upstream +- throw new IllegalStateException("Should never addPassenger without checking couldAcceptPassenger()"); ++ protected boolean addPassenger(Entity passenger) { // Paper - fix return type ++ return false; // Paper } @Override diff --git a/patches/unapplied/server/ConcurrentUtil.patch b/patches/server/ConcurrentUtil.patch similarity index 100% rename from patches/unapplied/server/ConcurrentUtil.patch rename to patches/server/ConcurrentUtil.patch diff --git a/patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch b/patches/server/Configurable-baby-zombie-movement-speed.patch similarity index 100% rename from patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch rename to patches/server/Configurable-baby-zombie-movement-speed.patch diff --git a/patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch similarity index 100% rename from patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch diff --git a/patches/unapplied/server/Configurable-fishing-time-ranges.patch b/patches/server/Configurable-fishing-time-ranges.patch similarity index 100% rename from patches/unapplied/server/Configurable-fishing-time-ranges.patch rename to patches/server/Configurable-fishing-time-ranges.patch diff --git a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 97% rename from patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch index 0b8acadb65..9a7d8defd7 100644 --- a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -31,7 +31,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity { +@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity { } this.move(MoverType.SELF, this.getDeltaMovement()); diff --git a/patches/unapplied/server/Entity-Origin-API.patch b/patches/server/Entity-Origin-API.patch similarity index 98% rename from patches/unapplied/server/Entity-Origin-API.patch rename to patches/server/Entity-Origin-API.patch index e99cef95d1..f8faf46245 100644 --- a/patches/unapplied/server/Entity-Origin-API.patch +++ b/patches/server/Entity-Origin-API.patch @@ -116,7 +116,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity { +@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity { @Override protected void readAdditionalSaveData(CompoundTag nbt) { this.setFuse(nbt.getShort("Fuse")); diff --git a/patches/unapplied/server/Further-improve-server-tick-loop.patch b/patches/server/Further-improve-server-tick-loop.patch similarity index 100% rename from patches/unapplied/server/Further-improve-server-tick-loop.patch rename to patches/server/Further-improve-server-tick-loop.patch diff --git a/patches/unapplied/server/Implement-Paper-VersionChecker.patch b/patches/server/Implement-Paper-VersionChecker.patch similarity index 100% rename from patches/unapplied/server/Implement-Paper-VersionChecker.patch rename to patches/server/Implement-Paper-VersionChecker.patch diff --git a/patches/unapplied/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch similarity index 92% rename from patches/unapplied/server/MC-Dev-fixes.patch rename to patches/server/MC-Dev-fixes.patch index 40857846df..0eb27496ed 100644 --- a/patches/unapplied/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -52,19 +52,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return registry; } -diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/nbt/NbtUtils.java -+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java -@@ -0,0 +0,0 @@ public final class NbtUtils { - } - - public static CompoundTag update(DataFixer fixer, DataFixTypes fixTypes, CompoundTag compound, int oldVersion, int targetVersion) { -- return fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); -+ return (CompoundTag) fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); // Paper - decompile fix - } - - public static Component toPrettyComponent(Tag element) { diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java @@ -74,8 +61,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (string instanceof TranslatableContents) { TranslatableContents translatableContents = (TranslatableContents)string; - String string = translatableContents.getKey(); -- return Language.getInstance().has(string); -+ return Language.getInstance().has(translatableContents.getKey()); // Paper - decompile fix + String string2 = translatableContents.getFallback(); +- return string2 != null || Language.getInstance().has(string); ++ return string2 != null || Language.getInstance().has(translatableContents.getKey()); // Paper - decompile fix } } diff --git a/patches/unapplied/server/MC-Utils.patch b/patches/server/MC-Utils.patch similarity index 99% rename from patches/unapplied/server/MC-Utils.patch rename to patches/server/MC-Utils.patch index 5ec64525be..f7d311c6b1 100644 --- a/patches/unapplied/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -5446,6 +5446,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public static long getEpochMillis() { +diff --git a/src/main/java/net/minecraft/WorldVersion.java b/src/main/java/net/minecraft/WorldVersion.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/WorldVersion.java ++++ b/src/main/java/net/minecraft/WorldVersion.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.storage.DataVersion; + + public interface WorldVersion { + DataVersion getDataVersion(); ++ // Paper start ++ default int getWorldVersion() { ++ return this.getDataVersion().getVersion(); ++ } ++ // Paper end + + String getId(); + diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java @@ -5495,11 +5511,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java @@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder> { - JvmProfiler.INSTANCE.onPacketSent(k, integer, channelHandlerContext.channel().remoteAddress(), j); + JvmProfiler.INSTANCE.onPacketSent(l, i, channelHandlerContext.channel().remoteAddress(), k); } } catch (Throwable var10) { -- LOGGER.error("Error receiving packet {}", integer, var10); -+ LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", integer, packet.isSkippable(), var10); // Paper - Give proper error message +- LOGGER.error("Error receiving packet {}", i, var10); ++ LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var10); // Paper - Give proper error message if (packet.isSkippable()) { throw new SkipPacketException(var10); } else { @@ -5540,7 +5556,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - + io.papermc.paper.util.CachedLists.reset(); // Paper this.profiler.push("tallying"); - long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; + long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop WorldDataServer public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { - // Holder holder = worlddimension.type(); // CraftBukkit - decompile error + // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -6541,7 +6557,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - this.maxUpStep = 1.0F; + this.setMaxUpStep(1.0F); this.fudgeSpawnLocation(world); + this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper @@ -6642,7 +6658,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { public boolean collides = true; public Set collidableExemptions = new HashSet<>(); public boolean bukkitPickUpLoot; @@ -6654,7 +6670,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { return this.target; } diff --git a/patches/unapplied/server/Only-refresh-abilities-if-needed.patch b/patches/server/Only-refresh-abilities-if-needed.patch similarity index 100% rename from patches/unapplied/server/Only-refresh-abilities-if-needed.patch rename to patches/server/Only-refresh-abilities-if-needed.patch diff --git a/patches/unapplied/server/Paper-Metrics.patch b/patches/server/Paper-Metrics.patch similarity index 100% rename from patches/unapplied/server/Paper-Metrics.patch rename to patches/server/Paper-Metrics.patch diff --git a/patches/unapplied/server/Paper-Plugins.patch b/patches/server/Paper-Plugins.patch similarity index 100% rename from patches/unapplied/server/Paper-Plugins.patch rename to patches/server/Paper-Plugins.patch diff --git a/patches/unapplied/server/Paper-command.patch b/patches/server/Paper-command.patch similarity index 100% rename from patches/unapplied/server/Paper-command.patch rename to patches/server/Paper-command.patch diff --git a/patches/unapplied/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch similarity index 99% rename from patches/unapplied/server/Paper-config-files.patch rename to patches/server/Paper-config-files.patch index 07918775b5..ddb117706e 100644 --- a/patches/unapplied/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") - runtimeOnly("mysql:mysql-connector-java:8.0.29") + runtimeOnly("com.mysql:mysql-connector-j:8.0.32") diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 @@ -4417,17 +4417,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -0,0 +0,0 @@ public class Main { - DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support - dedicatedserversettings.forceSave(); + Path path2 = Paths.get("eula.txt"); + Eula eula = new Eula(path2); + // Paper start - load config files for access below if needed + org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings")); + org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings")); + // Paper end -+ - Path path1 = Paths.get("eula.txt"); - Eula eula = new Eula(path1); + if (optionset.has("initSettings")) { // CraftBukkit + // CraftBukkit start - SPIGOT-5761: Create bukkit.yml and commands.yml if not present @@ -0,0 +0,0 @@ public class Main { } @@ -4527,11 +4526,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // Holder holder = worlddimension.type(); // CraftBukkit - decompile error + // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error -- super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env); -+ super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig))); // Paper +- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env); ++ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig))); // Paper this.pvpMode = minecraftserver.isPvpAllowed(); this.convertable = convertable_conversionsession; this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); @@ -4556,8 +4555,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public abstract ResourceKey getTypeKey(); -- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) { -+ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator) { // Paper +- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) { ++ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator) { // Paper this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot + this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper this.generator = gen; diff --git a/patches/unapplied/server/Player-affects-spawning-API.patch b/patches/server/Player-affects-spawning-API.patch similarity index 98% rename from patches/unapplied/server/Player-affects-spawning-API.patch rename to patches/server/Player-affects-spawning-API.patch index 08eeb9f839..1877634781 100644 --- a/patches/unapplied/server/Player-affects-spawning-API.patch +++ b/patches/server/Player-affects-spawning-API.patch @@ -24,7 +24,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -77,9 +77,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - private Optional lastDeathLocation; @Nullable public FishingHook fishing; + protected float hurtDir; + // Paper start + public boolean affectsSpawning = true; + // Paper end diff --git a/patches/unapplied/server/Remap-fixes.patch b/patches/server/Remap-fixes.patch similarity index 91% rename from patches/unapplied/server/Remap-fixes.patch rename to patches/server/Remap-fixes.patch index 51167471be..d1d3e16cd4 100644 --- a/patches/unapplied/server/Remap-fixes.patch +++ b/patches/server/Remap-fixes.patch @@ -41,21 +41,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ChunkMap.java -+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - LevelChunk chunk1; - - if (chunk instanceof LevelChunk) { -- LevelChunk chunk1 = (LevelChunk) chunk; -- -- chunk1 = chunk1; -+ chunk1 = (LevelChunk) chunk; // Paper - remap fix - } else { - chunk1 = this.level.getChunk(chunkcoordintpair.x, chunkcoordintpair.z); - } diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtils.java diff --git a/patches/unapplied/server/Rewrite-chunk-system.patch b/patches/server/Rewrite-chunk-system.patch similarity index 99% rename from patches/unapplied/server/Rewrite-chunk-system.patch rename to patches/server/Rewrite-chunk-system.patch index 7fced7d63f..46f6ef1db4 100644 --- a/patches/unapplied/server/Rewrite-chunk-system.patch +++ b/patches/server/Rewrite-chunk-system.patch @@ -13471,7 +13471,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static ChunkStatus getStatus(int level) { return level < 33 ? ChunkStatus.FULL : ChunkStatus.getStatusAroundFullChunk(level - 33); @@ -0,0 +0,0 @@ public class ChunkHolder { - return ChunkHolder.FULL_CHUNK_STATUSES[Mth.clamp(33 - distance + 1, (int) 0, ChunkHolder.FULL_CHUNK_STATUSES.length - 1)]; + return ChunkHolder.FULL_CHUNK_STATUSES[Mth.clamp(33 - distance + 1, 0, ChunkHolder.FULL_CHUNK_STATUSES.length - 1)]; } - public boolean wasAccessibleSinceLastSave() { @@ -14311,7 +14311,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - replace player loader system public void setViewDistance(int watchDistance) { - int j = Mth.clamp(watchDistance + 1, (int) 3, (int) 33); + int j = Mth.clamp(watchDistance + 1, 3, 33); @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int k = this.viewDistance; @@ -17286,8 +17286,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } - - }); -- CompoundTag compoundTag = new CompoundTag(); -- compoundTag.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion()); +- CompoundTag compoundTag = NbtUtils.addCurrentDataVersion(new CompoundTag()); - compoundTag.put("Entities", listTag); - writeChunkPos(compoundTag, chunkPos); - this.worker.store(chunkPos, compoundTag).exceptionally((ex) -> { @@ -17321,6 +17320,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!force && entities.isEmpty()) { + return null; + } ++ + ListTag listTag = new ListTag(); + entities.forEach((entity) -> { // diff here: use entities parameter + CompoundTag compoundTag = new CompoundTag(); @@ -17329,10 +17329,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + }); -+ CompoundTag compoundTag = new CompoundTag(); -+ compoundTag.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion()); ++ CompoundTag compoundTag = NbtUtils.addCurrentDataVersion(new CompoundTag()); + compoundTag.put("Entities", listTag); + writeChunkPos(compoundTag, chunkPos); ++ // Paper - remove worker usage + + return !force && listTag.isEmpty() ? null : compoundTag; + } @@ -17347,10 +17347,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private CompoundTag upgradeChunkTag(CompoundTag chunkNbt) { + public static CompoundTag upgradeChunkTag(CompoundTag chunkNbt) { // Paper - public and static - int i = getVersion(chunkNbt); - return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - route to new converter system + int i = NbtUtils.getDataVersion(chunkNbt, -1); + return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, net.minecraft.SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - route to new converter system } -@@ -0,0 +0,0 @@ public class EntityStorage implements EntityPersistentStorage { @Override public void close() throws IOException { diff --git a/patches/unapplied/server/Rewrite-dataconverter-system.patch b/patches/server/Rewrite-dataconverter-system.patch similarity index 99% rename from patches/unapplied/server/Rewrite-dataconverter-system.patch rename to patches/server/Rewrite-dataconverter-system.patch index 6560c04bed..59c3c2a9f9 100644 --- a/patches/unapplied/server/Rewrite-dataconverter-system.patch +++ b/patches/server/Rewrite-dataconverter-system.patch @@ -22841,7 +22841,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end if (i < 1493) { -- nbttagcompound = NbtUtils.update(this.fixerUpper, DataFixTypes.CHUNK, nbttagcompound, i, 1493); +- nbttagcompound = DataFixTypes.CHUNK.update(this.fixerUpper, nbttagcompound, i, 1493); + ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.CHUNK, nbttagcompound, i, 1493); // Paper - replace chunk converter if (nbttagcompound.getCompound("Level").getBoolean("hasLegacyStructureData")) { LegacyStructureDataHandler persistentstructurelegacy = this.getLegacyStructureHandler(resourcekey, supplier); @@ -22850,10 +22850,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Spigot end ChunkStorage.injectDatafixingContext(nbttagcompound, resourcekey, optional); -- nbttagcompound = NbtUtils.update(this.fixerUpper, DataFixTypes.CHUNK, nbttagcompound, Math.max(1493, i)); +- nbttagcompound = DataFixTypes.CHUNK.updateToCurrentVersion(this.fixerUpper, nbttagcompound, Math.max(1493, i)); + nbttagcompound = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.CHUNK, nbttagcompound, Math.max(1493, i), SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - replace chunk converter - if (i < SharedConstants.getCurrentVersion().getWorldVersion()) { - nbttagcompound.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion()); + if (i < SharedConstants.getCurrentVersion().getDataVersion().getVersion()) { + NbtUtils.addCurrentDataVersion(nbttagcompound); } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -22862,27 +22862,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class EntityStorage implements EntityPersistentStorage { private CompoundTag upgradeChunkTag(CompoundTag chunkNbt) { - int i = getVersion(chunkNbt); -- return NbtUtils.update(this.fixerUpper, DataFixTypes.ENTITY_CHUNK, chunkNbt, i); -+ return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - route to new converter system + int i = NbtUtils.getDataVersion(chunkNbt, -1); +- return DataFixTypes.ENTITY_CHUNK.updateToCurrentVersion(this.fixerUpper, chunkNbt, i); ++ return ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ENTITY_CHUNK, chunkNbt, i, net.minecraft.SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - route to new converter system } - public static int getVersion(CompoundTag chunkNbt) { + @Override diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java @@ -0,0 +0,0 @@ public class SectionStorage implements AutoCloseable { int j = getVersion(dynamic); - int k = SharedConstants.getCurrentVersion().getWorldVersion(); + int k = SharedConstants.getCurrentVersion().getDataVersion().getVersion(); boolean bl = j != k; -- Dynamic dynamic2 = this.fixerUpper.update(this.type.getType(), dynamic, j, k); +- 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) { + 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.fixerUpper.update(this.type.getType(), dynamic, j, k); ++ dynamic2 = this.type.update(this.fixerUpper, dynamic, j, k); + } + // Paper end - route to new converter system OptionalDynamic optionalDynamic = dynamic2.get("Sections"); @@ -22896,7 +22896,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 CompoundTag compoundTag2; try { -- compoundTag2 = NbtUtils.update(this.fixerUpper, DataFixTypes.CHUNK, compoundTag, i); +- compoundTag2 = DataFixTypes.CHUNK.updateToCurrentVersion(this.fixerUpper, compoundTag, i); + compoundTag2 = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.CHUNK, compoundTag, i, net.minecraft.SharedConstants.getCurrentVersion().getWorldVersion()); // Paper - replace chunk converter } catch (Exception var12) { LOGGER.warn("Failed to partially datafix chunk {}", pos, var12); @@ -22907,9 +22907,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java @@ -0,0 +0,0 @@ public class PlayerDataStorage { // CraftBukkit end - int i = nbttagcompound.contains("DataVersion", 3) ? nbttagcompound.getInt("DataVersion") : -1; + int i = NbtUtils.getDataVersion(nbttagcompound, -1); -- player.load(NbtUtils.update(this.fixerUpper, DataFixTypes.PLAYER, nbttagcompound, i)); +- player.load(DataFixTypes.PLAYER.updateToCurrentVersion(this.fixerUpper, nbttagcompound, i)); + player.load(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.PLAYER, nbttagcompound, i, net.minecraft.SharedConstants.getCurrentVersion().getWorldVersion())); // Paper - replace player converter } diff --git a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch similarity index 99% rename from patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 559e975483..f8d0466902 100644 --- a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -28); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); diff --git a/patches/unapplied/server/Starlight.patch b/patches/server/Starlight.patch similarity index 99% rename from patches/unapplied/server/Starlight.patch rename to patches/server/Starlight.patch index 5d8c63684b..925f76aa8e 100644 --- a/patches/unapplied/server/Starlight.patch +++ b/patches/server/Starlight.patch @@ -4825,7 +4825,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { this.emissiveRendering = blockbase_info.emissiveRendering; - this.offsetType = (BlockBehaviour.OffsetType) blockbase_info.offsetType.apply(this.asState()); + this.offsetFunction = blockbase_info.offsetFunction; this.spawnParticlesOnBreak = blockbase_info.spawnParticlesOnBreak; + this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper } @@ -5215,7 +5215,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ca.spottedleaf.starlight.common.light.SWMRNibbleArray[] skyNibbles = chunk.getSkyNibbles(); + // Paper end - rewrite light impl ChunkPos chunkcoordintpair = chunk.getPos(); - CompoundTag nbttagcompound = new CompoundTag(); + CompoundTag nbttagcompound = NbtUtils.addCurrentDataVersion(new CompoundTag()); @@ -0,0 +0,0 @@ public class ChunkSerializer { for (int i = lightenginethreaded.getMinLightSection(); i < lightenginethreaded.getMaxLightSection(); ++i) { diff --git a/patches/unapplied/server/Test-changes.patch b/patches/server/Test-changes.patch similarity index 99% rename from patches/unapplied/server/Test-changes.patch rename to patches/server/Test-changes.patch index d5788c3d13..a7a1047cd3 100644 --- a/patches/unapplied/server/Test-changes.patch +++ b/patches/server/Test-changes.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") - runtimeOnly("mysql:mysql-connector-java:8.0.29") + runtimeOnly("com.mysql:mysql-connector-j:8.0.32") diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/unapplied/server/Timings-v2.patch b/patches/server/Timings-v2.patch similarity index 98% rename from patches/unapplied/server/Timings-v2.patch rename to patches/server/Timings-v2.patch index 5193963dc0..6edc23bb0a 100644 --- a/patches/unapplied/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -721,7 +721,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class PacketUtils { engine.executeIfPossible(() -> { if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590 - if (listener.getConnection().isConnected()) { + if (listener.isAcceptingMessages()) { - try { + co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings + try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings @@ -821,10 +821,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end this.profiler.push("tallying"); - long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; + long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop