diff --git a/build.gradle.kts b/build.gradle.kts index a96c6273ff..29281eb7c8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,7 +61,7 @@ repositories { } dependencies { - paramMappings("net.fabricmc:yarn:1.19.2+build.1:mergedv2") + paramMappings("net.fabricmc:yarn:1.19.2+build.28:mergedv2") remapper("net.fabricmc:tiny-remapper:0.8.6:fat") decompiler("net.minecraftforge:forgeflower:1.5.605.7") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6") diff --git a/patches/server/Add-PlayerKickEvent-causes.patch b/patches/server/Add-PlayerKickEvent-causes.patch index b2f60b98d8..4b0c8423dd 100644 --- a/patches/server/Add-PlayerKickEvent-causes.patch +++ b/patches/server/Add-PlayerKickEvent-causes.patch @@ -270,7 +270,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } - if (!playerchatmessage.verify(chatsender)) { + if (!message.verify(chatsender)) { - this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat")); + this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event cause return false; diff --git a/patches/server/Add-exception-reporting-event.patch b/patches/server/Add-exception-reporting-event.patch index 32296cc141..fb6c12a768 100644 --- a/patches/server/Add-exception-reporting-event.patch +++ b/patches/server/Add-exception-reporting-event.patch @@ -184,8 +184,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } @@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable { - ((java.nio.Buffer) bytebuffer).position(5); // CraftBukkit - decompile error - filechannel.write(bytebuffer); + ((java.nio.Buffer) buf).position(5); // CraftBukkit - decompile error + filechannel.write(buf); } catch (Throwable throwable) { + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable); // Paper if (filechannel != null) { diff --git a/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch index 1a89e85e7a..19bf483165 100644 --- a/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch +++ b/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -21,9 +21,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } - if (playerchatmessage.hasExpiredServer(Instant.now())) { -- ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), playerchatmessage.signedContent().plain()); -+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), playerchatmessage.signedContent().plain(), playerchatmessage.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper + if (message.hasExpiredServer(Instant.now())) { +- ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), message.signedContent().plain()); ++ ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper } return true; diff --git a/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index 8421325bc2..75a4281ba5 100644 --- a/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -760,7 +760,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public class RegionFileVersion { - private static final Int2ObjectMap VERSIONS = new Int2ObjectOpenHashMap<>(); -+ public static final Int2ObjectMap VERSIONS = new Int2ObjectOpenHashMap<>(); // Paper - public - public static final RegionFileVersion VERSION_GZIP = register(new RegionFileVersion(1, (inputStream) -> { - return new FastBufferedInputStream(new GZIPInputStream(inputStream)); - }, (outputStream) -> { ++ public static final Int2ObjectMap VERSIONS = new Int2ObjectOpenHashMap<>(); // Paper - private -> public + public static final RegionFileVersion VERSION_GZIP = register(new RegionFileVersion(1, (stream) -> { + return new FastBufferedInputStream(new GZIPInputStream(stream)); + }, (stream) -> { diff --git a/patches/server/Optimize-HashMapPalette.patch b/patches/server/Optimize-HashMapPalette.patch index b4293c1078..cd5b794a6d 100644 --- a/patches/server/Optimize-HashMapPalette.patch +++ b/patches/server/Optimize-HashMapPalette.patch @@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this(idList, indexBits, listener, CrudeIncrementalIntIdentityHashBiMap.create((1 << indexBits) + 1)); // Paper - Avoid unnecessary resize operation in CrudeIncrementalIntIdentityHashBiMap } - private HashMapPalette(IdMap idMap, int i, PaletteResize paletteResize, CrudeIncrementalIntIdentityHashBiMap crudeIncrementalIntIdentityHashBiMap) { + private HashMapPalette(IdMap idList, int indexBits, PaletteResize listener, CrudeIncrementalIntIdentityHashBiMap map) { @@ -0,0 +0,0 @@ public class HashMapPalette implements Palette { public int idFor(T object) { int i = this.values.getId(object); diff --git a/patches/server/Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch index b459fb06f3..486a8b5191 100644 --- a/patches/server/Remove-streams-from-classes-related-villager-gossip.patch +++ b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch @@ -34,10 +34,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class GossipContainer { } - public Dynamic store(DynamicOps dynamicOps) { -- return new Dynamic<>(dynamicOps, dynamicOps.createList(this.unpack().map((gossipEntry) -> { -+ return new Dynamic<>(dynamicOps, dynamicOps.createList(this.decompress().stream().map((gossipEntry) -> { - return gossipEntry.store(dynamicOps); + public Dynamic store(DynamicOps ops) { +- return new Dynamic<>(ops, ops.createList(this.unpack().map((entry) -> { ++ return new Dynamic<>(ops, ops.createList(this.decompress().stream().map((entry) -> { // Paper - remove streams from reputation + return entry.store(ops); }).map(Dynamic::getValue))); } @@ -0,0 +0,0 @@ public class GossipContainer { @@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + list.add(new GossipContainer.GossipEntry(uuid, entry.getKey(), entry.getIntValue())); + } + return list; -+ // Paper - end ++ // Paper end } public Stream unpack(UUID target) { diff --git a/patches/server/Rewrite-chunk-system.patch b/patches/server/Rewrite-chunk-system.patch index 187aa1dfce..90be1d4b61 100644 --- a/patches/server/Rewrite-chunk-system.patch +++ b/patches/server/Rewrite-chunk-system.patch @@ -17132,7 +17132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + synchronized (this.persistentDataLock) { // Paper - async chunk loading persistentstructurelegacy = this.legacyStructureHandler; if (persistentstructurelegacy == null) { - this.legacyStructureHandler = persistentstructurelegacy = LegacyStructureDataHandler.getLegacyStructureHandler(resourcekey, (DimensionDataStorage) supplier.get()); + this.legacyStructureHandler = persistentstructurelegacy = LegacyStructureDataHandler.getLegacyStructureHandler(worldKey, (DimensionDataStorage) stateManagerGetter.get()); @@ -0,0 +0,0 @@ public class ChunkStorage implements AutoCloseable { } diff --git a/patches/server/Starlight.patch b/patches/server/Starlight.patch index 0284be6217..272b029e84 100644 --- a/patches/server/Starlight.patch +++ b/patches/server/Starlight.patch @@ -4932,7 +4932,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java @@ -0,0 +0,0 @@ public class EmptyLevelChunk extends LevelChunk { - this.biome = holder; + this.biome = biomeEntry; } + // Paper start - starlight diff --git a/patches/server/implement-optional-per-player-mob-spawns.patch b/patches/server/implement-optional-per-player-mob-spawns.patch index 829613e437..2c1c15129b 100644 --- a/patches/server/implement-optional-per-player-mob-spawns.patch +++ b/patches/server/implement-optional-per-player-mob-spawns.patch @@ -392,12 +392,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public final class NaturalSpawner { private NaturalSpawner() {} - public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator localmobcapcalculator) { + public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator densityCapper) { + // Paper start - add countMobs parameter -+ return createState(spawningChunkCount, entities, chunkSource, localmobcapcalculator, false); ++ return createState(spawningChunkCount, entities, chunkSource, densityCapper, false); + } + -+ public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator localmobcapcalculator, boolean countMobs) { ++ public static NaturalSpawner.SpawnState createState(int spawningChunkCount, Iterable entities, NaturalSpawner.ChunkGetter chunkSource, LocalMobCapCalculator densityCapper, boolean countMobs) { + // Paper end PotentialCalculator spawnercreatureprobabilities = new PotentialCalculator(); Object2IntOpenHashMap object2intopenhashmap = new Object2IntOpenHashMap(); @@ -407,8 +407,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (entity instanceof Mob) { -+ if (localmobcapcalculator != null && entity instanceof Mob) { // Paper - localmobcapcalculator.addMob(chunk.getPos(), enumcreaturetype); ++ if (densityCapper != null && entity instanceof Mob) { // Paper + densityCapper.addMob(chunk.getPos(), enumcreaturetype); } object2intopenhashmap.addTo(enumcreaturetype, 1);