From 7f1e33effeb31ce6ea0758838f176cab9d4bd934 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 23 Apr 2024 11:03:16 -0700 Subject: [PATCH] do some work --- .../{unapplied => }/server/Adventure.patch | 0 patches/{unapplied => }/server/CB-fixes.patch | 20 ++-- .../server/ConcurrentUtil.patch | 0 .../{unapplied => }/server/MC-Dev-fixes.patch | 39 +------ patches/{unapplied => }/server/MC-Utils.patch | 106 ++++++++---------- .../server/Paper-config-files.patch | 8 +- .../{unapplied => }/server/Test-changes.patch | 2 +- 7 files changed, 67 insertions(+), 108 deletions(-) rename patches/{unapplied => }/server/Adventure.patch (100%) rename patches/{unapplied => }/server/CB-fixes.patch (91%) rename patches/{unapplied => }/server/ConcurrentUtil.patch (100%) rename patches/{unapplied => }/server/MC-Dev-fixes.patch (65%) rename patches/{unapplied => }/server/MC-Utils.patch (98%) rename patches/{unapplied => }/server/Paper-config-files.patch (99%) rename patches/{unapplied => }/server/Test-changes.patch (99%) diff --git a/patches/unapplied/server/Adventure.patch b/patches/server/Adventure.patch similarity index 100% rename from patches/unapplied/server/Adventure.patch rename to patches/server/Adventure.patch diff --git a/patches/unapplied/server/CB-fixes.patch b/patches/server/CB-fixes.patch similarity index 91% rename from patches/unapplied/server/CB-fixes.patch rename to patches/server/CB-fixes.patch index 2039980fb4..55dc47052c 100644 --- a/patches/unapplied/server/CB-fixes.patch +++ b/patches/server/CB-fixes.patch @@ -38,13 +38,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override - // CraftBukkit start - void -> boolean -- protected boolean actuallyHurt(DamageSource damagesource, float f) { +- public boolean actuallyHurt(DamageSource damagesource, float f) { - boolean hurt = super.actuallyHurt(damagesource, f); - if (!hurt) { - return hurt; - } - // CraftBukkit end -+ protected boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean ++ public boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean this.standUpInstantly(); - return hurt; // CraftBukkit + return super.actuallyHurt(damagesource, f); // Paper - change return type to boolean @@ -56,8 +56,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java @@ -0,0 +0,0 @@ public class StructureCheck { - private final Registry biomes; - private final Registry structureConfigs; + private final ChunkScanAccess storageAccess; + private final RegistryAccess registryAccess; private final StructureTemplateManager structureTemplateManager; - private final ResourceKey dimension; + private final ResourceKey dimension; // Paper - fix missing CB diff @@ -96,11 +96,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public final class CraftServer implements Server { Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null"); - LootDataManager registry = this.getServer().getLootData(); -- return new CraftLootTable(key, registry.getLootTable(CraftNamespacedKey.toMinecraft(key))); + ReloadableServerRegistries.Holder registry = this.getServer().reloadableRegistries(); +- return new CraftLootTable(key, registry.getLootTable(CraftLootTable.bukkitKeyToMinecraft(key))); + // Paper start - honor method contract -+ final ResourceLocation lootTableKey = CraftNamespacedKey.toMinecraft(key); -+ final Optional table = registry.getElementOptional(net.minecraft.world.level.storage.loot.LootDataType.TABLE, lootTableKey); ++ final ResourceKey lootTableKey = CraftLootTable.bukkitKeyToMinecraft(key); ++ final Optional table = registry.get().lookup(Registries.LOOT_TABLE) ++ .flatMap(registryEntryLookup -> registryEntryLookup.get(lootTableKey)) ++ .map(net.minecraft.core.Holder::value); + return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null); + // Paper end } @@ -111,9 +113,9 @@ 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 { - this.acceptsAll(Main.asList("forceUpgrade"), "Whether to force a world upgrade"); this.acceptsAll(Main.asList("eraseCache"), "Whether to force cache erase during world upgrade"); + this.acceptsAll(Main.asList("recreateRegionFiles"), "Whether to recreate region files during world upgrade"); + this.accepts("safeMode", "Loads level with vanilla datapack only"); // Paper this.acceptsAll(Main.asList("nogui"), "Disables the graphical console"); 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/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch similarity index 65% rename from patches/unapplied/server/MC-Dev-fixes.patch rename to patches/server/MC-Dev-fixes.patch index 21ff1755be..24c2b66005 100644 --- a/patches/unapplied/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -34,8 +34,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Bootstrap.checkBootstrapCalled(() -> "registry " + key); ResourceLocation resourceLocation = key.location(); LOADERS.put(resourceLocation, () -> initializer.run(registry)); -- WRITABLE_REGISTRY.register((ResourceKey>)key, registry, lifecycle); -+ WRITABLE_REGISTRY.register((ResourceKey)key, registry, lifecycle); // Paper - decompile fix +- WRITABLE_REGISTRY.register((ResourceKey>)key, registry, RegistrationInfo.BUILT_IN); ++ WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); // Paper - decompile fix return registry; } @@ -58,28 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } if (!this.hasElementSeparator()) { -diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/network/ConnectionProtocol.java -+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java -@@ -0,0 +0,0 @@ public enum ConnectionProtocol { - protocol() - .addFlow( - PacketFlow.CLIENTBOUND, -- new ConnectionProtocol.PacketSet() -+ new ConnectionProtocol.PacketSet() // Paper - decompile fix - .addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new) - .addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new) - .addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new) -@@ -0,0 +0,0 @@ public enum ConnectionProtocol { - ) - .addFlow( - PacketFlow.SERVERBOUND, -- new ConnectionProtocol.PacketSet() -+ new ConnectionProtocol.PacketSet() // Paper - decompile fix - .addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new) - .addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new) - .addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java @@ -106,16 +84,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public static SortedArraySet create(Comparator comparator) { -diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { - } - - this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> { -- return (entry1.getValue()); // CraftBukkit -+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore? - })); - this.byName = Maps.newHashMap(builder.build()); // CraftBukkit - RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); diff --git a/patches/unapplied/server/MC-Utils.patch b/patches/server/MC-Utils.patch similarity index 98% rename from patches/unapplied/server/MC-Utils.patch rename to patches/server/MC-Utils.patch index e089158042..40fa926418 100644 --- a/patches/unapplied/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -6000,15 +6000,15 @@ diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- 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> { +@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncode - JvmProfiler.INSTANCE.onPacketSent(codecData.protocol(), i, channelHandlerContext.channel().remoteAddress(), k); - } catch (Throwable var13) { -- LOGGER.error("Error receiving packet {}", i, var13); -+ LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", i, packet.isSkippable(), var13); // Paper - Give proper error message - if (packet.isSkippable()) { - throw new SkipPacketException(var13); - } + JvmProfiler.INSTANCE.onPacketSent(this.protocolInfo.id(), packetType, channelHandlerContext.channel().remoteAddress(), i); + } catch (Throwable var9) { +- LOGGER.error("Error sending packet {}", packetType, var9); ++ LOGGER.error("Error sending packet {} (skippable? {})", packetType, packet.isSkippable(), var9); + if (packet.isSkippable()) { + throw new SkipPacketException(var9); + } diff --git a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java b/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/protocol/login/ClientboundCustomQueryPacket.java @@ -6130,14 +6130,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -0,0 +0,0 @@ public class ChunkHolder { private static final List CHUNK_STATUSES = ChunkStatus.getStatusList(); - private final AtomicReferenceArray>> futures; + private final AtomicReferenceArray>> futures; private final LevelHeightAccessor levelHeightAccessor; -- private volatile CompletableFuture> fullChunkFuture; -- private volatile CompletableFuture> tickingChunkFuture; -- private volatile CompletableFuture> entityTickingChunkFuture; -+ private volatile CompletableFuture> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage -+ private volatile CompletableFuture> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage -+ private volatile CompletableFuture> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage +- private volatile CompletableFuture> fullChunkFuture; +- private volatile CompletableFuture> tickingChunkFuture; +- private volatile CompletableFuture> entityTickingChunkFuture; ++ private volatile CompletableFuture> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage ++ private volatile CompletableFuture> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage ++ private volatile CompletableFuture> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage private CompletableFuture chunkToSave; @Nullable private final DebugBuffer chunkToSaveHistory; @@ -6188,36 +6188,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE; } -- public CompletableFuture> getTickingChunkFuture() { -+ public final CompletableFuture> getTickingChunkFuture() { // Paper - final for inline +- public CompletableFuture> getTickingChunkFuture() { ++ public final CompletableFuture> getTickingChunkFuture() { // Paper - final for inline return this.tickingChunkFuture; } -- public CompletableFuture> getEntityTickingChunkFuture() { -+ public final CompletableFuture> getEntityTickingChunkFuture() { // Paper - final for inline +- public CompletableFuture> getEntityTickingChunkFuture() { ++ public final CompletableFuture> getEntityTickingChunkFuture() { // Paper - final for inline return this.entityTickingChunkFuture; } -- public CompletableFuture> getFullChunkFuture() { -+ public final CompletableFuture> getFullChunkFuture() { // Paper - final for inline +- public CompletableFuture> getFullChunkFuture() { ++ public final CompletableFuture> getFullChunkFuture() { // Paper - final for inline return this.fullChunkFuture; } @Nullable - public LevelChunk getTickingChunk() { + public final LevelChunk getTickingChunk() { // Paper - final for inline - CompletableFuture> completablefuture = this.getTickingChunkFuture(); - Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error - -@@ -0,0 +0,0 @@ public class ChunkHolder { + return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error } - @Nullable -- public LevelChunk getFullChunk() { -+ public final LevelChunk getFullChunk() { // Paper - final for inline - CompletableFuture> completablefuture = this.getFullChunkFuture(); - Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error - @@ -0,0 +0,0 @@ public class ChunkHolder { return null; } @@ -6349,8 +6340,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public class ChunkHolder { - } - }; + private static record ChunkSaveDebug(Thread thread, CompletableFuture future, String source) { + } + + // Paper start @@ -6432,12 +6423,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { - super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); + super(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - this.overworldDataStorage = persistentStateManagerFactory; - this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); + this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); this.setServerViewDistance(viewDistance); + this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine); + // Paper start + this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); + this.regionManagers.add(this.dataRegionManager); @@ -6531,8 +6522,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } int l = 0; -- ObjectIterator objectiterator = this.visibleChunkMap.values().iterator(); -+ Iterator objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper +- ObjectIterator objectiterator = this.visibleChunkMap.values().iterator(); ++ Iterator objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { @@ -6643,9 +6634,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private class ChunkDistanceManager extends DistanceManager { + public class ChunkDistanceManager extends DistanceManager { // Paper - public - protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) { + protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) { - super(workerExecutor, mainThreadExecutor); -+ super(workerExecutor, mainThreadExecutor, ChunkMap.this); ++ super(workerExecutor, mainThreadExecutor, ChunkMap.this); // Paper } @Override @@ -6678,7 +6669,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void removeTicketsOnClosing() { - ImmutableSet> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT); + ImmutableSet> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve - ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); + ObjectIterator>>> objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); while (objectiterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -6972,8 +6963,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - this.fudgeSpawnLocation(world); this.updateOptions(clientOptions); + this.object = null; + this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper + @@ -7034,7 +7025,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + player.isRealPlayer = true; // Paper GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); - String s; + // Optional optional; // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java @@ -7057,7 +7048,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4); } // CraftBukkit end @@ -7085,14 +7076,15 @@ 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 implements Targeting { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti return this.target; } + public org.bukkit.craftbukkit.entity.CraftMob getBukkitMob() { return (org.bukkit.craftbukkit.entity.CraftMob) super.getBukkitEntity(); } // Paper - public void setTarget(@Nullable LivingEntity target) { - // CraftBukkit start - fire event - this.setTarget(target, EntityTargetEvent.TargetReason.UNKNOWN, true); ++ + @Nullable + protected final LivingEntity getTargetFromBrain() { + return (LivingEntity) this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java @@ -7122,8 +7114,8 @@ diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -0,0 +0,0 @@ public final class ItemStack { - return this.tag != null ? this.tag.getList("Enchantments", 10) : new ListTag(); +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + } } + // Paper start - (this is just a good no conflict location) @@ -7145,10 +7137,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end + - public void setTag(@Nullable CompoundTag nbt) { - this.tag = nbt; - if (this.getItem().canBeDepleted()) { -@@ -0,0 +0,0 @@ public final class ItemStack { + public void applyComponents(DataComponentPatch changes) { + this.components.applyPatch(changes); + this.getItem().verifyComponentsAfterLoad(this); +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { // CraftBukkit start @Deprecated public void setItem(Item item) { @@ -7259,7 +7251,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.util.CraftSpawnCategory; - import org.bukkit.craftbukkit.util.CraftNamespacedKey; + import org.bukkit.entity.SpawnCategory; @@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } @@ -8179,8 +8171,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java -@@ -0,0 +0,0 @@ import net.minecraft.world.ticks.LevelTickAccess; - import net.minecraft.world.ticks.ScheduledTick; +@@ -0,0 +0,0 @@ import net.minecraft.world.phys.shapes.VoxelShape; + import net.minecraft.world.ticks.LevelTickAccess; import net.minecraft.world.ticks.TickPriority; import org.bukkit.event.entity.CreatureSpawnEvent; +import org.jetbrains.annotations.Nullable; 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 2cc68fbf0a..f6675f0082 100644 --- a/patches/unapplied/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -20,12 +20,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { implementation("jline:jline:2.12.1") - implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion + implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion implementation("org.ow2.asm:asm-commons:9.7") + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.2.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") + runtimeOnly("com.mysql:mysql-connector-j:8.3.0") 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 @@ -4828,7 +4828,7 @@ 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.forceSave(); + RegionFileVersion.configure(dedicatedserversettings.getProperties().regionFileComression); Path path2 = Paths.get("eula.txt"); Eula eula = new Eula(path2); + // Paper start - load config files early for access below if needed 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 d52902423a..12d358765a 100644 --- a/patches/unapplied/server/Test-changes.patch +++ b/patches/server/Test-changes.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest } - val craftbukkitPackageVersion = "1_20_R3" // Paper + val craftbukkitPackageVersion = "1_20_R4" // Paper @@ -0,0 +0,0 @@ tasks.jar { } }