From fc84aee124ec1781a44d19693e5e41d97cf7dfd1 Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Fri, 22 Sep 2023 09:24:44 +0200 Subject: [PATCH] more more more more more more work --- ...tedContainer-instead-of-ThreadingDe.patch} | 30 +++++----- ...-to-fix-items-merging-through-walls.patch} | 0 .../0610-Add-BellRevealRaiderEvent.patch} | 0 .../0611-Fix-invulnerable-end-crystals.patch} | 8 +-- ...12-Add-ElderGuardianAppearanceEvent.patch} | 4 +- ...0613-Fix-dangerous-end-portal-logic.patch} | 13 +++-- ...-Biome-Mob-Lookups-for-Mob-Spawning.patch} | 0 ...-Make-item-validations-configurable.patch} | 0 .../0616-Line-Of-Sight-Changes.patch} | 6 +- .../0617-add-per-world-spawn-limits.patch} | 2 +- .../0618-Fix-potions-splash-events.patch} | 6 +- .../0619-Add-more-LimitedRegion-API.patch} | 0 ...layerDropItemEvent-using-wrong-item.patch} | 8 +-- .../0621-Missing-Entity-API.patch} | 30 +++++----- ...ect-for-book-edit-is-called-on-main.patch} | 4 +- ...of-Block-applyBoneMeal-always-being.patch} | 0 ...tChunkIfLoadedImmediately-in-places.patch} | 8 +-- ...rom-signs-not-firing-command-events.patch} | 0 .../0626-Adds-PlayerArmSwingEvent.patch} | 4 +- ...-event-leave-message-not-being-sent.patch} | 56 ++++++++++--------- ...-for-mobs-immune-to-default-effects.patch} | 12 ++-- ...correct-message-for-outdated-client.patch} | 12 ++-- 22 files changed, 103 insertions(+), 100 deletions(-) rename patches/{unapplied/server/0618-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch => server/0608-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch} (72%) rename patches/{unapplied/server/0619-Add-option-to-fix-items-merging-through-walls.patch => server/0609-Add-option-to-fix-items-merging-through-walls.patch} (100%) rename patches/{unapplied/server/0620-Add-BellRevealRaiderEvent.patch => server/0610-Add-BellRevealRaiderEvent.patch} (100%) rename patches/{unapplied/server/0621-Fix-invulnerable-end-crystals.patch => server/0611-Fix-invulnerable-end-crystals.patch} (92%) rename patches/{unapplied/server/0622-Add-ElderGuardianAppearanceEvent.patch => server/0612-Add-ElderGuardianAppearanceEvent.patch} (96%) rename patches/{unapplied/server/0623-Fix-dangerous-end-portal-logic.patch => server/0613-Fix-dangerous-end-portal-logic.patch} (90%) rename patches/{unapplied/server/0624-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch => server/0614-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch} (100%) rename patches/{unapplied/server/0625-Make-item-validations-configurable.patch => server/0615-Make-item-validations-configurable.patch} (100%) rename patches/{unapplied/server/0626-Line-Of-Sight-Changes.patch => server/0616-Line-Of-Sight-Changes.patch} (94%) rename patches/{unapplied/server/0627-add-per-world-spawn-limits.patch => server/0617-add-per-world-spawn-limits.patch} (91%) rename patches/{unapplied/server/0628-Fix-potions-splash-events.patch => server/0618-Fix-potions-splash-events.patch} (97%) rename patches/{unapplied/server/0629-Add-more-LimitedRegion-API.patch => server/0619-Add-more-LimitedRegion-API.patch} (100%) rename patches/{unapplied/server/0630-Fix-PlayerDropItemEvent-using-wrong-item.patch => server/0620-Fix-PlayerDropItemEvent-using-wrong-item.patch} (82%) rename patches/{unapplied/server/0631-Missing-Entity-API.patch => server/0621-Missing-Entity-API.patch} (97%) rename patches/{unapplied/server/0632-Ensure-disconnect-for-book-edit-is-called-on-main.patch => server/0622-Ensure-disconnect-for-book-edit-is-called-on-main.patch} (85%) rename patches/{unapplied/server/0633-Fix-return-value-of-Block-applyBoneMeal-always-being.patch => server/0623-Fix-return-value-of-Block-applyBoneMeal-always-being.patch} (100%) rename patches/{unapplied/server/0634-Use-getChunkIfLoadedImmediately-in-places.patch => server/0624-Use-getChunkIfLoadedImmediately-in-places.patch} (88%) rename patches/{unapplied/server/0635-Fix-commands-from-signs-not-firing-command-events.patch => server/0625-Fix-commands-from-signs-not-firing-command-events.patch} (100%) rename patches/{unapplied/server/0636-Adds-PlayerArmSwingEvent.patch => server/0626-Adds-PlayerArmSwingEvent.patch} (85%) rename patches/{unapplied/server/0637-Fixes-kick-event-leave-message-not-being-sent.patch => server/0627-Fixes-kick-event-leave-message-not-being-sent.patch} (67%) rename patches/{unapplied/server/0638-Add-config-for-mobs-immune-to-default-effects.patch => server/0628-Add-config-for-mobs-immune-to-default-effects.patch} (87%) rename patches/{unapplied/server/0639-Fix-incorrect-message-for-outdated-client.patch => server/0629-Fix-incorrect-message-for-outdated-client.patch} (68%) diff --git a/patches/unapplied/server/0618-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch b/patches/server/0608-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch similarity index 72% rename from patches/unapplied/server/0618-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch rename to patches/server/0608-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch index 21b214354..4a44dd7ad 100644 --- a/patches/unapplied/server/0618-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch +++ b/patches/server/0608-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch @@ -14,11 +14,11 @@ contention situations. And this is extremely a low contention situation. diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbdeaa4faf52 100644 +index 1219200cd915d6239a32a2bd09d325cd8fa9b346..dfae0918079425df92d958b04275be8ae60d4b60 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -32,14 +32,14 @@ public class PalettedContainer implements PaletteResize, PalettedContainer - private final T @org.jetbrains.annotations.Nullable [] presetValues; // Paper - Anti-Xray - Add preset values + public final IdMap registry; private volatile PalettedContainer.Data data; private final PalettedContainer.Strategy strategy; - private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); @@ -34,17 +34,17 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde + // this.threadingDetector.checkAndUnlock(); // Paper - disable this } - // Paper start - Anti-Xray - Add preset values -@@ -129,7 +129,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer + public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) { +@@ -91,7 +91,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } @Override - public int onResize(int newBits, T object) { + public synchronized int onResize(int newBits, T object) { // Paper - synchronize PalettedContainer.Data data = this.data; - - // Paper start - Anti-Xray - Add preset values -@@ -176,7 +176,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer + PalettedContainer.Data data2 = this.createOrReuseData(data, newBits); + data2.copyFrom(data.palette, data.storage); +@@ -116,7 +116,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer return this.getAndSet(this.strategy.getIndex(x, y, z), value); } @@ -53,7 +53,7 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde int i = this.data.palette.idFor(value); int j = this.data.storage.getAndSet(index, i); return this.data.palette.valueFor(j); -@@ -193,7 +193,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -133,7 +133,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } @@ -62,7 +62,7 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde int i = this.data.palette.idFor(value); this.data.storage.set(index, i); } -@@ -218,7 +218,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -158,7 +158,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer }); } @@ -71,16 +71,16 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde this.acquire(); try { -@@ -238,7 +238,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -174,7 +174,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer + } + @Override - @Deprecated @io.papermc.paper.annotation.DoNotUse public void write(FriendlyByteBuf buf) { this.write(buf, null, 0); } - @Override -- public void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int chunkSectionIndex) { -+ public synchronized void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int chunkSectionIndex) { // Paper - synchronize +- public void write(FriendlyByteBuf buf) { ++ public synchronized void write(FriendlyByteBuf buf) { // Paper - synchronize this.acquire(); try { -@@ -298,7 +298,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -229,7 +229,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } @Override diff --git a/patches/unapplied/server/0619-Add-option-to-fix-items-merging-through-walls.patch b/patches/server/0609-Add-option-to-fix-items-merging-through-walls.patch similarity index 100% rename from patches/unapplied/server/0619-Add-option-to-fix-items-merging-through-walls.patch rename to patches/server/0609-Add-option-to-fix-items-merging-through-walls.patch diff --git a/patches/unapplied/server/0620-Add-BellRevealRaiderEvent.patch b/patches/server/0610-Add-BellRevealRaiderEvent.patch similarity index 100% rename from patches/unapplied/server/0620-Add-BellRevealRaiderEvent.patch rename to patches/server/0610-Add-BellRevealRaiderEvent.patch diff --git a/patches/unapplied/server/0621-Fix-invulnerable-end-crystals.patch b/patches/server/0611-Fix-invulnerable-end-crystals.patch similarity index 92% rename from patches/unapplied/server/0621-Fix-invulnerable-end-crystals.patch rename to patches/server/0611-Fix-invulnerable-end-crystals.patch index a01365c22..195d6b8a4 100644 --- a/patches/unapplied/server/0621-Fix-invulnerable-end-crystals.patch +++ b/patches/server/0611-Fix-invulnerable-end-crystals.patch @@ -52,14 +52,14 @@ index cc3f1532a2108ea915d0e8c840e87bc56ab60a65..ffc5b68c4246a7111845230a75552bb1 } diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java -index 32903759e94e43328de38a985cc121252c81f481..570c0646e245a1527b3a569f2c8a6fae5b18b373 100644 +index 4b685e185ebac8553f1f81d1a5a04be8166a6ca4..dbd1e440ced5d23f2f813b12808f9400a49c3f8f 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java +++ b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java -@@ -100,6 +100,7 @@ public class SpikeFeature extends Feature { +@@ -101,6 +101,7 @@ public class SpikeFeature extends Feature { endCrystal.setBeamTarget(config.getCrystalBeamTarget()); endCrystal.setInvulnerable(config.isCrystalInvulnerable()); endCrystal.moveTo((double)spike.getCenterX() + 0.5D, (double)(spike.getHeight() + 1), (double)spike.getCenterZ() + 0.5D, random.nextFloat() * 360.0F, 0.0F); + endCrystal.generatedByDragonFight = true; // Paper world.addFreshEntity(endCrystal); - this.setBlock(world, new BlockPos(spike.getCenterX(), spike.getHeight(), spike.getCenterZ()), Blocks.BEDROCK.defaultBlockState()); - } + BlockPos blockPos2 = endCrystal.blockPosition(); + this.setBlock(world, blockPos2.below(), Blocks.BEDROCK.defaultBlockState()); diff --git a/patches/unapplied/server/0622-Add-ElderGuardianAppearanceEvent.patch b/patches/server/0612-Add-ElderGuardianAppearanceEvent.patch similarity index 96% rename from patches/unapplied/server/0622-Add-ElderGuardianAppearanceEvent.patch rename to patches/server/0612-Add-ElderGuardianAppearanceEvent.patch index 76665d808..93e8beb3d 100644 --- a/patches/unapplied/server/0622-Add-ElderGuardianAppearanceEvent.patch +++ b/patches/server/0612-Add-ElderGuardianAppearanceEvent.patch @@ -34,10 +34,10 @@ index 4c46a843c5c7e6f735f6b5f0f3c034524a0cf1e1..2baba1ccc1acd50693e05d565784d11d list.forEach((entityplayer) -> { diff --git a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java -index 4e4b68904151d0d851b13f14f89c1c305e95fd5a..8f481e11815d7162dd62a2b850b3d2af6d904519 100644 +index 1dfdb378a2491b0ae64a4152e4cd8b539dfdf65b..efc1d49c5bfea7d1674b8a9de2c8b617657eda0f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java +++ b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java -@@ -67,7 +67,7 @@ public class ElderGuardian extends Guardian { +@@ -70,7 +70,7 @@ public class ElderGuardian extends Guardian { super.customServerAiStep(); if ((this.tickCount + this.getId()) % 1200 == 0) { MobEffectInstance mobeffect = new MobEffectInstance(MobEffects.DIG_SLOWDOWN, 6000, 2); diff --git a/patches/unapplied/server/0623-Fix-dangerous-end-portal-logic.patch b/patches/server/0613-Fix-dangerous-end-portal-logic.patch similarity index 90% rename from patches/unapplied/server/0623-Fix-dangerous-end-portal-logic.patch rename to patches/server/0613-Fix-dangerous-end-portal-logic.patch index 46f623d25..6eb26012b 100644 --- a/patches/unapplied/server/0623-Fix-dangerous-end-portal-logic.patch +++ b/patches/server/0613-Fix-dangerous-end-portal-logic.patch @@ -11,13 +11,13 @@ Move the tick logic into the post tick, where portaling was designed to happen in the first place. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3d1cde6740e2b68d8d6e372cb52a6485fc3f7316..e3024f2fff1cd8de618216a42716da8caf37d5be 100644 +index f30bafd45d038d6abcb929b138b332a18aa84307..55deac13e5af70689fe74127aebd0e3f880f0cb4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -515,6 +515,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this)); +@@ -431,6 +431,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } - // Paper end - optimise entity tracking + // Paper end + + // Paper start - make end portalling safe + public BlockPos portalBlock; + public ServerLevel portalWorld; @@ -48,10 +48,11 @@ index 3d1cde6740e2b68d8d6e372cb52a6485fc3f7316..e3024f2fff1cd8de618216a42716da8c + this.teleportTo(worldserver, null); + } + // Paper end - make end portalling safe - ++ public Entity(EntityType type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); -@@ -2839,6 +2869,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + this.passengers = ImmutableList.of(); +@@ -2786,6 +2817,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } this.processPortalCooldown(); diff --git a/patches/unapplied/server/0624-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/patches/server/0614-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 100% rename from patches/unapplied/server/0624-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to patches/server/0614-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch diff --git a/patches/unapplied/server/0625-Make-item-validations-configurable.patch b/patches/server/0615-Make-item-validations-configurable.patch similarity index 100% rename from patches/unapplied/server/0625-Make-item-validations-configurable.patch rename to patches/server/0615-Make-item-validations-configurable.patch diff --git a/patches/unapplied/server/0626-Line-Of-Sight-Changes.patch b/patches/server/0616-Line-Of-Sight-Changes.patch similarity index 94% rename from patches/unapplied/server/0626-Line-Of-Sight-Changes.patch rename to patches/server/0616-Line-Of-Sight-Changes.patch index fd3136078..2cad6b1f2 100644 --- a/patches/unapplied/server/0626-Line-Of-Sight-Changes.patch +++ b/patches/server/0616-Line-Of-Sight-Changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c0c864bcad6ba6466d7a6453ce920a3603f6066a..4246122a794018b526e1619dcd066c2c88f4786c 100644 +index 59a377a291927b843b9e4fb4a558eeb729f3d6a8..1427616a0f1c80d381831d8928a4b632107fe0f5 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3548,7 +3548,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3607,7 +3607,8 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); @@ -45,7 +45,7 @@ index 42b6369015cdfea983b1489f7b99428eaa8c62a5..5a949e1d482e2485742e24b63395204b // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index dcc7c8efe0b9d6b57841d8318499d490a3f7aa73..a2865fe8fdc5f77a84e72f516d8f1fd1b4b579e0 100644 +index 9d9616a4adcbcc0d2567bdcf0d57efdabda076d4..40dd8ef6f034be2d5866a0c253566026d59ed91a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -583,6 +583,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0627-add-per-world-spawn-limits.patch b/patches/server/0617-add-per-world-spawn-limits.patch similarity index 91% rename from patches/unapplied/server/0627-add-per-world-spawn-limits.patch rename to patches/server/0617-add-per-world-spawn-limits.patch index a018ec3c5..fb3c6d461 100644 --- a/patches/unapplied/server/0627-add-per-world-spawn-limits.patch +++ b/patches/server/0617-add-per-world-spawn-limits.patch @@ -6,7 +6,7 @@ Subject: [PATCH] add per world spawn limits Taken from #2982. Credit to Chasewhip8 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index af8cf7c594dc1c099785559f11f3ed7415676895..78ba220b74c1cca26e3b1243622a317eb1e4e78b 100644 +index 47a880bfabcd950ff985c2763531c68db80347f2..d3489601ec89c9deea6beb3153bef9b30be85366 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -212,6 +212,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0628-Fix-potions-splash-events.patch b/patches/server/0618-Fix-potions-splash-events.patch similarity index 97% rename from patches/unapplied/server/0628-Fix-potions-splash-events.patch rename to patches/server/0618-Fix-potions-splash-events.patch index 54862cd18..18d8ef0d0 100644 --- a/patches/unapplied/server/0628-Fix-potions-splash-events.patch +++ b/patches/server/0618-Fix-potions-splash-events.patch @@ -8,10 +8,10 @@ Fixes SPIGOT-6221: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-6 Fix splash events cancellation that still show particles/sound diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -index 089b5fbb240d494bf86a05078d534165bfc2f7ee..135cd9c154a90d5c2351d8bdd8217134114af5a0 100644 +index 50712c4c7f007123a0735acf958fd860d4e76cf8..a3ee89cb4acfa475076e65f06f1047232bcf684f 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -@@ -104,56 +104,77 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie +@@ -105,56 +105,77 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie Potion potionregistry = PotionUtils.getPotion(itemstack); List list = PotionUtils.getMobEffects(itemstack); boolean flag = potionregistry == Potions.WATER && list.isEmpty(); @@ -104,7 +104,7 @@ index 089b5fbb240d494bf86a05078d534165bfc2f7ee..135cd9c154a90d5c2351d8bdd8217134 AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D); List list1 = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb); Map affected = new HashMap(); // CraftBukkit -@@ -171,6 +192,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie +@@ -172,6 +193,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie if (d0 < 16.0D) { double d1; diff --git a/patches/unapplied/server/0629-Add-more-LimitedRegion-API.patch b/patches/server/0619-Add-more-LimitedRegion-API.patch similarity index 100% rename from patches/unapplied/server/0629-Add-more-LimitedRegion-API.patch rename to patches/server/0619-Add-more-LimitedRegion-API.patch diff --git a/patches/unapplied/server/0630-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0620-Fix-PlayerDropItemEvent-using-wrong-item.patch similarity index 82% rename from patches/unapplied/server/0630-Fix-PlayerDropItemEvent-using-wrong-item.patch rename to patches/server/0620-Fix-PlayerDropItemEvent-using-wrong-item.patch index 4633203da..37e257bba 100644 --- a/patches/unapplied/server/0630-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0620-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0162c504673f5809b28ca58177773c005460f039..e100534a676bd950513f3b9217e4949b65f20960 100644 +index 26733cb73d117af56457f7119f372c33a7dd1649..63a3f714f0a85966fe23507179d39cbfdaa0a1ee 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2294,7 +2294,7 @@ public class ServerPlayer extends Player { +@@ -2241,7 +2241,7 @@ public class ServerPlayer extends Player { if (retainOwnership) { if (!itemstack1.isEmpty()) { @@ -18,10 +18,10 @@ index 0162c504673f5809b28ca58177773c005460f039..e100534a676bd950513f3b9217e4949b this.awardStat(Stats.DROP); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index b3634a1d92182c746948862fc64b2e47d11320ba..8f604924b47ed4027f4212007530b6d0c39f73a9 100644 +index dee00042a780b053cd094081874aad221abf1b2b..786ef24e97cfb96ddee2be9e02272e6f572cd64d 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -724,6 +724,11 @@ public abstract class Player extends LivingEntity { +@@ -730,6 +730,11 @@ public abstract class Player extends LivingEntity { } double d0 = this.getEyeY() - 0.30000001192092896D; diff --git a/patches/unapplied/server/0631-Missing-Entity-API.patch b/patches/server/0621-Missing-Entity-API.patch similarity index 97% rename from patches/unapplied/server/0631-Missing-Entity-API.patch rename to patches/server/0621-Missing-Entity-API.patch index 11ac90644..85698b312 100644 --- a/patches/unapplied/server/0631-Missing-Entity-API.patch +++ b/patches/server/0621-Missing-Entity-API.patch @@ -201,10 +201,10 @@ index 71a08510a928d4570822282bb31f14013ec3834a..4aeab90e778629c355189dfe79c39c4b } diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -index 07116849e39ef891182fe603d34d7fd8aee6c046..6bab94ac458081e9ed6e1999a9a3f884dd710604 100644 +index 9f46eb8417ad19e6f1bbf369f4c6b94fdb915f5b..a974b57dfb007d14194c566421216003ffb0c5d6 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -@@ -696,6 +696,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -698,6 +698,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, } @@ -220,7 +220,7 @@ index 07116849e39ef891182fe603d34d7fd8aee6c046..6bab94ac458081e9ed6e1999a9a3f884 @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { if (!this.isVehicle() && !this.isBaby()) { -@@ -738,6 +747,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -740,6 +749,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, this.setFlag(16, eatingGrass); } @@ -233,10 +233,10 @@ index 07116849e39ef891182fe603d34d7fd8aee6c046..6bab94ac458081e9ed6e1999a9a3f884 if (angry) { this.setEating(false); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java -index e710d529a8b92e9b11efc9955947b72788aa542b..7379e99c4d599aa0119bae9ebdc5e2058ada10cb 100644 +index edbb933d1f6f7fc6432f7a8b074c5dc20f47adfb..91fb62807b3c5600c83d4dc8d3fadf36e94e2133 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java -@@ -72,7 +72,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder MinecraftServer.currentTick) { diff --git a/patches/unapplied/server/0633-Fix-return-value-of-Block-applyBoneMeal-always-being.patch b/patches/server/0623-Fix-return-value-of-Block-applyBoneMeal-always-being.patch similarity index 100% rename from patches/unapplied/server/0633-Fix-return-value-of-Block-applyBoneMeal-always-being.patch rename to patches/server/0623-Fix-return-value-of-Block-applyBoneMeal-always-being.patch diff --git a/patches/unapplied/server/0634-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0624-Use-getChunkIfLoadedImmediately-in-places.patch similarity index 88% rename from patches/unapplied/server/0634-Use-getChunkIfLoadedImmediately-in-places.patch rename to patches/server/0624-Use-getChunkIfLoadedImmediately-in-places.patch index 255b342f7..603bb0a47 100644 --- a/patches/unapplied/server/0634-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/patches/server/0624-Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e63cb62affc88d1482f9926ae459986e2d213fb0..bc7daf89e30152a3bcb215e91b30c9680be5c343 100644 +index c16d0e4f30e7b3c6d2c0b320353646589a84c6c8..a81f77b6d057182a716549940f40052fe27e845c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -228,7 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -21,10 +21,10 @@ index e63cb62affc88d1482f9926ae459986e2d213fb0..bc7daf89e30152a3bcb215e91b30c968 @Override diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 51dc136b9a5006382de4b12275a9c2f299d5d1f9..7113fdf06bc526af62d08313f8c47e14a2f4b652 100644 +index 24949c13b6e6c2297812e8a3988d4e52aca9136a..5b735d018a4b0b1c212f63d941c2aa6a00d129f6 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -201,6 +201,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -200,6 +200,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return (CraftServer) Bukkit.getServer(); } @@ -37,7 +37,7 @@ index 51dc136b9a5006382de4b12275a9c2f299d5d1f9..7113fdf06bc526af62d08313f8c47e14 + public abstract ResourceKey getTypeKey(); - 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, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor + 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 diff --git a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java b/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java index 0d5ae91a9b43df7b412968ab5faf5498c09169f9..744160405680babbb83c99abcbe2dc89bf312398 100644 --- a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java diff --git a/patches/unapplied/server/0635-Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/0625-Fix-commands-from-signs-not-firing-command-events.patch similarity index 100% rename from patches/unapplied/server/0635-Fix-commands-from-signs-not-firing-command-events.patch rename to patches/server/0625-Fix-commands-from-signs-not-firing-command-events.patch diff --git a/patches/unapplied/server/0636-Adds-PlayerArmSwingEvent.patch b/patches/server/0626-Adds-PlayerArmSwingEvent.patch similarity index 85% rename from patches/unapplied/server/0636-Adds-PlayerArmSwingEvent.patch rename to patches/server/0626-Adds-PlayerArmSwingEvent.patch index 9ebfeb62d..63177861c 100644 --- a/patches/unapplied/server/0636-Adds-PlayerArmSwingEvent.patch +++ b/patches/server/0626-Adds-PlayerArmSwingEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 006035b94ab0490c0dd5747906398965016b3e42..b673f6a43e4b057b1a5c78398a6e40bf73340112 100644 +index 870707223be5478805ec55e02f17a8c17d3d9f00..483fc6b3df30d298b023c7bd05cbc05e688229a9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2479,7 +2479,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2310,7 +2310,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper end // Arm swing animation diff --git a/patches/unapplied/server/0637-Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/0627-Fixes-kick-event-leave-message-not-being-sent.patch similarity index 67% rename from patches/unapplied/server/0637-Fixes-kick-event-leave-message-not-being-sent.patch rename to patches/server/0627-Fixes-kick-event-leave-message-not-being-sent.patch index af2e67c83..02e6eb01c 100644 --- a/patches/unapplied/server/0637-Fixes-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0627-Fixes-kick-event-leave-message-not-being-sent.patch @@ -5,39 +5,22 @@ Subject: [PATCH] Fixes kick event leave message not being sent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index e100534a676bd950513f3b9217e4949b65f20960..0a25e2bb95fa249fa5cde1a174702bb311a45171 100644 +index 63a3f714f0a85966fe23507179d39cbfdaa0a1ee..5614d8ed30a005fd7c11e47ced4331b464cddd96 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -270,7 +270,6 @@ public class ServerPlayer extends Player { +@@ -267,7 +267,6 @@ public class ServerPlayer extends Player { + public boolean joining = true; public boolean sentListPacket = false; public boolean supressTrackerForLogin = false; // Paper - public Integer clientViewDistance; - public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent // CraftBukkit end public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b673f6a43e4b057b1a5c78398a6e40bf73340112..9d519076d8ae50ab04c1a3c83c92b6d127a11321 100644 +index 483fc6b3df30d298b023c7bd05cbc05e688229a9..0ed553e02ced432b5f6761ff295c6ee70deefa78 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -516,7 +516,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - // Do not kick the player - return; - } -- this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent - // Send the possibly modified leave message - final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure - // CraftBukkit end -@@ -525,7 +524,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { - this.connection.disconnect(ichatbasecomponent); - })); -- this.onDisconnect(ichatbasecomponent); // CraftBukkit - fire quit instantly -+ this.onDisconnect(ichatbasecomponent, event.leaveMessage()); // CraftBukkit - fire quit instantly // Paper - use kick event leave message - this.connection.setReadOnly(); - MinecraftServer minecraftserver = this.server; - Connection networkmanager = this.connection; -@@ -1988,6 +1987,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1848,6 +1848,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void onDisconnect(Component reason) { @@ -49,7 +32,26 @@ index b673f6a43e4b057b1a5c78398a6e40bf73340112..9d519076d8ae50ab04c1a3c83c92b6d1 // CraftBukkit start - Rarely it would send a disconnect line twice if (this.processedDisconnect) { return; -@@ -2005,7 +2009,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1856,11 +1861,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + } + // CraftBukkit end + ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString()); +- this.removePlayerFromWorld(); ++ this.removePlayerFromWorld(quitMessage); // Paper + super.onDisconnect(reason); + } + ++ // Paper start + private void removePlayerFromWorld() { ++ this.removePlayerFromWorld(null); ++ } ++ ++ private void removePlayerFromWorld(@Nullable net.kyori.adventure.text.Component quitMessage) { ++ // Paper end + this.chatMessageChain.close(); + // CraftBukkit start - Replace vanilla quit message handling with our own. + /* +@@ -1870,7 +1881,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.disconnect(); // Paper start - Adventure @@ -59,10 +61,10 @@ index b673f6a43e4b057b1a5c78398a6e40bf73340112..9d519076d8ae50ab04c1a3c83c92b6d1 this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 77d80170cabc358c75d58ac7ff19054ba6b7617f..c8e38ed5e14fb137a7d169c57bc58bdf4421e0cc 100644 +index 53c453814c840ce8afed27cea4c6f5e01cddf17f..2e9812e83a7471bfe314274276b8a3d44208e27d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -564,6 +564,11 @@ public abstract class PlayerList { +@@ -551,6 +551,11 @@ public abstract class PlayerList { } public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component @@ -74,11 +76,11 @@ index 77d80170cabc358c75d58ac7ff19054ba6b7617f..c8e38ed5e14fb137a7d169c57bc58bdf ServerLevel worldserver = entityplayer.serverLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); -@@ -574,7 +579,7 @@ public abstract class PlayerList { +@@ -561,7 +566,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } -- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason +- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), leaveMessage, entityplayer.quitReason); // Paper - Adventure & quit reason this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); diff --git a/patches/unapplied/server/0638-Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/0628-Add-config-for-mobs-immune-to-default-effects.patch similarity index 87% rename from patches/unapplied/server/0638-Add-config-for-mobs-immune-to-default-effects.patch rename to patches/server/0628-Add-config-for-mobs-immune-to-default-effects.patch index 5c2ded610..0b70f326d 100644 --- a/patches/unapplied/server/0638-Add-config-for-mobs-immune-to-default-effects.patch +++ b/patches/server/0628-Add-config-for-mobs-immune-to-default-effects.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config for mobs immune to default effects diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 4246122a794018b526e1619dcd066c2c88f4786c..463ae3d9e75b32da0aa91ebbbf1a34ee74825224 100644 +index 1427616a0f1c80d381831d8928a4b632107fe0f5..f33ac871d08672a78774a3a9642954bdcaa2e9d9 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1163,7 +1163,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1165,7 +1165,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.getMobType() == MobType.UNDEAD) { MobEffect mobeffectlist = effect.getEffect(); @@ -31,10 +31,10 @@ index cd59500565a305757872aaf41b03b49ffc005af5..703068eaff84bcce83f61d805afa6cc0 private class WitherDoNothingGoal extends Goal { diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java -index b9acef460ff7e8bc9e24997771beeba6bea1f28a..d506091a739b04caf213e8fb0f71b5b78035aa0e 100644 +index 6241baccd3fdee59175f616cdf69d3873074f855..9e5d68fe86d17118df3d6a1c36b296f32b4d7fc1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Spider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java -@@ -133,7 +133,7 @@ public class Spider extends Monster { +@@ -135,7 +135,7 @@ public class Spider extends Monster { @Override public boolean canBeAffected(MobEffectInstance effect) { @@ -44,10 +44,10 @@ index b9acef460ff7e8bc9e24997771beeba6bea1f28a..d506091a739b04caf213e8fb0f71b5b7 public boolean isClimbing() { diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java -index ea6233cb3ca30864e54d553a5d1071ea9147a868..9a81cb0c3a5ac40ff50dc7c81f6196a447cd03c6 100644 +index 62943d43b701d9ae6d955003f4e7658f76d5bdb3..3dcd43279ce1295b37c3504ecbdaac5275df2b80 100644 --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java -@@ -123,6 +123,6 @@ public class WitherSkeleton extends AbstractSkeleton { +@@ -128,6 +128,6 @@ public class WitherSkeleton extends AbstractSkeleton { @Override public boolean canBeAffected(MobEffectInstance effect) { diff --git a/patches/unapplied/server/0639-Fix-incorrect-message-for-outdated-client.patch b/patches/server/0629-Fix-incorrect-message-for-outdated-client.patch similarity index 68% rename from patches/unapplied/server/0639-Fix-incorrect-message-for-outdated-client.patch rename to patches/server/0629-Fix-incorrect-message-for-outdated-client.patch index 73f722f54..d0b85c917 100644 --- a/patches/unapplied/server/0639-Fix-incorrect-message-for-outdated-client.patch +++ b/patches/server/0629-Fix-incorrect-message-for-outdated-client.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Fix incorrect message for outdated client diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 8393c1a2d15d5ad255c9808b0d0edd6aeb447893..63cf71940f6480c593a43bd39900c50676367404 100644 +index 2824369960130fa3d0ad416a3961024c8f8d5f52..74ad6baea209bb0152198d48671e3f1c80ac73e2 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -82,7 +82,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { + if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages -- if (packet.getProtocolVersion() < 754) { -+ if (packet.getProtocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Paper - Fix incorrect message for outdated clients - ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages +- if (packet.protocolVersion() < 754) { ++ if (packet.protocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Paper - Fix incorrect message for outdated clients + ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } else { - ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages + ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages