From b974a6b6f3a989050bf4af344be27da46de9041e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:34:58 -0700 Subject: [PATCH] Update paperweight to 1.5.9 (#9872) --- build.gradle.kts | 2 +- patches/server/0002-Remap-fixes.patch | 30 ----- patches/server/0005-Paper-config-files.patch | 22 ++-- patches/server/0009-MC-Utils.patch | 38 +++---- patches/server/0010-Adventure.patch | 106 +++++++++--------- patches/server/0013-Paper-Plugins.patch | 4 +- patches/server/0014-Timings-v2.patch | 71 ++++++------ .../server/0018-Rewrite-chunk-system.patch | 56 ++++----- ...5-Allow-for-toggling-of-spawn-chunks.patch | 8 +- ...031-Further-improve-server-tick-loop.patch | 8 +- ...45-Implement-PlayerLocaleChangeEvent.patch | 6 +- .../0049-Disable-spigot-tick-limiters.patch | 4 +- ...chunks-are-slime-spawn-chunks-toggle.patch | 4 +- .../server/0058-Add-velocity-warnings.patch | 8 +- ...ble-inter-world-teleportation-safety.patch | 6 +- ...069-Handle-Item-Meta-Inconsistencies.patch | 10 +- ...ent-to-allow-plugins-to-handle-clien.patch | 6 +- ...-API-Replenishable-Lootables-Feature.patch | 18 +-- ...112-Cache-user-authenticator-threads.patch | 4 +- ...PI-for-Reason-Source-Triggering-play.patch | 18 +-- ...oleAppender-for-console-improvements.patch | 28 ++--- ...64-Fix-MC-117075-TE-Unload-Lag-Spike.patch | 6 +- ...-get-a-BlockState-without-a-snapshot.patch | 10 +- ...0-PlayerNaturallySpawnCreaturesEvent.patch | 8 +- ...-Add-setPlayerProfile-API-for-Skulls.patch | 8 +- .../0175-Add-ArmorStand-Item-Meta.patch | 10 +- .../0182-Player.setPlayerProfile-API.patch | 16 +-- ...87-Flag-to-disable-the-channel-limit.patch | 4 +- ...6-Vanished-players-don-t-have-rights.patch | 6 +- patches/server/0232-Add-TNTPrimeEvent.patch | 6 +- ...dd-Early-Warning-Feature-to-WatchDog.patch | 18 +-- ...39-Use-a-Queue-for-Queueing-Commands.patch | 4 +- ...ile-Entities-from-a-chunk-without-sn.patch | 4 +- .../server/0253-Improve-death-events.patch | 18 +-- patches/server/0255-Mob-Pathfinding-API.patch | 4 +- ...-for-CanPlaceOn-and-CanDestroy-NBT-v.patch | 6 +- .../0263-Hook-into-CB-plugin-rewrites.patch | 4 +- patches/server/0266-Add-sun-related-API.patch | 6 +- ...store-custom-InventoryHolder-support.patch | 12 +- patches/server/0308-Add-Heightmap-API.patch | 4 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 11 +- .../0336-Entity-Activation-Range-2.0.patch | 12 +- patches/server/0342-Anti-Xray.patch | 18 +-- ...344-Improve-Block-breakNaturally-API.patch | 6 +- .../0370-Improved-Watchdog-Support.patch | 20 ++-- ...-Implement-Player-Client-Options-API.patch | 8 +- ...m-duplication-issues-and-teleport-is.patch | 16 +-- ...-per-thread-native-byte-buffer-cache.patch | 4 +- ...Wait-for-Async-Tasks-during-shutdown.patch | 6 +- ...ld-Difficulty-Remembering-Difficulty.patch | 14 +-- ...-Plugin-Tickets-to-API-Chunk-Methods.patch | 6 +- ...nvert-legacy-attributes-in-Item-Meta.patch | 6 +- .../0428-Support-components-in-ItemMeta.patch | 4 +- ...geEvent-not-firing-for-all-use-cases.patch | 8 +- ...p-capture-to-capture-all-items-added.patch | 14 +-- ...-track-plugin-scoreboards-by-default.patch | 4 +- .../server/0472-Optimise-getType-calls.patch | 8 +- .../0481-Add-ignore-discounts-API.patch | 6 +- ...-get-Material-from-Boats-and-Minecar.patch | 6 +- ...act-event-not-being-called-sometimes.patch | 6 +- .../server/0564-Expand-world-key-API.patch | 4 +- ...ignore-result-of-PlayerEditBookEvent.patch | 6 +- .../server/0573-Add-bypass-host-check.patch | 8 +- ...x-and-optimise-world-force-upgrading.patch | 14 +-- .../0604-Add-Unix-domain-socket-support.patch | 16 +-- ...cause-to-Weather-ThunderChangeEvents.patch | 14 +-- .../server/0608-More-Lidded-Block-API.patch | 20 ++-- .../0610-Add-PlayerKickEvent-causes.patch | 18 +-- ...0-Make-item-validations-configurable.patch | 30 ++--- patches/server/0626-Missing-Entity-API.patch | 44 ++++---- ...target-without-changing-other-things.patch | 4 +- ...prevent-NBT-copy-in-smithing-recipes.patch | 12 +- ...o-find-targets-for-lightning-strikes.patch | 6 +- ...uler-threads-according-to-the-plugin.patch | 4 +- ...-Fix-upstreams-block-state-factories.patch | 6 +- ...de-unnecessary-itemmeta-from-clients.patch | 12 +- .../server/0726-Collision-optimisations.patch | 14 +-- ...t-isSectionEmpty-int-and-optimize-Pa.patch | 4 +- ...d-canSmelt-methods-to-FurnaceInvento.patch | 6 +- ...48-Multiple-Entries-with-Scoreboards.patch | 4 +- ...-command-sender-which-forwards-feedb.patch | 6 +- ...dd-missing-block-data-mins-and-maxes.patch | 24 ++-- ...o-worldlist-before-initing-the-world.patch | 6 +- ...0775-Fix-falling-block-spawn-methods.patch | 6 +- patches/server/0778-More-Projectile-API.patch | 18 +-- .../0800-WorldCreator-keepSpawnLoaded.patch | 4 +- patches/server/0807-Don-t-tick-markers.patch | 6 +- patches/server/0832-More-Teleport-API.patch | 8 +- ...2-Add-Velocity-IP-Forwarding-Support.patch | 8 +- ...arameter-to-ProjectileSource-launchP.patch | 4 +- ...low-changing-bed-s-occupied-property.patch | 8 +- .../0871-Add-fire-tick-delay-option.patch | 4 +- .../0893-Properly-resend-entities.patch | 12 +- ...ssing-SpigotConfig-logCommands-check.patch | 4 +- ...hives-generating-from-using-bonemeal.patch | 4 +- ...definitions-of-trim-material-pattern.patch | 14 +-- ...anhasbukkit-default-if-alias-block-e.patch | 6 +- ...2-Fix-sniffer-removeExploredLocation.patch | 4 +- ...Suppress-Item-Meta-Validation-Checks.patch | 26 ++--- patches/server/0968-Fix-BanList-API.patch | 10 +- ...-API-for-updating-recipes-on-clients.patch | 6 +- ...-Implement-OfflinePlayer-isConnected.patch | 6 +- ...-method-of-Fireballs-change-the-trav.patch | 6 +- ...-NPE-in-SculkBloomEvent-world-access.patch | 4 +- 104 files changed, 605 insertions(+), 639 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 697d7fce6a..d64559b45a 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.1" apply false - id("io.papermc.paperweight.core") version "1.5.8" + id("io.papermc.paperweight.core") version "1.5.9" } allprojects { diff --git a/patches/server/0002-Remap-fixes.patch b/patches/server/0002-Remap-fixes.patch index 3393fe776c..dd48abe19a 100644 --- a/patches/server/0002-Remap-fixes.patch +++ b/patches/server/0002-Remap-fixes.patch @@ -88,36 +88,6 @@ index 95a5ce711150c4c999a9d17f28a497f034638610..214215d203892b8009595539f25ce26e private LootContextParamSet paramSet; private Optional randomSequence; -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftParticle.java b/src/main/java/org/bukkit/craftbukkit/CraftParticle.java -index 8a7d1c7b214a29f1364f42c1eb0aa89d0e3e4b41..af88ca7eaf94dc52d4b9dd96ffc8f8c956230812 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftParticle.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftParticle.java -@@ -113,7 +113,7 @@ public abstract class CraftParticle implements Keyed { - private static final BiFunction, CraftParticle> VOID_FUNCTION = (name, particle) -> new CraftParticle<>(name, particle, Void.class) { - @Override - public ParticleOptions createParticleParam(Void data) { -- return (SimpleParticleType) CraftParticle.this.getHandle(); -+ return (SimpleParticleType) this.getHandle(); // Paper - fix? - } - }; - -@@ -129,14 +129,14 @@ public abstract class CraftParticle implements Keyed { - BiFunction, CraftParticle> itemStackFunction = (name, particle) -> new CraftParticle<>(name, particle, ItemStack.class) { - @Override - public ParticleOptions createParticleParam(ItemStack data) { -- return new ItemParticleOption((net.minecraft.core.particles.ParticleType) CraftParticle.this.getHandle(), CraftItemStack.asNMSCopy(data)); -+ return new ItemParticleOption((net.minecraft.core.particles.ParticleType) this.getHandle(), CraftItemStack.asNMSCopy(data)); // Paper - fix? - } - }; - - BiFunction, CraftParticle> blockDataFunction = (name, particle) -> new CraftParticle<>(name, particle, BlockData.class) { - @Override - public ParticleOptions createParticleParam(BlockData data) { -- return new BlockParticleOption((net.minecraft.core.particles.ParticleType) CraftParticle.this.getHandle(), ((CraftBlockData) data).getState()); -+ return new BlockParticleOption((net.minecraft.core.particles.ParticleType) this.getHandle(), ((CraftBlockData) data).getState()); // Paper - fix? - } - }; - diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java index b70450722da13bc4d358a70d3d1d2f30a2cca2b9..86d86c292bdeeb7f42685691287c3b4bd476ea14 100644 --- a/src/test/java/org/bukkit/DyeColorsTest.java diff --git a/patches/server/0005-Paper-config-files.patch b/patches/server/0005-Paper-config-files.patch index 328de5913d..8c419b8763 100644 --- a/patches/server/0005-Paper-config-files.patch +++ b/patches/server/0005-Paper-config-files.patch @@ -15,7 +15,7 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES diff --git a/build.gradle.kts b/build.gradle.kts -index 677ec3d3b440dba6fd38ffb6f1102794ab3b013a..fd4eb839bbfa99a66ad30289d29bdc6a9fd1f3c8 100644 +index 844eff88c9ad95871900c2d8aa3136b3f2928bf9..3aca132fcbd7dce2b26ac17f8e365d5f22d61e8d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,6 +12,7 @@ dependencies { @@ -4774,7 +4774,7 @@ index 2ac60ea28ce722cdef61cfdc69bbbdf391628238..9cfdd5d8c1650d9c9bdfbc07980239e5 String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bc4f2e0a7086825ba8d1a503a65a4375d6c90d72..1561b26e1b4115f4d5631f20b31c2238d1d23202 100644 +index 0e7c2e2d796aa2f29ab9a0d44a52f833b1ee6f77..7fca1f7a7ba2a6f6238eddc134f78f9abdc1531b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // 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 fb5043e69ef59623c51b88176914f9f8becfc9ae..084339c7da80ce21ab8405e20b76af87dbbbe8ce 100644 +index 2206e1846526df05636e80afbb499a867a26f1b7..a10f3b9b07692333a2d243bc5591e6e6a43fdf06 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -251,6 +251,8 @@ public class ServerPlayer extends Player { @@ -7159,7 +7159,7 @@ index a63d5ba706a5b8e430aedc045bdeb3a410bd0eef..e96a0ca47e4701ba187555bd92c96834 public BlockState getBlockState(BlockPos pos) { return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 7f2ef8946be167e899656141d61921a2ff6356b0..fc56906135347e0d5e4b18c39adef6932496d924 100644 +index 11d3b31be43c0e57a47578caff3014a205bb3beb..4c64ab1533534a1d5757722c796771b03db6367f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -178,6 +178,7 @@ public abstract class PlayerList { @@ -7189,7 +7189,7 @@ index 337e0a7b3c14e1b1a28744920e0dc0a69e0c5a87..f5829ae484d93b547a5437b85a962134 @Override public void tell(R runnable) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0863d7acce248895d57a4c0496881b542e4b79f1..6c5000ff3dbb7517d095e9fb2cdf555212b2c090 100644 +index 33a88623ef7011fd60b2e4dd008bf54635714d81..9a29dea3c02cbca89faaa1cd9b750f1a2694d100 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -323,6 +323,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -7205,7 +7205,7 @@ index 0863d7acce248895d57a4c0496881b542e4b79f1..6c5000ff3dbb7517d095e9fb2cdf5552 public Entity(EntityType type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index d2458b1e6c34477b2e97a748edba9981af792587..e472679f23d2b9e727fec6f322f84fabbe0d02be 100644 +index ba1c0ce4088b711897c028d62605b50719a89040..8fa96e6875b1d5dd66ef536d76648170b912c919 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -258,6 +258,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -7388,7 +7388,7 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..db61b6b0158a9bcc0e1d735e34fe3671 public BlockState getBlockState(BlockPos pos) { return Blocks.AIR.defaultBlockState(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index bacd4d875642cd93c3185f788745dd73a3cfde8a..003e2064f64115d1f5c48ac97e16100d4c10c5d7 100644 +index 9f877007869ef984d2c95bd8e3d773a2b98f202c..384cb02b124dac42521767b0aff481a1b12c0eab 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -90,6 +90,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -7620,7 +7620,7 @@ index 532a0cae6db0d830e720a72e9021aa7a8ed0f106..e5e562f75e7d4b6a750f192842940c5e this.levelHeightAccessor = heightLimitView; this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()]; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 4185b7528ac757a2d6ebca4da4d46e65b7a981d0..b32e1bba27c91e81b7382072c4d8230db695066c 100644 +index 57805b84054e44a3d7c95cf269316a42205bb99c..17d36b53ec8efbc60b0648764f7195003e40fdcc 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -114,6 +114,109 @@ public class LevelChunk extends ChunkAccess { @@ -7856,7 +7856,7 @@ index 25156be63f91a1c41ef41154f675d04eb97459a8..47bab513feec217d875192afef61f3af return false; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 146cf1168c82430b4faf35d7544abbec8e5f1c08..ea49dea83b9e8fa168e2a83451eed1b5977a336e 100644 +index 300e79c796dcfcacd4e4828cd239291de54e07f0..9e1c76fe26a07bc211182b819df611b7b8fd2a13 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -243,8 +243,8 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -7913,7 +7913,7 @@ index 146cf1168c82430b4faf35d7544abbec8e5f1c08..ea49dea83b9e8fa168e2a83451eed1b5 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index bdf7d8e4256626b6866f8c6fed1fde64b7cc6892..2a55bbd728aea55a6ca0f6a7d856d1e3a3f1e1a3 100644 +index c2a1c122f2072759ee69833f3529a89cde3ba535..145542a29cc7df606328a106dd044db956b2c8ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1202,4 +1202,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -7955,7 +7955,7 @@ index bdf7d8e4256626b6866f8c6fed1fde64b7cc6892..2a55bbd728aea55a6ca0f6a7d856d1e3 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 34a54a99e7484b2934e1d174c1b55f0472ff3812..40aad6a209fbded448e3db21207a85d9f2875e71 100644 +index c6881e1d74476c2633e2c2bd3636134c844c5942..8eb170bd71c7158dcd1b90f9c8d46a13a2202509 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -23,6 +23,16 @@ import org.bukkit.material.MaterialData; @@ -7976,7 +7976,7 @@ index 34a54a99e7484b2934e1d174c1b55f0472ff3812..40aad6a209fbded448e3db21207a85d9 if (original instanceof CraftItemStack) { CraftItemStack stack = (CraftItemStack) original; diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 07249989e6f0f76f8408363d7f20e7335b7a8e06..4d94c3a19f98f78476ecc403f410d75a6ea57c2d 100644 +index 591c71352ad2a041ba5dc3d05b7ebc65fcca5e3c..e359668d9f4fceae13bf6c36842db9f2b2817c9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -44,6 +44,7 @@ import org.bukkit.scheduler.BukkitWorker; @@ -8026,7 +8026,7 @@ index 07249989e6f0f76f8408363d7f20e7335b7a8e06..4d94c3a19f98f78476ecc403f410d75a this.currentTask = null; } diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -index 592a2a513ebf0002abf1255e11012ecc66adecf0..b89846e0f645c79afec018dae1d64a1bda043ed9 100644 +index e4d1eb4a0ce2c9874922585f6bb0d9ead433fde1..d56abf283f38548faa790c57045033f7ade6f958 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java @@ -40,6 +40,21 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot @@ -8300,7 +8300,7 @@ index d2026d218405a40a6949c5f491c04704811b72b5..629178347039893fb9de710810fe8112 public WorldBorder getWorldBorder() { throw new UnsupportedOperationException("Not supported yet."); diff --git a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java -index aced43492a32d603690e75d0d9877667770fc6db..40d6bf127d288340e9c2500732d1e0963c186ebd 100644 +index 96c4f7aed548a181f6b1487e58dcf157bae52daa..837e3d6ee71566b5a6f37a49438291333c47f5d1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java +++ b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java @@ -120,6 +120,32 @@ public class UnsafeList extends AbstractList implements List, RandomAcc @@ -8337,7 +8337,7 @@ index aced43492a32d603690e75d0d9877667770fc6db..40d6bf127d288340e9c2500732d1e096 public void clear() { // Create new array to reset memory usage to initial capacity diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index b599e098e6d2e6f78b89114e05cb03d716b7c5f4..83eabc34d952bbb13ec4b4bdcf34f647189c0b46 100644 +index d10b1d3a134e11fa8417fa3c845f088d8fc1f71c..1d066ce7dcf5f548c2a34d308d4422ab4fd02e5a 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -118,7 +118,11 @@ public class SpigotConfig @@ -8352,4 +8352,4 @@ index b599e098e6d2e6f78b89114e05cb03d716b7c5f4..83eabc34d952bbb13ec4b4bdcf34f647 + // Paper end try { - SpigotConfig.config.save( CONFIG_FILE ); + SpigotConfig.config.save( SpigotConfig.CONFIG_FILE ); diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 1dd7a54bb9..f5124be039 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2152,7 +2152,7 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490 buf.writeComponent(this.footer); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2a7c614df7b9c9405a5dd23e6a888ede7fc86683..794ab78d91cb54008679aecbc8f01edaa6501cab 100644 +index 36748baf6030028f083902459797f0719f50e456..b04967ebfc45222e294f932cfd3df3785f8198c6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -190,6 +190,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot @@ -2249,7 +2249,7 @@ index 2a7c614df7b9c9405a5dd23e6a888ede7fc86683..794ab78d91cb54008679aecbc8f01eda public boolean logIPs() { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 084339c7da80ce21ab8405e20b76af87dbbbe8ce..f7674978f032f020887546f593024c1442719127 100644 +index a10f3b9b07692333a2d243bc5591e6e6a43fdf06..936e3e0563a2443e13eae1e8875080187420cf4e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -156,6 +156,7 @@ import net.minecraft.world.scores.Score; @@ -2351,7 +2351,7 @@ index 084339c7da80ce21ab8405e20b76af87dbbbe8ce..f7674978f032f020887546f593024c14 this.chatVisibility = clientOptions.chatVisibility(); this.canChatColor = clientOptions.chatColors(); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index e7a9dd7791a0dd200c4d74922c6e5adaa5013669..b9062fe651de34d5b3f9d5f146ae0b4fe29cbfee 100644 +index a6eddf98feb254d6694b553c6dc0a92034db269b..0a0a9f1be333911b6de7502a9541063ab9ea0164 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -47,7 +47,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -2428,7 +2428,7 @@ index ea26375d6f23b14a8a1cd926fe410713551de99d..ed80d9551cd7cc1ec26a5d5fd7bc185b @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bbd256d088879f04762fcf628573f1348e4961a8..1c0a14dc1ddfe7806d06af83f9b5de6e42b4b0cc 100644 +index 866e515ed6c6b73ca277df8931e24757b616a757..46f2da7f90fd92e6cbd1ae371d04af85ade86ec1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -45,6 +45,7 @@ import net.minecraft.nbt.ListTag; @@ -2500,7 +2500,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..1c0a14dc1ddfe7806d06af83f9b5de6e + // Paper end + } else if (false) { // Paper Player player = this.getCraftPlayer(); - AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(server)); + AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); String originalFormat = event.getFormat(), originalMessage = event.getMessage(); @@ -2044,7 +2053,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } @@ -2520,7 +2520,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..1c0a14dc1ddfe7806d06af83f9b5de6e @Override diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 7d3a924a56f8a3f5756400e26e67581ebff27445..ef5d73a296982d8b9ac022c5ea755843c2da1c84 100644 +index 744ffa9410e3d11344472e64d2e08cb5e8608e30..0d1102e1b98235b8e7124321a65483a5e923d4a5 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -290,7 +290,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -2548,20 +2548,20 @@ index 7d3a924a56f8a3f5756400e26e67581ebff27445..ef5d73a296982d8b9ac022c5ea755843 } } diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -index 1cb95db25a20d38faacd99a5805630c1598e9db3..d99b2235038eb1aba8cda474c4aa51e207149ef4 100644 +index b23480fab4a7cba922b36cb31d4f77f720bf3aac..7dd3dfd2ccc820d45849a89707239b7dbcaf44c3 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java @@ -57,7 +57,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene CraftIconCache icon = server.server.getServerIcon(); ServerListPingEvent() { -- 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 +- super(ServerStatusPacketListenerImpl.this.connection.hostname, ((InetSocketAddress) ServerStatusPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(), server.getMotd(), server.getPlayerList().getMaxPlayers()); ++ super(ServerStatusPacketListenerImpl.this.connection.hostname, ((InetSocketAddress) ServerStatusPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(), server.server.motd(), server.getPlayerList().getMaxPlayers()); // Paper - Adventure } @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index fc56906135347e0d5e4b18c39adef6932496d924..b278ecc71399b3c6f30040402a38e6673ff823e8 100644 +index 4c64ab1533534a1d5757722c796771b03db6367f..cb8859c37fb8ce46a8fd529ca885456ea86c1c2b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -270,7 +270,7 @@ public abstract class PlayerList { @@ -2866,7 +2866,7 @@ index 23bdb77690ba15bcbbfb0c70af23336d08ac7752..8f144a357174bbe096ac9b38a5e67a61 } collection = icons; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a694a208f7c84f4c2ffa654cdf96942e483eedba..39a3ab010a2960ea99a6cc246edd343994bb523f 100644 +index 137aa7963d2d4f8477da1923f3bfdcb8acf2c65e..cbec0bf7822e9cf10b9ab4cc406eb1ea430f071a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -616,8 +616,10 @@ public final class CraftServer implements Server { @@ -2979,7 +2979,7 @@ index a694a208f7c84f4c2ffa654cdf96942e483eedba..39a3ab010a2960ea99a6cc246edd3439 return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); } @@ -2005,6 +2051,17 @@ public final class CraftServer implements Server { - return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) + return Thread.currentThread().equals(this.console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) } + // Paper start - Adventure @@ -3051,7 +3051,7 @@ index a694a208f7c84f4c2ffa654cdf96942e483eedba..39a3ab010a2960ea99a6cc246edd3439 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ea49dea83b9e8fa168e2a83451eed1b5977a336e..7efdca87cc2dda12e545d053e9fea271e9f857d1 100644 +index 9e1c76fe26a07bc211182b819df611b7b8fd2a13..264cdde172452d0d9df652b0e78b21b6a6561300 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -153,6 +153,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -3122,7 +3122,7 @@ index ea49dea83b9e8fa168e2a83451eed1b5977a336e..7efdca87cc2dda12e545d053e9fea271 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 67d408b79422cf0c4aed6636cfd4ebb9e13e19f9..442beb8675d6d53a92fb6a5b7c2abdda2822e6fe 100644 +index 3523f8851472890c97e628e22df883b91ba603fe..9fb74017c655c5abe4388796c4cb0760498e7a99 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -20,6 +20,12 @@ public class Main { @@ -3139,7 +3139,7 @@ index 67d408b79422cf0c4aed6636cfd4ebb9e13e19f9..442beb8675d6d53a92fb6a5b7c2abdda OptionParser parser = new OptionParser() { { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -index 3ddf4cb8d6398bb6b0784c23b4eaae4abfbab47d..57925335811f814fbd6010e58dc0566401cae21d 100644 +index e891b8d1c541d32b1e107fbf104655f4a1d1a58d..c4890927419e27fd35e4e373fb09dcb182234fbf 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java @@ -71,6 +71,19 @@ public class CraftBeacon extends CraftBlockEntityState implem @@ -3163,7 +3163,7 @@ index 3ddf4cb8d6398bb6b0784c23b4eaae4abfbab47d..57925335811f814fbd6010e58dc05664 public String getCustomName() { BeaconBlockEntity beacon = this.getSnapshot(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java -index 5a5ebbf8de32b94109efc67a0dd0053f9fb80917..bdd0647d683565088e5cfcd43fb26f4b776db338 100644 +index 8d7efe856e79d9245da7dd2c7f807d7e227e2816..7f5d930b6bfaf9a0042f9be4be68f2cc111b304e 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCommandBlock.java @@ -39,4 +39,16 @@ public class CraftCommandBlock extends CraftBlockEntityState @@ -3232,7 +3232,7 @@ index 459e134e96121e611dd864f66a3f2cb64dbaf61c..ecb6f846cdaa2e9f01853001b1626315 public String getCustomName() { EnchantmentTableBlockEntity enchant = this.getSnapshot(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -index f0be770664d4fa9bc2b3930cd9b449564873e153..c4fb012488202769ea221d66a8f05cb949b6c815 100644 +index 1791d435552b812856f38dc6d8a97182b1a8eb12..94caa0915e1a9ec1c46c7a0380db840901cc8063 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -33,6 +33,23 @@ public class CraftSign extends CraftBlockEntityState< @@ -3281,7 +3281,7 @@ index f0be770664d4fa9bc2b3930cd9b449564873e153..c4fb012488202769ea221d66a8f05cb9 Component[] components = new Component[4]; diff --git a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java -index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..4747d77fd5fd12116ef40d897a08c7baca60a399 100644 +index d4724c812f8b7322ad59dc0695d01ceb47772dc4..4747d77fd5fd12116ef40d897a08c7baca60a399 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java +++ b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java @@ -12,37 +12,70 @@ import org.jetbrains.annotations.Nullable; @@ -3337,9 +3337,9 @@ index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..4747d77fd5fd12116ef40d897a08c7ba - // Lazy initialization: - Component[] messages = this.signText.getMessages(false); - this.lines = new String[messages.length]; -- System.arraycopy(CraftSign.revertComponents(messages), 0, lines, 0, lines.length); -- this.originalLines = new String[lines.length]; -- System.arraycopy(lines, 0, originalLines, 0, originalLines.length); +- System.arraycopy(CraftSign.revertComponents(messages), 0, this.lines, 0, this.lines.length); +- this.originalLines = new String[this.lines.length]; +- System.arraycopy(this.lines, 0, this.originalLines, 0, this.originalLines.length); - } - return this.lines; + // Paper start @@ -3372,7 +3372,7 @@ index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..4747d77fd5fd12116ef40d897a08c7ba public SignText applyLegacyStringToSignSide() { if (this.lines != null) { -- for (int i = 0; i < lines.length; i++) { +- for (int i = 0; i < this.lines.length; i++) { - String line = (this.lines[i] == null) ? "" : this.lines[i]; - if (line.equals(this.originalLines[i])) { + // Paper start @@ -3390,7 +3390,7 @@ index 43f6ac44525048faf0b0cd2c11f9bc36fa0cab5d..4747d77fd5fd12116ef40d897a08c7ba return this.signText; diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java -index 3de88112bdb08d6bd0d28f20582c4090bfd8dbfe..87f2cea36d852c81fdb0a1bc21162d41377ab2e7 100644 +index 59771cbfefeba8b582cd16dcf72c4ec177781a54..ab4142dfb23fc3bcf225f487f81bfdce035d8778 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java @@ -45,6 +45,18 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc @@ -3443,7 +3443,7 @@ index f3cb4102ab223f379f60dac317df7da1fab812a8..324e6d1a4fadd3e557e4ba05f04e6a58 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java -index d545a3fa3d7728f9d4761175fc0acaa7a6fe3b01..ad731c5f76f19394866a121c64d4169ea8fb8cd7 100644 +index e3c7fa50fad3077a297d2412de9d26d53371808c..5b7d230103f421fb939072e1526854f715430e51 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java @@ -39,6 +39,13 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme @@ -3510,7 +3510,7 @@ index 8107ed0d248ff2a1cf8e556b7610a68f6c197691..eaff8df6c8c12c64e005a68a02e2e35e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index f6c614bb1184f9c79121f64a2a030bf3f094b671..e8334e2264510f5101e80b4f130e7ae1442560d7 100644 +index 07de73a43d6db344299442b35e17c6832b8e5a25..9ae78a0fe829c7487a945a801dbbca2375da1cbb 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -189,6 +189,12 @@ public class CraftEnchantment extends Enchantment { @@ -3527,7 +3527,7 @@ index f6c614bb1184f9c79121f64a2a030bf3f094b671..e8334e2264510f5101e80b4f130e7ae1 public net.minecraft.world.item.enchantment.Enchantment getHandle() { return this.target; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2a55bbd728aea55a6ca0f6a7d856d1e3a3f1e1a3..1557a28769cfe875b4c81ed503b2c1815caf8d90 100644 +index 145542a29cc7df606328a106dd044db956b2c8ff..8be1e47f7cd6940b0ba213a2da0cc8334b256fc3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -206,6 +206,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -3590,7 +3590,7 @@ index 2a55bbd728aea55a6ca0f6a7d856d1e3a3f1e1a3..1557a28769cfe875b4c81ed503b2c181 @Override public boolean isPermissionSet(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 92ce36e3420e778ed39706e86b06389c4b13697f..b9578f7d0f61d15bee1f99181bf932cdbb0e611c 100644 +index 454094dd30a119d5540a2af7c8fb8034573d7887..2bc97adea45672cdb5c8891a9fa461b2a81ff4e6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -320,9 +320,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -3624,7 +3624,7 @@ index 92ce36e3420e778ed39706e86b06389c4b13697f..b9578f7d0f61d15bee1f99181bf932cd player.initMenu(container); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java -index 10fa80df3ae2406f34af669f89d087b15ad1d71b..66fb6aeb49b7e93d2a4d9b5ce7f1a7d68f571cf5 100644 +index 61759e8179d0f6342abf0c0294e5a024928db8d9..92e21126a9347f1ee2279ab09bb6abf2344ad2e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java @@ -59,6 +59,13 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca @@ -3642,7 +3642,7 @@ index 10fa80df3ae2406f34af669f89d087b15ad1d71b..66fb6aeb49b7e93d2a4d9b5ce7f1a7d6 public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6c75e58ccb778d5f292c23743944b04bf3d2967e..d78b466e0e97557da78424c09ba1b61947c64dcd 100644 +index 4cc709edc8de43639fd8d6b54d160b023a7e50b7..d7260f96da9974c721a8b49c1f9b0f1ee56c6ce1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -296,14 +296,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3656,7 +3656,7 @@ index 6c75e58ccb778d5f292c23743944b04bf3d2967e..d78b466e0e97557da78424c09ba1b619 @Override public void setDisplayName(final String name) { + this.getHandle().adventure$displayName = name != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(name) : net.kyori.adventure.text.Component.text(this.getName()); // Paper - this.getHandle().displayName = name == null ? getName() : name; + this.getHandle().displayName = name == null ? this.getName() : name; } + // Paper start @@ -3684,7 +3684,7 @@ index 6c75e58ccb778d5f292c23743944b04bf3d2967e..d78b466e0e97557da78424c09ba1b619 + // Paper end @Override public String getPlayerListName() { - return this.getHandle().listName == null ? getName() : CraftChatMessage.fromComponent(this.getHandle().listName); + return this.getHandle().listName == null ? this.getName() : CraftChatMessage.fromComponent(this.getHandle().listName); @@ -322,42 +347,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } @@ -3696,14 +3696,14 @@ index 6c75e58ccb778d5f292c23743944b04bf3d2967e..d78b466e0e97557da78424c09ba1b619 @Override public String getPlayerListHeader() { -- return (this.playerListHeader == null) ? null : CraftChatMessage.fromComponent(playerListHeader); -+ return (this.playerListHeader == null) ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(playerListHeader); +- return (this.playerListHeader == null) ? null : CraftChatMessage.fromComponent(this.playerListHeader); ++ return (this.playerListHeader == null) ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.playerListHeader); } @Override public String getPlayerListFooter() { -- return (this.playerListFooter == null) ? null : CraftChatMessage.fromComponent(playerListFooter); -+ return (this.playerListFooter == null) ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(playerListFooter); // Paper - Adventure +- return (this.playerListFooter == null) ? null : CraftChatMessage.fromComponent(this.playerListFooter); ++ return (this.playerListFooter == null) ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.playerListFooter); // Paper - Adventure } @Override @@ -4137,7 +4137,7 @@ index 5725b0281ac53a2354b233223259d6784353bc6e..9ef939b76d06874b856e0c850addb364 @Override public int getLineWidth() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 789469a9bae1c486180b19a32739334b4e0a37bc..73c6bbb854db86a58285466699358eeec4e603a0 100644 +index bd21d57ea4a51ffa14c3650a67b12bed7f6b2f1f..a3cef5eea75fb868dadda191c61c119086cc7638 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -879,9 +879,9 @@ public class CraftEventFactory { @@ -4162,7 +4162,7 @@ index 789469a9bae1c486180b19a32739334b4e0a37bc..73c6bbb854db86a58285466699358eee return event; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java -index bfaa48cfda08c2716f61032b71d38285a9f715e8..1b526fff47e5a3d9a5325c73966dd2bf3dbbdc19 100644 +index d32a20caeaf54e2db3c926f36b7efffba2a613b5..1b4b397c08d7c05f5a066274a00a6ec80601624a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -72,6 +72,13 @@ public class CraftContainer extends AbstractContainerMenu { @@ -4178,7 +4178,7 @@ index bfaa48cfda08c2716f61032b71d38285a9f715e8..1b526fff47e5a3d9a5325c73966dd2bf + @Override public String getTitle() { - return title; + return this.title; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java index c9cc23757a9fcc58d30b2915d4c5cfbc7d1c767a..fc0e1212022d1aa3506699b60ef338196eb54eba 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java @@ -4346,7 +4346,7 @@ index 9e05a8515c5f6f340182e91150fcad8bbf80a22b..adf22ce4f0bcd3bd57dc2030c6c92d3d @Override public CraftMerchant getCraftMerchant() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index bd4524fd987877a287680cfa5744ce12045ebfbd..5d72d2c6fcab478121eb9b4216cf79532b58299e 100644 +index 7753018d4e36091d25badc030ed8a3c9e431a369..5e01357208fe52c1d270c68cb19029ea0f4057bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -2,8 +2,9 @@ package org.bukkit.craftbukkit.inventory; @@ -4519,7 +4519,7 @@ index bd4524fd987877a287680cfa5744ce12045ebfbd..5d72d2c6fcab478121eb9b4216cf7953 if (this.hasTitle()) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..5c6eb9b6f3ca4fc6534fe023fe78be5c9f97e1a9 100644 +index cc588fb207062829637adad79129ca91950496cb..8b27ca7606869798486c3afd03e86205c9864018 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java @@ -1,6 +1,6 @@ @@ -4562,7 +4562,7 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..5c6eb9b6f3ca4fc6534fe023fe78be5c + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 0cb3806b57c5a381b7f1fc04dcb7cfbf74fb5ef4..d1b2ff690580edb4e42cce6607afb189f28fb09a 100644 +index 491bb97e478d8eac29d4682d0f54eb70c748151c..3d5abdf6986457e39fb216d8f5e257c9df880078 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -750,6 +750,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -4583,7 +4583,7 @@ index 0cb3806b57c5a381b7f1fc04dcb7cfbf74fb5ef4..d1b2ff690580edb4e42cce6607afb189 + @Override public String getDisplayName() { - return CraftChatMessage.fromJSONComponent(displayName); + return CraftChatMessage.fromJSONComponent(this.displayName); @@ -785,6 +797,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore != null && !this.lore.isEmpty(); } @@ -4635,7 +4635,7 @@ index ed4415f6dd588c08c922efd5beebb3b124beb9d6..78a7ac47f20e84ccd67ff44d0bc7a2f2 return new CraftInventoryCustom(owner, size, title); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java -index e69d5635d1c81a3bed54d2cb1b0316efb522ab5d..d09fc01a20e8426f4094899060c70e011ff65887 100644 +index 163172fefcbe422972355b70f2ab2a4fb68ccb5c..25d1f24b6051851b905dfdbd4c5e30e6a80bc459 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java @@ -44,6 +44,12 @@ public final class CraftInventoryCreator { @@ -4734,20 +4734,20 @@ index 1980240d3dc0331ddf2ff56e163e2bfbd3b231ab..7a7f3f53aef601f124d474d9890e23d8 public Inventory createInventory(InventoryHolder holder, InventoryType type, String title) { // BrewingStand does not extend TileEntityLootable diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java -index 2bdbd99abc4f7c3ec6a27e3000b63f908554735c..2d2bf5c37709b8e747fbfa2db5ce86f258e86224 100644 +index efb8f84534565efd37e3f934d2cb8527771db338..15e9dd8844f893de5e8372b847c9e8295d6f69ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java +++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java @@ -42,7 +42,7 @@ public class CraftMapRenderer extends MapRenderer { } - MapDecoration decoration = worldMap.decorations.get(key); + MapDecoration decoration = this.worldMap.decorations.get(key); - cursors.addCursor(decoration.x(), decoration.y(), (byte) (decoration.rot() & 15), decoration.type().getIcon(), true, CraftChatMessage.fromComponent(decoration.name())); + cursors.addCursor(decoration.x(), decoration.y(), (byte) (decoration.rot() & 15), decoration.type().getIcon(), true, decoration.name() == null ? null : io.papermc.paper.adventure.PaperAdventure.asAdventure(decoration.name())); // Paper } } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java -index 4f498569462a8812bbe77b57f9a2f15e8735a90a..be3e1c4765ba891462e36ce5b6e35f16e3ec189a 100644 +index 17d9ef64feef6907681e09a570fb04727ea0b83b..5a9adade82970d8101b946596370d104721ac086 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java @@ -31,6 +31,21 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective @@ -4828,7 +4828,7 @@ index e9cdca6d5fac186ef18167e183518ecade7b4471..3f09420ba9268ac1dc5440c073974437 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java -index 5540a766bc7edf8985058e29cc419c2c6b1d4428..baff11728120fda1740d5e15163760f50fe1cd1d 100644 +index 4d586e1375ed8782939c9d480479e0dd981f8cbc..c0362c54d0d097ad6cd4616b3ab194e51258da1e 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -26,6 +26,63 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { @@ -4896,7 +4896,7 @@ index 5540a766bc7edf8985058e29cc419c2c6b1d4428..baff11728120fda1740d5e15163760f5 @Override public String getDisplayName() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f533188becc6f7 100644 +index 0be5b600b5701f6132b52b8928dc5926b52201f3..19a102792fab30f8f6a7364d0a9b4063d76f1489 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -291,6 +291,7 @@ public final class CraftChatMessage { @@ -4969,23 +4969,23 @@ index 62c66e3179b9557cdba46242df0fb15bce7e7710..73a37638abacdffbff8274291a64ea6c public boolean isLazy() { return this.reference == null; diff --git a/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java b/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java -index 75bc9ea10d80270217e4c75da98257a217b20097..673ab940fb53d42f6b6dbfe048d0281c4f508b0d 100644 +index 0ab4c7eaffe69b314423732dd529aaeafc476e08..8a44e7260518bda87c6d0eeade98d5b81a04c3b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java +++ b/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java -@@ -16,9 +16,15 @@ public class LazyPlayerSet extends LazyHashSet { +@@ -16,9 +16,14 @@ public class LazyPlayerSet extends LazyHashSet { } @Override - HashSet makeReference() { + protected HashSet makeReference() { // Paper - protected - Preconditions.checkState(reference == null, "Reference already created!"); - List players = this.server.getPlayerList().players; + Preconditions.checkState(this.reference == null, "Reference already created!"); +- List players = this.server.getPlayerList().players; + // Paper start + return makePlayerSet(this.server); + } + public static HashSet makePlayerSet(final MinecraftServer server) { -+ // Paper end + List players = server.getPlayerList().players; ++ // Paper end HashSet reference = new HashSet(players.size()); for (ServerPlayer player : players) { reference.add(player.getBukkitEntity()); diff --git a/patches/server/0013-Paper-Plugins.patch b/patches/server/0013-Paper-Plugins.patch index 93fefb0bec..4507a81829 100644 --- a/patches/server/0013-Paper-Plugins.patch +++ b/patches/server/0013-Paper-Plugins.patch @@ -6994,7 +6994,7 @@ index 9cfdd5d8c1650d9c9bdfbc07980239e507ff942d..ae0b713870976d4b1e469a90cef9b2e2 Bootstrap.validate(); Util.startTimerHackThread(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f75e17f3b475fcdaa2aa83829df647a09b863071..bf4a82c183ad0aa148c6c14615d2d2606a8befb3 100644 +index 8461cf5f99144edce646909a41208f702f1e2aff..e17ad4a7f7adcf7d54bcfa56dbb109fc5611574a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -274,7 +274,8 @@ public final class CraftServer implements Server { @@ -7013,7 +7013,7 @@ index f75e17f3b475fcdaa2aa83829df647a09b863071..bf4a82c183ad0aa148c6c14615d2d260 public void loadPlugins() { - this.pluginManager.registerInterface(JavaPluginLoader.class); - -- File pluginFolder = (File) console.options.valueOf("plugins"); +- File pluginFolder = (File) this.console.options.valueOf("plugins"); - - if (pluginFolder.exists()) { - Plugin[] plugins = this.pluginManager.loadPlugins(pluginFolder); diff --git a/patches/server/0014-Timings-v2.patch b/patches/server/0014-Timings-v2.patch index a3b10b8c76..bbdc21e9a4 100644 --- a/patches/server/0014-Timings-v2.patch +++ b/patches/server/0014-Timings-v2.patch @@ -732,7 +732,7 @@ index 6f1501e13e29ce25919c23213df53248c4b454d7..047fc7206131e0f36ab45d04e98b7a23 } catch (Exception exception) { if (exception instanceof ReportedException) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 794ab78d91cb54008679aecbc8f01edaa6501cab..0eb3a55cbf2ed2c3f5e809ee60aba3767f7aa01b 100644 +index b04967ebfc45222e294f932cfd3df3785f8198c6..7abd42e34ce14618f4987933cdd230879b6ac804 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -185,7 +185,7 @@ import org.bukkit.craftbukkit.Main; @@ -924,7 +924,7 @@ index 188ac9b2879d339a268f6c100c23f1dce90c195a..d10abd28c522612934aada8124e5bb67 i = this.context.runTopCommand(customfunction1, source); } finally { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index ff3f00cf1d5180f83b16acac5676aa22cd967c8a..5aa21689e308842fe5b64689265ba45a299f7ad5 100644 +index bf37590324fc900b1ae0cb49a0f8eaf6af81e93f..71e1f83e871f27f3de3afdbbeb432a9135d51f8b 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -58,8 +58,9 @@ import org.apache.logging.log4j.Level; @@ -966,13 +966,10 @@ index ff3f00cf1d5180f83b16acac5676aa22cd967c8a..5aa21689e308842fe5b64689265ba45a this.executeBlocking(() -> { CommandSourceStack wrapper = rconConsoleSource.createCommandSourceStack(); RemoteServerCommandEvent event = new RemoteServerCommandEvent(rconConsoleSource.getBukkitSender(wrapper), s); -@@ -684,9 +687,40 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -684,9 +687,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (event.isCancelled()) { return; } -- ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper); -- server.dispatchServerCommand(event.getSender(), serverCommand); -+ + // Paper start + command.set(event.getCommand()); + if (event.getCommand().toLowerCase().startsWith("timings") && event.getCommand().toLowerCase().matches("timings (report|paste|get|merged|seperate)")) { @@ -987,8 +984,8 @@ index ff3f00cf1d5180f83b16acac5676aa22cd967c8a..5aa21689e308842fe5b64689265ba45a + co.aikar.timings.Timings.generateReport(new co.aikar.timings.TimingsReportListener(sender, waitable)); + } else { + // Paper end -+ ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper); -+ server.dispatchServerCommand(event.getSender(), serverCommand); + ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper); + this.server.dispatchServerCommand(event.getSender(), serverCommand); + } // Paper }); + // Paper start @@ -1010,7 +1007,7 @@ index ff3f00cf1d5180f83b16acac5676aa22cd967c8a..5aa21689e308842fe5b64689265ba45a // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 10132390dd356461f696971b34df3eeed05c572e..4dc04c16453174dde2c6bfad711ec9dec01c8f30 100644 +index 770f6a08c613093577172385549df8040ded627b..c1bb511cc25ca97282ee02d2b207e2940279c190 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,8 +1,10 @@ @@ -1067,14 +1064,14 @@ index 10132390dd356461f696971b34df3eeed05c572e..4dc04c16453174dde2c6bfad711ec9de } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index f402341b95c7752a2706edd502098696f786f4ef..b1fd6118132ba38f60d2a2b15c09231fa29be8fa 100644 +index 4ff18d9995d5d26bde4dbe2ec31c77c2d1515227..c2db2aad2498f0be2e904d5869a9b0bd3411618c 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -415,13 +415,15 @@ public class ServerChunkCache extends ChunkSource { } gameprofilerfiller.incrementCounter("getChunkCacheMiss"); -- level.timings.syncChunkLoadTimer.startTiming(); // Spigot +- this.level.timings.syncChunkLoadTimer.startTiming(); // Spigot CompletableFuture> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create); ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor; @@ -1082,7 +1079,7 @@ index f402341b95c7752a2706edd502098696f786f4ef..b1fd6118132ba38f60d2a2b15c09231f + if (!completablefuture.isDone()) { // Paper + this.level.timings.syncChunkLoad.startTiming(); // Paper chunkproviderserver_b.managedBlock(completablefuture::isDone); -- level.timings.syncChunkLoadTimer.stopTiming(); // Spigot +- this.level.timings.syncChunkLoadTimer.stopTiming(); // Spigot + this.level.timings.syncChunkLoad.stopTiming(); // Paper + } // Paper ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { @@ -1109,7 +1106,7 @@ index f402341b95c7752a2706edd502098696f786f4ef..b1fd6118132ba38f60d2a2b15c09231f this.level.timings.doChunkUnload.startTiming(); // Spigot @@ -688,13 +694,16 @@ public class ServerChunkCache extends ChunkSource { - boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit + boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit gameprofilerfiller.push("naturalSpawnCount"); + this.level.timings.countNaturalMobs.startTiming(); // Paper - timings @@ -1159,7 +1156,7 @@ index f402341b95c7752a2706edd502098696f786f4ef..b1fd6118132ba38f60d2a2b15c09231f } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3a63d4227 100644 +index 3c00b7519b37c5026e80e76a4b4ced2a3a0166f6..e48172c1da6beb7ff5ba3486647b126325b826a7 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1,6 +1,8 @@ @@ -1183,8 +1180,8 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3 this.updateSkyBrightness(); this.tickTime(); gameprofilerfiller.popPush("tickPending"); -- timings.doTickPending.startTiming(); // Spigot -+ timings.scheduledBlocks.startTiming(); // Paper +- this.timings.doTickPending.startTiming(); // Spigot ++ this.timings.scheduledBlocks.startTiming(); // Paper if (!this.isDebug()) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); @@ -1192,8 +1189,8 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3 this.fluidTicks.tick(j, 65536, this::tickFluid); gameprofilerfiller.pop(); } -- timings.doTickPending.stopTiming(); // Spigot -+ timings.scheduledBlocks.stopTiming(); // Paper +- this.timings.doTickPending.stopTiming(); // Spigot ++ this.timings.scheduledBlocks.stopTiming(); // Paper gameprofilerfiller.popPush("raid"); + this.timings.raids.startTiming(); // Paper - timings @@ -1204,7 +1201,7 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3 this.getChunkSource().tick(shouldKeepTicking, true); + this.timings.chunkProviderTick.stopTiming(); // Paper - timings gameprofilerfiller.popPush("blockEvents"); - timings.doSounds.startTiming(); // Spigot + this.timings.doSounds.startTiming(); // Spigot this.runBlockEvents(); @@ -625,6 +630,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } @@ -1258,7 +1255,7 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3 @@ -999,6 +1014,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit + try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); @@ -1275,7 +1272,7 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3 this.entityManager.saveAll(); } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1c0a14dc1ddfe7806d06af83f9b5de6e42b4b0cc..688f974d9e4f9728dfb1a41e083cf3247743cd22 100644 +index 46f2da7f90fd92e6cbd1ae371d04af85ade86ec1..ddd7238458804de3a82018ac7f170007f4f195aa 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -320,7 +320,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1322,7 +1319,7 @@ index 1c0a14dc1ddfe7806d06af83f9b5de6e42b4b0cc..688f974d9e4f9728dfb1a41e083cf324 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index b278ecc71399b3c6f30040402a38e6673ff823e8..5583b4db7813aeb88359243233d213474c48f402 100644 +index cb8859c37fb8ce46a8fd529ca885456ea86c1c2b..8f7bc04fc32e3b9c0625d795b09ea7f2e950fc05 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1,5 +1,6 @@ @@ -1346,7 +1343,7 @@ index b278ecc71399b3c6f30040402a38e6673ff823e8..5583b4db7813aeb88359243233d21347 public UserWhiteList getWhiteList() { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6c5000ff3dbb7517d095e9fb2cdf555212b2c090..8b3763ba7f5648c41c5bf8a72e5c801d5483e6e0 100644 +index 9a29dea3c02cbca89faaa1cd9b750f1a2694d100..5f3c9fcd7f34098a4136646fb373441f77175bb3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -134,7 +134,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -1424,7 +1421,7 @@ index fe7180dfc7ddaac8d60422c072d2e172d669cf57..cea1a8eaae8dfc36efd09e3ac57a7062 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index e472679f23d2b9e727fec6f322f84fabbe0d02be..de73a18438462b478af813a7a709964506b41174 100644 +index 8fa96e6875b1d5dd66ef536d76648170b912c919..f6cfed5ac40726475d1c121d0095c105f9426ae7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1505,7 +1502,7 @@ index e472679f23d2b9e727fec6f322f84fabbe0d02be..de73a18438462b478af813a7a7099645 if (!this.level().isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { this.hurt(this.damageSources().drown(), 1.0F); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 003e2064f64115d1f5c48ac97e16100d4c10c5d7..d87f02c748fe2e5b4ea251f6691e8907a152cb6d 100644 +index 384cb02b124dac42521767b0aff481a1b12c0eab..43b631634ff225fa007af552f51f00150892185b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -88,7 +88,6 @@ import org.bukkit.Bukkit; @@ -1530,17 +1527,17 @@ index 003e2064f64115d1f5c48ac97e16100d4c10c5d7..d87f02c748fe2e5b4ea251f6691e8907 }); // CraftBukkit end - this.timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings -+ timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings - this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); ++ this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings + this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); + this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); } @@ -714,15 +713,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - timings.tileEntityTick.stopTiming(); // Spigot + this.timings.tileEntityTick.stopTiming(); // Spigot this.tickingBlockEntities = false; + co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper gameprofilerfiller.pop(); - spigotConfig.currentPrimedTnt = 0; // Spigot + this.spigotConfig.currentPrimedTnt = 0; // Spigot } public void guardEntityTick(Consumer tickConsumer, T entity) { @@ -1590,7 +1587,7 @@ index c02fa35cefc9194d1838abbe4f2dc2b226a41e41..b300d12e9e00519028b53aca9c3fb01f private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index b32e1bba27c91e81b7382072c4d8230db695066c..1e434faaf56f7d1501367c4371131a8da30c0421 100644 +index 17d36b53ec8efbc60b0648764f7195003e40fdcc..93348550f1632f7fc567eb5b42cd03d78532e383 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -682,6 +682,7 @@ public class LevelChunk extends ChunkAccess { @@ -1636,7 +1633,7 @@ index 0eb09ce5c850d85ffd7229d27cf06b3e0edda11b..cc1d7626a82881c4410d65c6a33dadae }; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 15fa1f1bd2bdd007667e574775b14f0c73f1bb52..200c4f394002b7a7592f7fe6fdf885f396cf23eb 100644 +index e17ad4a7f7adcf7d54bcfa56dbb109fc5611574a..dc7762af207bbbac133f74ae5e0783e5bc075a51 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -376,7 +376,7 @@ public final class CraftServer implements Server { @@ -1850,7 +1847,7 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d78b466e0e97557da78424c09ba1b61947c64dcd..55bd1f3958ac058709077a34016187466824e98e 100644 +index d7260f96da9974c721a8b49c1f9b0f1ee56c6ce1..929e17d45db1a107f628907d1d3eea17ba968e7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2568,6 +2568,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1869,7 +1866,7 @@ index d78b466e0e97557da78424c09ba1b61947c64dcd..55bd1f3958ac058709077a3401618746 public Player.Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 4d94c3a19f98f78476ecc403f410d75a6ea57c2d..fcbf32a233c240dd45f75ee736bd102ce9f79332 100644 +index e359668d9f4fceae13bf6c36842db9f2b2817c9b..0806f97007f4729dab859855fdae91c088671864 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -1,5 +1,6 @@ @@ -1945,7 +1942,7 @@ index 4d94c3a19f98f78476ecc403f410d75a6ea57c2d..fcbf32a233c240dd45f75ee736bd102c private boolean isReady(final int currentTick) { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -index b89846e0f645c79afec018dae1d64a1bda043ed9..3f45bab0e9f7b3697e6d9d1092a1e6e579f7066f 100644 +index d56abf283f38548faa790c57045033f7ade6f958..ea26d9464644b5217879b8c21b4da28e57708dcb 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java @@ -1,12 +1,15 @@ @@ -2081,7 +2078,7 @@ index 1c70aa4475bb43aba2f66eedabd4d1f5c5ae3409..0a2a6697118833d45ffe95252cee8011 * This helper class represents the different NBT Tags. *

diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 7cdfd82fdef19d5732ebc2126e2c377b441de596..ebd48f9977553174b14bdc7429c07d8352f5a297 100644 +index 0c7c97f27853843ec714e47f5b570f9d09bbba14..e01ef22189ce80429eb0054e416547577fd3cc5d 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -27,7 +27,7 @@ import net.minecraft.world.entity.projectile.ThrownTrident; @@ -2115,7 +2112,7 @@ index 7cdfd82fdef19d5732ebc2126e2c377b441de596..ebd48f9977553174b14bdc7429c07d83 final int animalActivationRange = world.spigotConfig.animalActivationRange; @@ -134,7 +134,7 @@ public class ActivationRange - world.getEntities().get(maxBB, ActivationRange::activateEntity); + world.getEntities().get(ActivationRange.maxBB, ActivationRange::activateEntity); } - SpigotTimings.entityActivationCheckTimer.stopTiming(); + MinecraftTimings.entityActivationCheckTimer.stopTiming(); diff --git a/patches/server/0018-Rewrite-chunk-system.patch b/patches/server/0018-Rewrite-chunk-system.patch index df80354cd7..58890d5471 100644 --- a/patches/server/0018-Rewrite-chunk-system.patch +++ b/patches/server/0018-Rewrite-chunk-system.patch @@ -16652,7 +16652,7 @@ index ae0b713870976d4b1e469a90cef9b2e282dbcaab..646cd39c46d86899f23c8179c0790e32 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0eb3a55cbf2ed2c3f5e809ee60aba3767f7aa01b..151259cc254d4e796e6af810e37eaa30b832daa3 100644 +index 7abd42e34ce14618f4987933cdd230879b6ac804..27ab6d2749b89cc5d3fd4e22603daee95634be71 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop List getEntities(EntityTypeTest filter, AABB box, Predicate predicate); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index d87f02c748fe2e5b4ea251f6691e8907a152cb6d..5988c0847af4e8f0094328e91f736f25d567db60 100644 +index 43b631634ff225fa007af552f51f00150892185b..ec31a60fae419fb610f216bd42558e6aa57c2e19 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -453,6 +453,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -21313,7 +21313,7 @@ index 846ae3fd184a1d63b743aa25e045604576697c96..a907b79fd8291a0e92db138f37239d17 public int getIndex() { diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index f75d37091018d5544099861e2fe7d3fd04870750..9da26705d41931e77bff0e6a4d73bb9263e6989e 100644 +index 42f29413d18b0df039736a87e4e5c1d15700f916..c2663fadd2c714b25fe411777ca9be957c3545df 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -83,6 +83,7 @@ public class LevelChunk extends ChunkAccess { @@ -22586,24 +22586,24 @@ index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4f for(SavedTick savedTick : this.pendingTicks) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index c8c3c8b82a013f4903d3fff4613753d84c4eb770..54448802a7db5734159c381226a50e7be4ec8368 100644 +index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..7687a81bfa420e8377308fea3d6738141bc945d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -113,7 +113,7 @@ public class CraftChunk implements Chunk { @Override public boolean isEntitiesLoaded() { -- return this.getCraftWorld().getHandle().entityManager.areEntitiesLoaded(ChunkPos.asLong(x, z)); +- return this.getCraftWorld().getHandle().entityManager.areEntitiesLoaded(ChunkPos.asLong(this.x, this.z)); + return this.getCraftWorld().getHandle().areEntitiesLoaded(io.papermc.paper.util.CoordinateUtils.getChunkKey(this.x, this.z)); // Paper - rewrite chunk system } @Override @@ -122,51 +122,7 @@ public class CraftChunk implements Chunk { - this.getWorld().getChunkAt(x, z); // Transient load for this tick + this.getWorld().getChunkAt(this.x, this.z); // Transient load for this tick } - PersistentEntitySectionManager entityManager = this.getCraftWorld().getHandle().entityManager; -- long pair = ChunkPos.asLong(x, z); +- long pair = ChunkPos.asLong(this.x, this.z); - - if (entityManager.areEntitiesLoaded(pair)) { - return entityManager.getEntities(new ChunkPos(this.x, this.z)).stream() @@ -22647,12 +22647,12 @@ index c8c3c8b82a013f4903d3fff4613753d84c4eb770..54448802a7db5734159c381226a50e7b - return entityManager.getEntities(new ChunkPos(this.x, this.z)).stream() - .map(net.minecraft.world.entity.Entity::getBukkitEntity) - .filter(Objects::nonNull).toArray(Entity[]::new); -+ return getCraftWorld().getHandle().getChunkEntities(this.x, this.z); // Paper - rewrite chunk system ++ return this.getCraftWorld().getHandle().getChunkEntities(this.x, this.z); // Paper - rewrite chunk system } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 200c4f394002b7a7592f7fe6fdf885f396cf23eb..e4bc9b3b7097c1fc3cc15698744a995b15a2b98e 100644 +index dc7762af207bbbac133f74ae5e0783e5bc075a51..c3cf8b9d2b5707d36310da2c3b5132af4b83508a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1161,7 +1161,7 @@ public final class CraftServer implements Server { @@ -22677,13 +22677,13 @@ index 200c4f394002b7a7592f7fe6fdf885f396cf23eb..e4bc9b3b7097c1fc3cc15698744a995b @Override public boolean isPrimaryThread() { -- return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) +- return Thread.currentThread().equals(this.console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) + return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system } // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 7efdca87cc2dda12e545d053e9fea271e9f857d1..c0eef4c85729de69fa9bea2e1851e17fb9fdb882 100644 +index 264cdde172452d0d9df652b0e78b21b6a6561300..e8f3373985ba8d3af6fc93a5f0ba0f0a04f7fc6f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -323,10 +323,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -22749,13 +22749,13 @@ index 7efdca87cc2dda12e545d053e9fea271e9f857d1..c0eef4c85729de69fa9bea2e1851e17f // Spigot start @Override public int getViewDistance() { -- return world.spigotConfig.viewDistance; +- return this.world.spigotConfig.viewDistance; + return this.getHandle().playerChunkLoader.getAPIViewDistance(); // Paper - replace player chunk loader } @Override public int getSimulationDistance() { -- return world.spigotConfig.simulationDistance; +- return this.world.spigotConfig.simulationDistance; + return this.getHandle().playerChunkLoader.getAPITickDistance(); // Paper - replace player chunk loader } // Spigot end @@ -22802,7 +22802,7 @@ index 7efdca87cc2dda12e545d053e9fea271e9f857d1..c0eef4c85729de69fa9bea2e1851e17f // Spigot start private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 55bd1f3958ac058709077a34016187466824e98e..fb623fed603d235693b86e3a9f3f685187d6fb4e 100644 +index 929e17d45db1a107f628907d1d3eea17ba968e7e..fe4b5fe105b9054763fc4440bdb892b69128cb2b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -197,6 +197,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -22940,16 +22940,16 @@ index 629178347039893fb9de710810fe8112499bb91c..d5861dfa771c4eb217e082e3c832c3a6 + // Paper end } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index ebd48f9977553174b14bdc7429c07d8352f5a297..6606a118e7bff01aa51440aea7540ec9feec6cc5 100644 +index e01ef22189ce80429eb0054e416547577fd3cc5d..47e7fd7baf3ec6ed3ec9b5e6d73ed8611c2b1ce1 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -132,7 +132,13 @@ public class ActivationRange ActivationType.ANIMAL.boundingBox = player.getBoundingBox().inflate( animalActivationRange, 256, animalActivationRange ); ActivationType.MONSTER.boundingBox = player.getBoundingBox().inflate( monsterActivationRange, 256, monsterActivationRange ); -- world.getEntities().get(maxBB, ActivationRange::activateEntity); +- world.getEntities().get(ActivationRange.maxBB, ActivationRange::activateEntity); + // Paper start -+ java.util.List entities = world.getEntities((Entity)null, maxBB, null); ++ java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); + for (int i = 0; i < entities.size(); i++) { + Entity entity = entities.get(i); + ActivationRange.activateEntity(entity); @@ -22972,7 +22972,7 @@ index 78669fa035b7537ff7e533cf32aaf2995625424f..05e94702e42b8f5c35d2a112c486d579 throw new IllegalStateException( "Asynchronous " + reason + "!" ); } diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 335120afc88a8fc1543c2e6df516fd728e3ab032..f1194eb6fdfba60959e00080d0562f2820d13b27 100644 +index c4bf7053d83d207caca0e13e19f5c1afa7062de3..7621bf889ef765ed57af221edf95b07346f4ae43 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -8,7 +8,7 @@ import java.util.logging.Logger; diff --git a/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch index 042396c575..22a4665115 100644 --- a/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch +++ b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 5988c0847af4e8f0094328e91f736f25d567db60..fb78a91d1ab77f909823422c6d4e2ef7ed10c9c3 100644 +index ec31a60fae419fb610f216bd42558e6aa57c2e19..1e57df43ea47f18cc151dc8ad5fd6f18d3615462 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -261,6 +261,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); // CraftBukkit end - timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings + this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings + this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); + this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); + this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); } diff --git a/patches/server/0031-Further-improve-server-tick-loop.patch b/patches/server/0031-Further-improve-server-tick-loop.patch index 5166476412..bfeb414b03 100644 --- a/patches/server/0031-Further-improve-server-tick-loop.patch +++ b/patches/server/0031-Further-improve-server-tick-loop.patch @@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ce626187e7ffda51a54225fa6e43b817c6c19db8..086be61bfc8a43076b502bbf00e9f2d2785495d3 100644 +index 6155d6e3c361bb4a0381e7065a7b603b783a47a6..d13a0f5a3b95b0d0ca80c760f757087c88eceaeb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -277,7 +277,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getEnchantments(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 087080e4df07d87b55b42436cffc2f772d883db3..edcb2ab754b99cdd82ee69b3f61ba9046593955f 100644 +index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610aca5401e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -256,7 +256,7 @@ index 087080e4df07d87b55b42436cffc2f772d883db3..edcb2ab754b99cdd82ee69b3f61ba904 + EnchantmentMap enchantments = new EnchantmentMap(); // Paper for (int i = 0; i < ench.size(); i++) { - String id = ((CompoundTag) ench.get(i)).getString(ENCHANTMENTS_ID.NBT); + String id = ((CompoundTag) ench.get(i)).getString(CraftMetaItem.ENCHANTMENTS_ID.NBT); @@ -550,13 +553,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -277,7 +277,7 @@ index 087080e4df07d87b55b42436cffc2f772d883db3..edcb2ab754b99cdd82ee69b3f61ba904 @Override public Map getEnchants() { -- return this.hasEnchants() ? ImmutableMap.copyOf(enchantments) : ImmutableMap.of(); +- return this.hasEnchants() ? ImmutableMap.copyOf(this.enchantments) : ImmutableMap.of(); + return this.hasEnchants() ? ImmutableSortedMap.copyOfSorted(this.enchantments) : ImmutableMap.of(); // Paper } diff --git a/patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 8b9eaafecf..34e135f907 100644 --- a/patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index a12d23b03d64aacaf1f231039333aec94245a89a..81bfce0374f281069f963c24040163cd968e3958 100644 +index 4a649a2006f907c9b7542843ec6938d9375ca645..0d9658b1c6b5912a34058c0ce53b8e7f8c28afac 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -89,9 +89,44 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -53,5 +53,5 @@ index a12d23b03d64aacaf1f231039333aec94245a89a..81bfce0374f281069f963c24040163cd + // Paper end + // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { - connection.hostname = split[0]; - connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); + this.connection.hostname = split[0]; + this.connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); diff --git a/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch index 4d682b759f..4577d6be87 100644 --- a/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch @@ -504,7 +504,7 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa + } +} diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index fc39c3742e852bc9f4131b1ade62c32b318bdb02..f3db63ddb175f82b6eafee48686065050437fc92 100644 +index 3e8f8ead702daa15451fb7259a960a9f3033828f..6240ad60358bf8ba9891ca1d40af2d2a7d10130d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -235,6 +235,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -516,7 +516,7 @@ index fc39c3742e852bc9f4131b1ade62c32b318bdb02..f3db63ddb175f82b6eafee4868606505 public CraftEntity getBukkitEntity() { diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java -index 0ec2db500e4a0230a91286a709b8d444d1b529f4..272095d7a09ab41227d741172735f66fd2798ce1 100644 +index 442736878291fbdc62572b2c83f384413408326f..00187fbbeddfc17e1b6887f8bf0f50da23938470 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java @@ -32,6 +32,20 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme @@ -556,7 +556,7 @@ index 0ec2db500e4a0230a91286a709b8d444d1b529f4..272095d7a09ab41227d741172735f66f } diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java -index d88a6501917306eab57f46cb0d10dc03164a94da..e88c39d405fc7068db64ad34a03dec8d559e749e 100644 +index 11d9d4861aee68cd97d36ee2ff7597b7a6c81294..d70c1206df96b03c031399049a65e6a765d80347 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java @@ -65,12 +65,14 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain @@ -709,7 +709,7 @@ index 111494c30a2b7d8464237a92cf5c98f7f4cca19d..e11618247ad889fa8fadbb2c7addd0de if (player != null) { builder.withLuck(player.getLuck()).withParameter(LootContextParams.THIS_ENTITY, player); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java -index 750192aa5e4969fbd6d4d77e2d2a812b1f9e84f3..69af0368dcef1b449c77c9bdaa554fce90163df9 100644 +index 86076a9d2a3b1044c96518cbaeee66d60a8a22c6..c268513bc5719d80e1c3d73de53b85ec7f852fa9 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java @@ -64,7 +64,7 @@ public class CraftBrushableBlock extends CraftBlockEntityState { @@ -205,7 +205,7 @@ index 6dba24f47ca76a432a836178af178c2d52631eee..ed1f6e77d5fc9b6f5f52b1a10275783b } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 1a787bd4bdbbf7c78f4bf6bd7e2f36540fec7d50..8bfb2f94226e6b623def141a7af79d0f46d7d445 100644 +index 4406d9622c6a5f817b7fbd1b448b8c3095c617b2..f68aef2298c3b2994c46d34b0888f988af9190dc 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -673,7 +673,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -240,7 +240,7 @@ index b70ee1dff0442de32a9e20ad54b246d5eae45e58..b3127238cea62c47d710abab44f65701 } diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index eb15d694ad8c24b659feba53e6992661ba1a9b76..5ea5f424c55f60bf63d3a4d3fe51362939f42f4c 100644 +index d4d1cad7963a5adcc8c32e1bc02104eb70514331..0321b4bb622930bfe57661b0e6b893d7635668fb 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java @@ -207,7 +207,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @@ -279,7 +279,7 @@ index 2191af62f4202413738542d738456ca71febdbf4..5b3059460d4b18d984483d655526d832 } diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index c858b987cb6f92cc6fa705bbe1ae11a720eb242c..2c263447aa8853f18d1c1d476b49a47f6e9ca2ad 100644 +index 8d09c134058e55a23df4e23d965a7a783aed701e..45242f0ed5a0f98953df5f27fb76874d2d9e3473 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -97,7 +97,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -337,7 +337,7 @@ index 8beb4670fffa2df0a9bd64ebb8810b25ce670f16..134b138abdf17fae340226ecac3868ad entity = net.minecraft.world.entity.EntityType.LIGHTNING_BOLT.create(world); entity.moveTo(location.getX(), location.getY(), location.getZ()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java -index 4907d61b0254919e137c4f92e0dbeb2d61a906f6..26c795983515580b30b5ef8c701faa95ab1aea8e 100644 +index 9231511af4cba747594000364f0b8fceeeab4819..5a7d314ec0562e472f5dc45924a7b24841cff126 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java @@ -18,6 +18,18 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { @@ -358,4 +358,4 @@ index 4907d61b0254919e137c4f92e0dbeb2d61a906f6..26c795983515580b30b5ef8c701faa95 + @Override public net.minecraft.world.entity.ExperienceOrb getHandle() { - return (net.minecraft.world.entity.ExperienceOrb) entity; + return (net.minecraft.world.entity.ExperienceOrb) this.entity; diff --git a/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch index 260c535f43..d64c2f7b10 100644 --- a/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -252,7 +252,7 @@ index c3631efda9c7fa531a8a9f18fbee7b5f8655382b..769f6489632302627fa1730cc08e77f5 } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 092f76d1d248e04c3fa5fa346373ec1f2600ee5c..ee27251b9decc00a0094611cf79644bd83bce5c7 100644 +index 182ae975a0a9bf4ade6932d1bb1a376f77af130a..73155c8cb02a6156c1e48f9c75f512441f8b85a1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -164,7 +164,7 @@ import com.mojang.datafixers.util.Pair; @@ -311,7 +311,7 @@ index 092f76d1d248e04c3fa5fa346373ec1f2600ee5c..ee27251b9decc00a0094611cf79644bd public KeyPair getKeyPair() { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index f17e1621b498e70c8787dfe96dd819dc6e4b621f..5a3f0a6e3f663718993cf3679ffc96c4af140e4d 100644 +index d6816b8402f601e474a156b7e4a8c335624083aa..b916f11cb3799aecf1edd9c2002f4c631754e89f 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -98,6 +98,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -321,7 +321,7 @@ index f17e1621b498e70c8787dfe96dd819dc6e4b621f..5a3f0a6e3f663718993cf3679ffc96c4 + // Paper start - Use TerminalConsoleAppender + new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start(); + /* - jline.console.ConsoleReader bufferedreader = reader; + jline.console.ConsoleReader bufferedreader = DedicatedServer.this.reader; // MC-33041, SPIGOT-5538: if System.in is not valid due to javaw, then return @@ -129,7 +132,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -375,7 +375,7 @@ index 75083eeb9b413e6dd5375007360dce6857a08fff..d292fdb165436f0b9b46b32110f5e09a if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(() -> { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index aba09b0606602b4081ceb235cc168554c3ab638b..7a3f339528808c84a5833a127786c9d88423fe18 100644 +index 6dad42086e598c86a27358e12c5b72a0a79b38ee..daabc5739b7bf6b1cbeb497fe0e9b7ed6ed30975 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -162,8 +162,7 @@ public abstract class PlayerList { @@ -389,7 +389,7 @@ index aba09b0606602b4081ceb235cc168554c3ab638b..7a3f339528808c84a5833a127786c9d8 this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 584d12cfd6875034dfe9ca0bdcd821e36c2a397b..4a699d50d1174923991cbd0e4b7d37d1e4e76a90 100644 +index 4a157159ba7baf9ee3ea09880ba45e055802bfcc..0b529c373c098d2e48c4485dd189a51f2a846c81 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -44,7 +44,6 @@ import java.util.logging.Level; @@ -407,7 +407,7 @@ index 584d12cfd6875034dfe9ca0bdcd821e36c2a397b..4a699d50d1174923991cbd0e4b7d37d1 + // Paper start - JLine update + /* public ConsoleReader getReader() { - return console.reader; + return this.console.reader; } + */ + // Paper end @@ -415,7 +415,7 @@ index 584d12cfd6875034dfe9ca0bdcd821e36c2a397b..4a699d50d1174923991cbd0e4b7d37d1 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 6f2135690892f23e80648d4f9237cea34ec19740..960885c891c98859e8ef375d0796c8b53fcf562c 100644 +index 89cb1612232adc9fa336176ea0585ce6577459fb..ae93a3b7a3dc30ed3bd852242e276aa4e4368b40 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -13,7 +13,6 @@ import java.util.logging.Logger; @@ -464,7 +464,7 @@ index 6f2135690892f23e80648d4f9237cea34ec19740..960885c891c98859e8ef375d0796c8b5 net.minecraft.server.Main.main(options); } catch (Throwable t) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java -index 76fb1ecd47cb86b50486effe8cc7fe4abf8e311c..21f889ddec72b40f5954eec07417e08d192b4661 100644 +index bcf1c36d07b79520a39643d3a01020a67b1c9ef2..217e7e3b9db04c7fc5f6518f39cc9d3488f9128d 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java @@ -5,15 +5,13 @@ import java.util.EnumMap; @@ -493,7 +493,7 @@ index 76fb1ecd47cb86b50486effe8cc7fe4abf8e311c..21f889ddec72b40f5954eec07417e08d + }*/ // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index 0b4c62387c1093652ac15b64a8703249de4cf088..b996fde481cebbbcce80a6c267591136db7cc0bc 100644 +index 0b4c62387c1093652ac15b64a8703249de4cf088..d24acf28f5ed023acc550bcf877e4b9800ec8c9f 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java @@ -4,50 +4,73 @@ import java.util.Collections; @@ -533,12 +533,12 @@ index 0b4c62387c1093652ac15b64a8703249de4cf088..b996fde481cebbbcce80a6c267591136 @Override protected List evaluate() { - List offers = ConsoleCommandCompleter.this.server.getCommandMap().tabComplete(ConsoleCommandCompleter.this.server.getConsoleSender(), buffer); -+ List offers = server.getCommandMap().tabComplete(server.getConsoleSender(), buffer); // Paper - fix remap ++ List offers = server.getCommandMap().tabComplete(server.getConsoleSender(), buffer); // Paper - Remove "this." - TabCompleteEvent tabEvent = new TabCompleteEvent(ConsoleCommandCompleter.this.server.getConsoleSender(), buffer, (offers == null) ? Collections.EMPTY_LIST : offers); - ConsoleCommandCompleter.this.server.getPluginManager().callEvent(tabEvent); -+ TabCompleteEvent tabEvent = new TabCompleteEvent(server.getConsoleSender(), buffer, (offers == null) ? Collections.EMPTY_LIST : offers); // Paper - fix remap -+ server.getPluginManager().callEvent(tabEvent); // Paper - fix remap ++ TabCompleteEvent tabEvent = new TabCompleteEvent(server.getConsoleSender(), buffer, (offers == null) ? Collections.EMPTY_LIST : offers); // Paper - Remove "this." ++ server.getPluginManager().callEvent(tabEvent); // Paper - Remove "this." return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions(); } @@ -583,14 +583,14 @@ index 0b4c62387c1093652ac15b64a8703249de4cf088..b996fde481cebbbcce80a6c267591136 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index 19c44daaa407b7c1c7a7ffe56fef8c8814c6d5b2..c6e8441e299f477ddb22c1ce2618710763978f1a 100644 +index 8390f5b5b957b5435efece26507a89756d0a7b3c..c6e8441e299f477ddb22c1ce2618710763978f1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java @@ -16,7 +16,7 @@ public class ServerShutdownThread extends Thread { this.server.close(); } finally { try { -- server.reader.getTerminal().restore(); +- this.server.reader.getTerminal().restore(); + net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender } catch (Exception e) { } diff --git a/patches/server/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/patches/server/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch index 169d912a4b..c917550a2f 100644 --- a/patches/server/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/patches/server/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 7cfcbc1e38f5e9145c827dfe26299277a3f14cee..22dab285bbcea77d04a8625b025f054c625cadd4 100644 +index 407607babfb200152bb0e5c6d56bb66c82217077..3f88b1caf5f99499adeaa8ba24e2c9d8647ea7d5 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -805,6 +805,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -16,7 +16,7 @@ index 7cfcbc1e38f5e9145c827dfe26299277a3f14cee..22dab285bbcea77d04a8625b025f054c + toRemove.add(null); for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; - TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition); + TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition); @@ -812,7 +814,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (tickingblockentity == null) { this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); @@ -38,5 +38,5 @@ index 7cfcbc1e38f5e9145c827dfe26299277a3f14cee..22dab285bbcea77d04a8625b025f054c } + this.blockEntityTickers.removeAll(toRemove); - timings.tileEntityTick.stopTiming(); // Spigot + this.timings.tileEntityTick.stopTiming(); // Spigot this.tickingBlockEntities = false; diff --git a/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch index b8aa604ca9..2f5cac0839 100644 --- a/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch @@ -51,7 +51,7 @@ index 63acd109a79ed752a05df3d4f1b99309297c2055..d156f7cc71050f13b2feca00c52ca6b6 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index b7adb6acf4eca6aad0c9a48223ab47528ef7ce04..8a62231dffcff0260c1c15bd3115b27922c03239 100644 +index 1f5962457a15cae2162ce3899e0e7f167a854d11..9aa8c6c11d5aee83627cb91258c16844f791cd26 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -327,6 +327,13 @@ public class CraftBlock implements Block { @@ -69,7 +69,7 @@ index b7adb6acf4eca6aad0c9a48223ab47528ef7ce04..8a62231dffcff0260c1c15bd3115b279 public Biome getBiome() { return this.getWorld().getBiome(this.getX(), this.getY(), this.getZ()); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index 0476f01b5594497a448968c6cbc28fed87cd602c..b52a34ded5a9697f3107a730a9817df3044dedba 100644 +index 22af1b41eec06d660dbe47c463014bcdd96fc5b6..f046f507a095e0cb8f839b9b4b06add3a671486b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -17,15 +17,26 @@ public class CraftBlockEntityState extends CraftBlockStat @@ -93,7 +93,7 @@ index 0476f01b5594497a448968c6cbc28fed87cd602c..b52a34ded5a9697f3107a730a9817df3 + } // copy tile entity data: - this.snapshot = this.createSnapshot(tileEntity); -- this.load(snapshot); +- this.load(this.snapshot); + if (this.snapshot != null) { + this.load(this.snapshot); + } @@ -114,7 +114,7 @@ index 0476f01b5594497a448968c6cbc28fed87cd602c..b52a34ded5a9697f3107a730a9817df3 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index a69a03a7954b03a0aeca7a74d89756dd38ca6faf..17e1131c79ad140c0803a914621ce7924f0f2a6d 100644 +index 8561c16da0dccc55c89c7796cbe4f8792d01194f..c9ef19bdeeb130561659ff8161bf4e196cf4f53f 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -379,15 +379,30 @@ public final class CraftBlockStates { @@ -149,7 +149,7 @@ index a69a03a7954b03a0aeca7a74d89756dd38ca6faf..17e1131c79ad140c0803a914621ce792 public static BlockState getBlockState(Material material, @Nullable CompoundTag blockEntityTag) { diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -index 759e95434a1f18ec0b829a29071ab62a42550279..1c33e3456c410dac3ac2f0caef52ee24e00ffca5 100644 +index 6377a053e5d407fdae061e796657711828c5586e..ae5091433fd605c46b9c57f07114923918fad506 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java @@ -156,4 +156,10 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { diff --git a/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch index 89cf565540..dacc3de348 100644 --- a/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0170-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,11 +9,11 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index e2510ee3f0cb93eae2452bec642855cd6c0c2974..c483acf248484220aaca2100c84e75f3b46fbd31 100644 +index e580df88baadfd943756b1e440c7253a287fa0e9..ea520b828378c268d05425096c6493ca1c7ad385 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -701,7 +701,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; + chunkRange = (chunkRange > this.level.spigotConfig.viewDistance) ? (byte) this.level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange; - double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D; @@ -40,7 +40,7 @@ index e2510ee3f0cb93eae2452bec642855cd6c0c2974..c483acf248484220aaca2100c84e75f3 return true; diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 65d447df49d8c4a27de9ae7f9e298bf705c688bc..4649e597b86335b33d9e9227d966dd7ad8208096 100644 +index b2367f3836689f3aa27b1b4905219e07e6173c93..821b2c8860c1328e2ecc009deeb533648ce16540 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -565,6 +565,15 @@ public class ServerChunkCache extends ChunkSource { @@ -60,7 +60,7 @@ index 65d447df49d8c4a27de9ae7f9e298bf705c688bc..4649e597b86335b33d9e9227d966dd7a while (iterator1.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index c6c046f3089759214739fc9c3b6f2936e41d1334..b756cf41f0f201824b055f3936ace7ded3bb6023 100644 +index 43e454be3f18d092913739bb6a92d5b82059ba59..9b670eb2925caa275cae6f51eb75183a9f5208b0 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1,5 +1,6 @@ diff --git a/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch index 391dc50612..fed94c00e3 100644 --- a/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch +++ b/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch @@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java -index 34aa42dce4340d80906750369633bfafc8189b88..4b46863cd0fb32cd1423370605f0be9312e77935 100644 +index 6c40bb4e06322bcce31561f5cfb9dc53f266f062..ba063a4e52a841a4365efb1cf78415b04b2bcc4c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -111,7 +111,22 @@ public class CraftSkull extends CraftBlockEntityState implemen @@ -48,7 +48,7 @@ index 34aa42dce4340d80906750369633bfafc8189b88..4b46863cd0fb32cd1423370605f0be93 } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index b202f425cbb880079b9e3ec64d077482d7aa5f99..9b9e20014042da4324c9f4babb05d8ba9513f81d 100644 +index bb9b20ad96b602fd5643f646eaf4d5f8cffa41ee..6398f31a29fdab0f6539139a09336b10d6d11d95 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -187,6 +187,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { @@ -97,8 +97,8 @@ index b202f425cbb880079b9e3ec64d077482d7aa5f99..9b9e20014042da4324c9f4babb05d8ba Builder serialize(Builder builder) { super.serialize(builder); if (this.profile != null) { -- return builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile)); -+ return builder.put(SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper +- return builder.put(CraftMetaSkull.SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile)); ++ return builder.put(CraftMetaSkull.SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper } NamespacedKey namespacedKeyNB = this.getNoteBlockSound(); if (namespacedKeyNB != null) { diff --git a/patches/server/0175-Add-ArmorStand-Item-Meta.patch b/patches/server/0175-Add-ArmorStand-Item-Meta.patch index 8b94246e53..53033be4f9 100644 --- a/patches/server/0175-Add-ArmorStand-Item-Meta.patch +++ b/patches/server/0175-Add-ArmorStand-Item-Meta.patch @@ -13,7 +13,7 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java -index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb69db4733 100644 +index b77f5832265be5aaf96d95fcac4737919720fa6e..e15723080445b09852512132039ca2cde4936b7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java @@ -8,9 +8,22 @@ import org.bukkit.Material; @@ -56,8 +56,8 @@ index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb @@ -29,11 +49,39 @@ public class CraftMetaArmorStand extends CraftMetaItem { - if (tag.contains(ENTITY_TAG.NBT)) { - this.entityTag = tag.getCompound(ENTITY_TAG.NBT).copy(); + if (tag.contains(CraftMetaArmorStand.ENTITY_TAG.NBT)) { + this.entityTag = tag.getCompound(CraftMetaArmorStand.ENTITY_TAG.NBT).copy(); + // Paper start + if (entityTag.contains(INVISIBLE.NBT)) { + invisible = entityTag.getBoolean(INVISIBLE.NBT); @@ -124,7 +124,7 @@ index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb + } + // Paper end if (this.entityTag != null) { - tag.put(ENTITY_TAG.NBT, entityTag); + tag.put(CraftMetaArmorStand.ENTITY_TAG.NBT, this.entityTag); } @@ -72,7 +145,7 @@ public class CraftMetaArmorStand extends CraftMetaItem { } @@ -255,7 +255,7 @@ index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index edcb2ab754b99cdd82ee69b3f61ba9046593955f..b29b2d3917fbc5c611ebce17fa2f869203c4514e 100644 +index 57bd07e7aa9d09e843bf33f4c6c2c610aca5401e..3d749e6d6193878f1b4f288946afcec9461dc8df 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -1463,6 +1463,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { diff --git a/patches/server/0182-Player.setPlayerProfile-API.patch b/patches/server/0182-Player.setPlayerProfile-API.patch index 6db7300946..a811ca7422 100644 --- a/patches/server/0182-Player.setPlayerProfile-API.patch +++ b/patches/server/0182-Player.setPlayerProfile-API.patch @@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in. public-f net.minecraft.world.entity.player.Player gameProfile diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4ba7ed0a4ff52caa21632f69ab087564fb3a5eb7..5b8425b17ea322bb1141b1c94ee3c259d3950ca0 100644 +index 293ae8afc5c5aef3ed8de4fa2ce3e66850b8a65b..da4120e6c50605139014b8bf470394253f2b5f73 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1437,7 +1437,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -22,7 +22,7 @@ index 4ba7ed0a4ff52caa21632f69ab087564fb3a5eb7..5b8425b17ea322bb1141b1c94ee3c259 if (Float.isNaN(f)) { f = 0; diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 41de3c342f1dae9fc6af1b4938a676d337bcf5fa..f870c20ecce27ebd893107a35e1b8f15e462ff85 100644 +index 41ba6f0c88b6205bf33de962c0bc545a0ac40c74..03ff64ad395455f21f4ca30faae17fc6a1dc0501 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -293,11 +293,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -40,7 +40,7 @@ index 41de3c342f1dae9fc6af1b4938a676d337bcf5fa..f870c20ecce27ebd893107a35e1b8f15 playerName = gameprofile.getName(); uniqueId = gameprofile.getId(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 498b14ca0e45b76259450d9a0c8206b1e9f25e70..c1ef6c8c8e5f030e18b6066a509350ee1e195987 100644 +index b8fd3837be598e354999b741a1d98dff326b0399..c68b86f42d0f6bd9707ad6c426f34bed556e0035 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -81,8 +81,8 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -55,11 +55,11 @@ index 498b14ca0e45b76259450d9a0c8206b1e9f25e70..c1ef6c8c8e5f030e18b6066a509350ee public Server getServer() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9920a3d81c44972cba742d67764b5066362f79aa..e864252e4fcd0927275d6b9009cdde78d3e289eb 100644 +index bd6dcea0a94bb4b72c98cf6a4829a2cd39a558cd..c65b82d69fa829f3fdfa0d6c65a2f861c2db9f11 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -271,11 +271,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - return server.getPlayer(getUniqueId()) != null; + return this.server.getPlayer(this.getUniqueId()) != null; } - @Override @@ -92,7 +92,7 @@ index 9920a3d81c44972cba742d67764b5066362f79aa..e864252e4fcd0927275d6b9009cdde78 } } - -- server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity)); +- this.server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity)); } void resetAndHideEntity(org.bukkit.entity.Entity entity) { @@ -124,7 +124,7 @@ index 9920a3d81c44972cba742d67764b5066362f79aa..e864252e4fcd0927275d6b9009cdde78 ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); @@ -1785,6 +1798,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); + this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); } + // Paper start + @Override @@ -200,7 +200,7 @@ index 9920a3d81c44972cba742d67764b5066362f79aa..e864252e4fcd0927275d6b9009cdde78 public void onEntityRemove(Entity entity) { this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 44b73939c465398c8cfda5dbea3280392f194add..aba415ab7203a21e916eadb923cb02c03b679f65 100644 +index 3b6683e778a35d021d6189bf8ee5719684040665..4b209818a20e76e9d857c4bb822f6b24ec8e9f09 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -338,6 +338,12 @@ public class Commodore diff --git a/patches/server/0187-Flag-to-disable-the-channel-limit.patch b/patches/server/0187-Flag-to-disable-the-channel-limit.patch index 48f53078a7..7e7ec3dd76 100644 --- a/patches/server/0187-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0187-Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e864252e4fcd0927275d6b9009cdde78d3e289eb..28a51536bcfcb124fecc61095227cabd8844d4e6 100644 +index c65b82d69fa829f3fdfa0d6c65a2f861c2db9f11..676c29c13ae8ece20cb5acaf1a2cf71fc93424bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -194,6 +194,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -28,4 +28,4 @@ index e864252e4fcd0927275d6b9009cdde78d3e289eb..28a51536bcfcb124fecc61095227cabd + Preconditions.checkState(DISABLE_CHANNEL_LIMIT || this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); // Paper - flag to disable channel limit channel = StandardMessenger.validateAndCorrectChannel(channel); if (this.channels.add(channel)) { - server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); + this.server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); diff --git a/patches/server/0226-Vanished-players-don-t-have-rights.patch b/patches/server/0226-Vanished-players-don-t-have-rights.patch index 6be9324cda..a7d7e8add3 100644 --- a/patches/server/0226-Vanished-players-don-t-have-rights.patch +++ b/patches/server/0226-Vanished-players-don-t-have-rights.patch @@ -39,11 +39,11 @@ index a6638e626600e4304a973497a39e3fac52203b16..e68b7a1b03783e4f9de24c5ae8773fc3 BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0b02ba70956ea1352ea8e67957b3789408b67f6b..8320bece16dfa339e33801e43ff2f297bc876001 100644 +index b52a761e84e00f2ccac7b1b9db73e70ffa1c681b..f17cc5da4eb4b4e5bcfae8b234358464f6188f4a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -273,6 +273,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); + this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); } + // Paper start @@ -89,7 +89,7 @@ index 0b02ba70956ea1352ea8e67957b3789408b67f6b..8320bece16dfa339e33801e43ff2f297 public boolean isClientSide() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 405c541e790c47c8ccdf05c902cc5f8969a759f9..ffa0129a4ad3ed12b2afabaea43544f49b330207 100644 +index f531d51d8ffafc65db3885ac6700fbccf47e9965..d9038b215a13c0290b718a41612581dce6e30213 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1343,6 +1343,14 @@ public class CraftEventFactory { diff --git a/patches/server/0232-Add-TNTPrimeEvent.patch b/patches/server/0232-Add-TNTPrimeEvent.patch index f04b081323..ea29cd03f1 100644 --- a/patches/server/0232-Add-TNTPrimeEvent.patch +++ b/patches/server/0232-Add-TNTPrimeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index fc0750f9b2257a3dbf0fab2f0cd4bb020e044752..1621a06eff438eccdbc04a2abebd718567c320b3 100644 +index 12906de1ee386af4c63d53742042dead280eaaf0..65e1aa3b2d3a8af997ccf8e259ca60e0fd73f34d 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -558,6 +558,11 @@ public class EnderDragon extends Mob implements Enemy { @@ -17,11 +17,11 @@ index fc0750f9b2257a3dbf0fab2f0cd4bb020e044752..1621a06eff438eccdbc04a2abebd7185 + if(!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getIndirectSourceEntity().getBukkitEntity()).callEvent()) + continue; + // Paper end - nmsBlock.wasExploded(this.level(), blockposition, explosionSource); + nmsBlock.wasExploded(this.level(), blockposition, this.explosionSource); this.level().removeBlock(blockposition, false); diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java -index 49df94d8a5d1d4020e7e9f5457f117ebaa581b43..945d8b0f58f6a5b2281f136d3afbba3b34e0e6b5 100644 +index 3804490e93bb43444ab3236205888792b54f7074..9cda3353c033b3fb4e34a8a0e2cc4085fec9cdaa 100644 --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java @@ -295,12 +295,19 @@ public class FireBlock extends BaseFireBlock { diff --git a/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch index de1f773f4c..1ee495ec8a 100644 --- a/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 52f5c91d71a8fc86d14c3c4c9e258b9cf70ad57b..41bad67b3a6b8ccdcf9467858cb7d9c0e0a03f0e 100644 +index beebc3ed13b200a0d6585387bb7e06a6aaa07940..88c1c7d0dd8efddcde6d8d81cb89b09c2f6fee2a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1029,6 +1029,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { @@ -301,7 +301,7 @@ index bb399f775a5530a01f59332848c8ab9b8eceb2b5..14edfe103e61024b569f33de0b6608f3 public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 5176e17e39719def9a97473b87cebf1719653e60..86c08e36779af6f85932c1c346c54594f543db0d 100644 +index 1047d9a46314e264ab3f72122aedefd161c7851d..91b9ec5831f439426a853ba9ac7a3f225629b099 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -492,8 +492,10 @@ public class ArmorStand extends LivingEntity { @@ -354,7 +354,7 @@ index 5176e17e39719def9a97473b87cebf1719653e60..86c08e36779af6f85932c1c346c54594 @@ -620,10 +624,10 @@ public class ArmorStand extends LivingEntity { } - drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops + this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops - this.brokenByAnything(damageSource); + return this.brokenByAnything(damageSource); // Paper } @@ -377,7 +377,7 @@ index 5176e17e39719def9a97473b87cebf1719653e60..86c08e36779af6f85932c1c346c54594 @Override public void kill() { -- org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, drops); // CraftBukkit - call event +- org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, this.drops); // CraftBukkit - call event + // Paper start + kill(true); + } @@ -385,14 +385,14 @@ index 5176e17e39719def9a97473b87cebf1719653e60..86c08e36779af6f85932c1c346c54594 + public void kill(boolean callEvent) { + if (callEvent) { + // Paper end -+ org.bukkit.event.entity.EntityDeathEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, drops); // CraftBukkit - call event // Paper - make cancellable ++ org.bukkit.event.entity.EntityDeathEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, this.drops); // CraftBukkit - call event // Paper - make cancellable + if (event.isCancelled()) return; // Paper - make cancellable + } // Paper this.remove(Entity.RemovalReason.KILLED); this.gameEvent(GameEvent.ENTITY_DIE); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9c988b83338c5cf2cbe12aabc729b9184bb3e97d..92e64162181b73e5201e1e3e52db9e372c765a75 100644 +index c72dc80c65484d6fac3b37f6be3f8c678df0a432..39bd2e89f218efc8f851b3bbb86677bdd05a315e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2343,7 +2343,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -412,7 +412,7 @@ index 9c988b83338c5cf2cbe12aabc729b9184bb3e97d..92e64162181b73e5201e1e3e52db9e37 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index ffa0129a4ad3ed12b2afabaea43544f49b330207..87be89a5e2d8b885f6f077433d4a7e402e8c7d49 100644 +index d9038b215a13c0290b718a41612581dce6e30213..78fed280b403c8934485aeb617e011faabe331a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -865,9 +865,16 @@ public class CraftEventFactory { diff --git a/patches/server/0255-Mob-Pathfinding-API.patch b/patches/server/0255-Mob-Pathfinding-API.patch index ce0cbcfb6d..e3120486fa 100644 --- a/patches/server/0255-Mob-Pathfinding-API.patch +++ b/patches/server/0255-Mob-Pathfinding-API.patch @@ -172,7 +172,7 @@ index 539dc45c3c7ffc60cf3fb47ae4df65e604e8627b..eea4c932d909145e7af848cf76e3f49d public Path(List nodes, BlockPos target, boolean reachesTarget) { this.nodes = nodes; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 2000755ac72a25a5d03f238844c458a804f1c033..ce244e96f674f7886179baced3d1e9b67fedfe73 100644 +index a75623fd1b2d36530c55c7a380e68b8dc7e58021..c2acbf533b5f3aebe4837512f694fe25abee65d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -15,8 +15,11 @@ import org.bukkit.loot.LootTable; @@ -188,7 +188,7 @@ index 2000755ac72a25a5d03f238844c458a804f1c033..ce244e96f674f7886179baced3d1e9b6 public void setTarget(LivingEntity target) { Preconditions.checkState(!this.getHandle().generation, "Cannot set target during world generation"); @@ -57,6 +60,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { - return (net.minecraft.world.entity.Mob) entity; + return (net.minecraft.world.entity.Mob) this.entity; } + // Paper start diff --git a/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index af437971b7..bfabc2cd1e 100644 --- a/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index b29b2d3917fbc5c611ebce17fa2f869203c4514e..907a584257ff4145b064f835d6396918cff6fa75 100644 +index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f1298c6fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -84,6 +84,12 @@ import org.bukkit.persistence.PersistentDataContainer; @@ -128,7 +128,7 @@ index b29b2d3917fbc5c611ebce17fa2f869203c4514e..907a584257ff4145b064f835d6396918 ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal)); @@ -651,6 +727,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (this.hasDamage()) { - itemTag.putInt(DAMAGE.NBT, damage); + itemTag.putInt(CraftMetaItem.DAMAGE.NBT, this.damage); } + // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values + if (hasPlaceableKeys()) { @@ -221,7 +221,7 @@ index b29b2d3917fbc5c611ebce17fa2f869203c4514e..907a584257ff4145b064f835d6396918 } catch (CloneNotSupportedException e) { throw new Error(e); @@ -1298,6 +1422,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { - builder.put(DAMAGE.BUKKIT, damage); + builder.put(CraftMetaItem.DAMAGE.BUKKIT, this.damage); } + // Paper start - Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/patches/server/0263-Hook-into-CB-plugin-rewrites.patch b/patches/server/0263-Hook-into-CB-plugin-rewrites.patch index 6696802ac7..6db828239e 100644 --- a/patches/server/0263-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0263-Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index aba415ab7203a21e916eadb923cb02c03b679f65..cfaa85dc3d567bf0110e45fc4e4f24a406b41a45 100644 +index 4b209818a20e76e9d857c4bb822f6b24ec8e9f09..12972cf5876da72cc5d097aeedb13c9addd98add 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -7,8 +7,10 @@ import java.io.InputStream; @@ -100,7 +100,7 @@ index aba415ab7203a21e916eadb923cb02c03b679f65..cfaa85dc3d567bf0110e45fc4e4f24a4 @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - return new MethodVisitor( api, super.visitMethod( access, name, desc, signature, exceptions ) ) + return new MethodVisitor( this.api, super.visitMethod( access, name, desc, signature, exceptions ) ) { + // Paper start - Plugin rewrites + @Override diff --git a/patches/server/0266-Add-sun-related-API.patch b/patches/server/0266-Add-sun-related-API.patch index 1e0c8a4ca8..206c5226bf 100644 --- a/patches/server/0266-Add-sun-related-API.patch +++ b/patches/server/0266-Add-sun-related-API.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add sun related API public net.minecraft.world.entity.Mob isSunBurnTick()Z diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2948cf1b2ca8e342d366077407231a89bbb36667..342bf2941414333ebedaf7d1bd9778a651078ff3 100644 +index ce19d3ba9e86440152f01e9fde22361ccd967ebd..73b476c5c2baa0122cb3cbeb76ec8c42674b6421 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -693,6 +693,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -23,9 +23,9 @@ index 2948cf1b2ca8e342d366077407231a89bbb36667..342bf2941414333ebedaf7d1bd9778a6 + @Override public long getGameTime() { - return world.levelData.getGameTime(); + return this.world.levelData.getGameTime(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index ce244e96f674f7886179baced3d1e9b67fedfe73..522b7cb1db22b02279b004916ad2a14447a6bbed 100644 +index c2acbf533b5f3aebe4837512f694fe25abee65d6..74843d1fa344497d35f05d0b04f650edd1e0f3a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -93,4 +93,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/patches/server/0278-Restore-custom-InventoryHolder-support.patch b/patches/server/0278-Restore-custom-InventoryHolder-support.patch index dde06f4b18..d94cb16b35 100644 --- a/patches/server/0278-Restore-custom-InventoryHolder-support.patch +++ b/patches/server/0278-Restore-custom-InventoryHolder-support.patch @@ -161,7 +161,7 @@ index 0000000000000000000000000000000000000000..224d4b2cc45b0d02230a76caee9c8857 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java -index 1b526fff47e5a3d9a5325c73966dd2bf3dbbdc19..633e6f4922ccaf59979a22885162f42c65bf628a 100644 +index 1b4b397c08d7c05f5a066274a00a6ec80601624a..b4bd318d61834d70d666577073f18e4c49ded113 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -49,7 +49,7 @@ public class CraftContainer extends AbstractContainerMenu { @@ -183,12 +183,12 @@ index 1b526fff47e5a3d9a5325c73966dd2bf3dbbdc19..633e6f4922ccaf59979a22885162f42c // Paper end @@ -247,6 +247,10 @@ public class CraftContainer extends AbstractContainerMenu { - this.lastSlots = delegate.lastSlots; - this.slots = delegate.slots; - this.remoteSlots = delegate.remoteSlots; + this.lastSlots = this.delegate.lastSlots; + this.slots = this.delegate.slots; + this.remoteSlots = this.delegate.remoteSlots; + // Paper start - copy data slots for InventoryView#set/getProperty -+ this.dataSlots = delegate.dataSlots; -+ this.remoteDataSlots = delegate.remoteDataSlots; ++ this.dataSlots = this.delegate.dataSlots; ++ this.remoteDataSlots = this.delegate.remoteDataSlots; + // Paper end } diff --git a/patches/server/0308-Add-Heightmap-API.patch b/patches/server/0308-Add-Heightmap-API.patch index 40583f6584..d58f36eaee 100644 --- a/patches/server/0308-Add-Heightmap-API.patch +++ b/patches/server/0308-Add-Heightmap-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add Heightmap API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 342bf2941414333ebedaf7d1bd9778a651078ff3..ebc2b01b21d15c52928c62edb88dbd088c8ab460 100644 +index 73b476c5c2baa0122cb3cbeb76ec8c42674b6421..8c2f83c8c08b31a6a165ca9aa86a12082ec70ef2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -220,6 +220,29 @@ public class CraftWorld extends CraftRegionAccessor implements World { - return CraftBlock.at(world, new BlockPos(x, y, z)); + return CraftBlock.at(this.world, new BlockPos(x, y, z)); } + // Paper start - Implement heightmap api diff --git a/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch index bbb61a2580..56eaef7cd5 100644 --- a/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 679211aed0fc5bdd630369aa9c82aa6aca9059f4..4d3cd4a5dbf7adb482e60dc88ededdaccf558061 100644 +index fb2851e94c178f49ee8046176b196c63254907e7..ef6d98d503fdca4322000278de4cf325df56f99d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -722,30 +722,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop entities = world.getEntities((Entity)null, maxBB, null); + java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); @@ -172,60 +250,118 @@ public class ActivationRange * @param entity * @return @@ -749,7 +749,7 @@ index 305d9772f2af22e8bdf73235cdb15ea01ac2c3b3..50ddcd7ee9c3ffe7549361f942df01b8 isActive = false; } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index e873a311e2918e1cb72f190e14d088a3ed540aa8..77698b0555c5930645659b4af061c3f428bf8f65 100644 +index 81c76360e8c7389bafd61f38e6782668e8c65d27..50e57486d49694396816122504028e410ebb602d 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -205,14 +205,60 @@ public class SpigotWorldConfig diff --git a/patches/server/0342-Anti-Xray.patch b/patches/server/0342-Anti-Xray.patch index 6383b68332..4b817d747e 100644 --- a/patches/server/0342-Anti-Xray.patch +++ b/patches/server/0342-Anti-Xray.patch @@ -1100,7 +1100,7 @@ index be89e5b8c1ea7f85aef267a15986affa5fa1fd4b..43472855136f26b282d94fd241853d86 public ClientboundLevelChunkWithLightPacket(FriendlyByteBuf buf) { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 27386e814ae956dbb9f2025bcb682456d7cd0eaf..1c30b2f5aa49b2e377bea4278215929a0baa172c 100644 +index 82510154e6a0cef509316b1f8c71021cca39a323..85a2a237c4f84120d0a148c17b4b602c2c8c55e1 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -566,7 +566,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1113,7 +1113,7 @@ index 27386e814ae956dbb9f2025bcb682456d7cd0eaf..1c30b2f5aa49b2e377bea4278215929a this.convertable = convertable_conversionsession; this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index bdf11a98614c9c12d3112f437651be81d0d9872a..58a1a54b676922ef0862dcab98e7aada5de80311 100644 +index 58277908737a1f3da89e5df827e108e2381396ff..f47fcae72d48cd410a4ac3e0a4bd21f42fae7eec 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerInteractEvent; @@ -1151,7 +1151,7 @@ index 5de5209e04d631bd6a50e28e8d3abebf148252c1..19b3f4fa7678a038bf25efc2a8b46dda DebugPackets.sendPoiPacketsForChunk(world, chunkPos); } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 9a6ed3aa55f988ed30669fab2a2513741eda399b..7a1886585bd00dc8213ce22130b8b6fea52c5cf6 100644 +index addaa87d68591dced30e304dc3880588a45234d6..4b0a7ef056ff7dd687d5135ac748ee57d556121e 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1173,8 +1173,8 @@ index 9a6ed3aa55f988ed30669fab2a2513741eda399b..7a1886585bd00dc8213ce22130b8b6fe this.generator = gen; @@ -279,6 +280,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); + this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); + this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); + this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray } @@ -1213,7 +1213,7 @@ index 5e8d2e4245757a0889645ea79ee68afb53f7dde4..f7e5e016a7028a9196e689e950805b0d } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 43cb8c3240fa058557f67d632a713747c1a19a39..44ef27e5c297055f7a2512ae49d68d50cfcde72a 100644 +index d9d2bf31a0e7ad374aa62197c71626a1abfbaf71..4a5491a79281b7cddf5ad5f060567f174b89d14b 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -91,7 +91,7 @@ public class LevelChunk extends ChunkAccess { @@ -1541,7 +1541,7 @@ index 982fb3ef071d6a66f16744717e8e146bef6d9e8c..02beedb84a8bec001270116c6ce496db // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 6daa3591ba17155718c7ff3260de5180b84bb105..40f0fbd5492ccd9cbb622359c17a23041ede7fb6 100644 +index 593cfd68dc0f3679c684b6a1d2036419d4f3bc0c..b4b2f961d1e4f8b5b199052efefd96bcbfc3e68b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -53,7 +53,7 @@ public class CraftChunk implements Chunk { @@ -1554,7 +1554,7 @@ index 6daa3591ba17155718c7ff3260de5180b84bb105..40f0fbd5492ccd9cbb622359c17a2304 private static final byte[] EMPTY_LIGHT = new byte[2048]; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e331fc0866ae91b1463879661b04dad16f6117ca..30adaccd8c5a9d9696bede7967f4b9406ffd066e 100644 +index 34905e673683620fc5f0158fea3c16049d09f8f2..c70c64c2ae7bed27f39db12bd2329aa600ae2fe5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2278,7 +2278,7 @@ public final class CraftServer implements Server { @@ -1567,7 +1567,7 @@ index e331fc0866ae91b1463879661b04dad16f6117ca..30adaccd8c5a9d9696bede7967f4b940 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ed05b94c3ae1f9a45c604d6e5f371edb8d2d9746..098174ddfec746d4212a5ab8e9d353840d3c49c9 100644 +index 27ec5d989be1288ea32fa115ce37e4d98dc54892..d352f6882adbf642b61e0f3f18abebbe5fff1a9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -419,11 +419,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0344-Improve-Block-breakNaturally-API.patch b/patches/server/0344-Improve-Block-breakNaturally-API.patch index 1f5f088a1c..27a3b4f8bb 100644 --- a/patches/server/0344-Improve-Block-breakNaturally-API.patch +++ b/patches/server/0344-Improve-Block-breakNaturally-API.patch @@ -34,7 +34,7 @@ index 6f9cb55491da718cd6564425748ab3852fda9b68..5fbdc96f29e29dfc092b9e84a988032d if (world.dimensionType().ultraWarm()) { world.removeBlock(pos, false); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index ce8f3d66b0f64531e818823761fd1823da4f01d5..e172d05e9e2b8d7844ecff286430f94c1b2fd7db 100644 +index b25ebc5f1c54ea3ecc38e96b79e5cca88aafb816..35e264172688be6cf6e82d948f591893d97a43aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -451,6 +451,18 @@ public class CraftBlock implements Block { @@ -59,7 +59,7 @@ index ce8f3d66b0f64531e818823761fd1823da4f01d5..e172d05e9e2b8d7844ecff286430f94c @@ -460,11 +472,35 @@ public class CraftBlock implements Block { // Modelled off EntityHuman#hasBlock if (block != Blocks.AIR && (item == null || !iblockdata.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(iblockdata))) { - net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), position, this.world.getBlockEntity(position), null, nmsItem); + net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), this.position, this.world.getBlockEntity(this.position), null, nmsItem); + // Paper start - improve Block#breanNaturally + if (triggerEffect) { + if (iblockdata.getBlock() instanceof net.minecraft.world.level.block.BaseFireBlock) { @@ -74,7 +74,7 @@ index ce8f3d66b0f64531e818823761fd1823da4f01d5..e172d05e9e2b8d7844ecff286430f94c } // SPIGOT-6778: Directly call setBlock instead of setTypeAndData, so that the tile entiy is not removed and custom remove logic is run. -- return this.world.setBlock(position, Blocks.AIR.defaultBlockState(), 3) && result; +- return this.world.setBlock(this.position, Blocks.AIR.defaultBlockState(), 3) && result; + // Paper start - improve breakNaturally + boolean destroyed = this.world.removeBlock(this.position, false); + if (destroyed) { diff --git a/patches/server/0370-Improved-Watchdog-Support.patch b/patches/server/0370-Improved-Watchdog-Support.patch index 4d225fff16..2a27d04d81 100644 --- a/patches/server/0370-Improved-Watchdog-Support.patch +++ b/patches/server/0370-Improved-Watchdog-Support.patch @@ -71,7 +71,7 @@ index d7995cadda8f48bbf642114935311180d3ebde5b..226cba0c1eeedd9e80acd603c46b802c cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 951e283d38cb7601049ac6f24385acde514df553..41106a10ca8148dae4129e2a46854d83605839b4 100644 +index f700e677d75f911b786a22b4cc9d0a016d99b02f..5f8cf962a4b630223fb93ffea49d1b2151e1604d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -291,7 +291,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && new File( split[0] ).isFile() ) diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index b47d043144c499b1499f6b4be5a16a3f75c9fcb8..a9bd33b58a6a3296b70eaaaea3adbee74724e448 100644 +index 230d55820778e84c1c8aa2b013ae0e5e35568ea1..5ca863aa1859922fa359eba32539229db40e5b98 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -11,6 +11,7 @@ import org.bukkit.Bukkit; diff --git a/patches/server/0376-Implement-Player-Client-Options-API.patch b/patches/server/0376-Implement-Player-Client-Options-API.patch index b6945da92d..0b7a3c5f0d 100644 --- a/patches/server/0376-Implement-Player-Client-Options-API.patch +++ b/patches/server/0376-Implement-Player-Client-Options-API.patch @@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0bab5208a38e8e7c848e9162396df535eb7e5711..88fcf595c6a28811545715f5e5a225809a977d76 100644 +index b94874cc1484190646798c223b19ddba43a107c7..b0d15e7c2c4d9e04c2a473ff68a01fb0463dd30e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -379,7 +379,7 @@ public class ServerPlayer extends Player { @@ -121,8 +121,8 @@ index 0bab5208a38e8e7c848e9162396df535eb7e5711..88fcf595c6a28811545715f5e5a22580 public void updateOptions(ClientInformation clientOptions) { + new com.destroystokyo.paper.event.player.PlayerClientOptionsChangeEvent(getBukkitEntity(), getClientOptionMap(clientOptions.language(), clientOptions.viewDistance(), com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(clientOptions.chatVisibility().name()), clientOptions.chatColors(), new com.destroystokyo.paper.PaperSkinParts(clientOptions.modelCustomisation()), clientOptions.mainHand() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT, clientOptions.allowsListing(), clientOptions.textFilteringEnabled())).callEvent(); // Paper - settings event // CraftBukkit start - if (getMainArm() != clientOptions.mainHand()) { - PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); + if (this.getMainArm() != clientOptions.mainHand()) { + PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); @@ -1962,6 +1978,11 @@ public class ServerPlayer extends Player { this.server.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.language, clientOptions.language())); // Paper } @@ -136,7 +136,7 @@ index 0bab5208a38e8e7c848e9162396df535eb7e5711..88fcf595c6a28811545715f5e5a22580 this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(this.language); // Paper this.requestedViewDistance = clientOptions.viewDistance(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 94cb3513aeef549da3626ff18c1ea0662252ecb9..f4a15de92c3af88624f337c36fadbea67d339064 100644 +index 45f3d75fbb68a3f93fc3ceaa63183ab5f5c7e91c..b92cc9f8d62cc3bfefe42c4c1fb08af4731dd48f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -604,6 +604,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0383-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0383-Fix-numerous-item-duplication-issues-and-teleport-is.patch index 380902a62d..75d50bc2a8 100644 --- a/patches/server/0383-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/patches/server/0383-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -16,7 +16,7 @@ So even if something NEW comes up, it would be impossible to drop the same item twice because the source was destroyed. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index eed16b541a9c39ed4697e783612e6f7b7ff23b70..1d2dd9b8ae43f22d875cb530130118df247b87dc 100644 +index 77a4d6d14e79230cab80439d1fc28f27824ed04d..ad80dfcc0606a635185bf707af6d3b437f489a31 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2457,11 +2457,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -80,7 +80,7 @@ index eed16b541a9c39ed4697e783612e6f7b7ff23b70..1d2dd9b8ae43f22d875cb530130118df public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 4edf7a989f12cae065977d1f529e856a7d3a932b..f01a5ba97d391292192100b6cd7fa018cdeb7e05 100644 +index 61b9c3ebc97b0a778c3a75a926c0d689f43df823..50c68e48992add57accf7f5479952d17beca577a 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1711,9 +1711,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -113,15 +113,15 @@ index 4edf7a989f12cae065977d1f529e856a7d3a932b..f01a5ba97d391292192100b6cd7fa018 this.drops = new ArrayList<>(); // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 86c08e36779af6f85932c1c346c54594f543db0d..7e996a527a632a2b382f5eea6df6be839a7a0ef4 100644 +index 91b9ec5831f439426a853ba9ac7a3f225629b099..e4e734e0f4c43c1687c8e3a8bbe15441e0bd8e76 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -637,7 +637,7 @@ public class ArmorStand extends LivingEntity { for (i = 0; i < this.handItems.size(); ++i) { itemstack = (ItemStack) this.handItems.get(i); if (!itemstack.isEmpty()) { -- drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops -+ drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); // CraftBukkit - add to drops // Paper - mirror so we can destroy it later - though this call site was safe +- this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops ++ this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); // CraftBukkit - add to drops // Paper - mirror so we can destroy it later - though this call site was safe this.handItems.set(i, ItemStack.EMPTY); } } @@ -129,13 +129,13 @@ index 86c08e36779af6f85932c1c346c54594f543db0d..7e996a527a632a2b382f5eea6df6be83 for (i = 0; i < this.armorItems.size(); ++i) { itemstack = (ItemStack) this.armorItems.get(i); if (!itemstack.isEmpty()) { -- drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops -+ drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); // CraftBukkit - add to drops // Paper - mirror so we can destroy it later - though this call site was safe +- this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops ++ this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)); // CraftBukkit - add to drops // Paper - mirror so we can destroy it later - though this call site was safe this.armorItems.set(i, ItemStack.EMPTY); } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index cb8ac0475c842ba8c70564ed8a9c5d148257262a..4e0b6798754710e9fa598016938f033ae17b8a09 100644 +index b29d600772b1bf544e211739c24a5b9b4f0c4270..27443e3261e49d6401d599cee56dbcfebaead812 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -868,6 +868,11 @@ public class CraftEventFactory { diff --git a/patches/server/0388-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/0388-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch index 0b310dac44..5fd929f57b 100644 --- a/patches/server/0388-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch +++ b/patches/server/0388-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch @@ -17,7 +17,7 @@ keeping long lived large direct buffers in cache. Set system properly at server startup if not set already to help protect from this. diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 491abe3a2768ec4e8c43d3117177c472c205e7bf..84c9998a01000d5b7d70e5724dd03be1536ba297 100644 +index 62aa0381b380ddd583d1ce2e24e04a9a607a89a7..9d7905b7f93d33700045c18b8ccecb7426cb30a7 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -26,6 +26,7 @@ public class Main { @@ -27,4 +27,4 @@ index 491abe3a2768ec4e8c43d3117177c472c205e7bf..84c9998a01000d5b7d70e5724dd03be1 + if (System.getProperty("jdk.nio.maxCachedBufferSize") == null) System.setProperty("jdk.nio.maxCachedBufferSize", "262144"); // Paper - cap per-thread NIO cache size OptionParser parser = new OptionParser() { { - acceptsAll(Main.asList("?", "help"), "Show the help"); + this.acceptsAll(Main.asList("?", "help"), "Show the help"); diff --git a/patches/server/0399-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0399-Wait-for-Async-Tasks-during-shutdown.patch index ee8a118236..3f59b17b5f 100644 --- a/patches/server/0399-Wait-for-Async-Tasks-during-shutdown.patch +++ b/patches/server/0399-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,7 +10,7 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a107751a13ccef2729068e9b9822509374d20187..e2b4e7fb68aeaa2a95f3d1dfdd04521746d18a8d 100644 +index fdaf757cbbc90841747989add56c13f252f645e5..6b7bacb0ea667c488b09da8c2a8a685d3a86608e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -912,6 +912,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop itemsToDrop = level.captureDrops; // Paper - store current list -+ level.captureDrops = null; // Paper - Remove this earlier so that we can actually drop stuff ++ java.util.List itemsToDrop = this.level.captureDrops; // Paper - store current list ++ this.level.captureDrops = null; // Paper - Remove this earlier so that we can actually drop stuff if (event.isDropItems()) { -- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, level.captureDrops); +- org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, this.level.captureDrops); + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, itemsToDrop); // Paper - use stored ref } -- level.captureDrops = null; -+ //world.captureDrops = null; // Paper - move up +- this.level.captureDrops = null; ++ //this.level.captureDrops = null; // Paper - move up // Drop event experience if (flag && event != null) { diff --git a/patches/server/0466-Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/0466-Lazily-track-plugin-scoreboards-by-default.patch index 6095173a4f..88b6225968 100644 --- a/patches/server/0466-Lazily-track-plugin-scoreboards-by-default.patch +++ b/patches/server/0466-Lazily-track-plugin-scoreboards-by-default.patch @@ -39,7 +39,7 @@ index 3f09420ba9268ac1dc5440c0739744370c0de319..052389310826ee6b97cf27dfd952e010 return new CraftObjective(this, objective); } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -index d5c15dd1287e0d5348dc9f7c622850705fcd4ac9..8f20fa2bfbe037fbaa9f4c4c3341a3d9b9a711b5 100644 +index ea838766d1a7620c3722876bfb819b731db11638..f06f011375b9be307a858ccb6579f74942b1d325 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -30,6 +30,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { @@ -48,7 +48,7 @@ index d5c15dd1287e0d5348dc9f7c622850705fcd4ac9..8f20fa2bfbe037fbaa9f4c4c3341a3d9 this.mainScoreboard = new CraftScoreboard(scoreboardServer); + mainScoreboard.registeredGlobally = true; // Paper this.server = minecraftserver; - this.scoreboards.add(mainScoreboard); + this.scoreboards.add(this.mainScoreboard); } @@ -43,10 +44,22 @@ public final class CraftScoreboardManager implements ScoreboardManager { public CraftScoreboard getNewScoreboard() { diff --git a/patches/server/0472-Optimise-getType-calls.patch b/patches/server/0472-Optimise-getType-calls.patch index a5f4af7fad..3ac5b9ed7e 100644 --- a/patches/server/0472-Optimise-getType-calls.patch +++ b/patches/server/0472-Optimise-getType-calls.patch @@ -28,7 +28,7 @@ index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..a9b0f5950b6f97ea4c2a1075946b9200 super(block, propertyMap, codec); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -index 89be1b21c918c5b81ec29fc460fa57d413fb498f..26223227f467c65f62d62a5cba6403979f62c753 100644 +index 089f2a4780a0e3515c032d08a1bb2ea375ebdce1..30f6d74e867869b0070de83fe988672a74580043 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java @@ -98,7 +98,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { @@ -41,20 +41,20 @@ index 89be1b21c918c5b81ec29fc460fa57d413fb498f..26223227f467c65f62d62a5cba640397 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 5a1b0f2352016497099c68c5bcd09a43ebe8bf3a..ef1e77729b12a9ee0b13fa283f8200cc0c3968ce 100644 +index 8313d6de11427a4340ac9fc4f3a04070a5c80cd8..848f089e559e4feb67dea9148291f70460da9e9d 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -219,7 +219,7 @@ public class CraftBlock implements Block { @Override public Material getType() { -- return CraftMagicNumbers.getMaterial(this.world.getBlockState(position).getBlock()); +- return CraftMagicNumbers.getMaterial(this.world.getBlockState(this.position).getBlock()); + return this.world.getBlockState(this.position).getBukkitMaterial(); // Paper - optimise getType calls } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index 3fa5e395faf68c80f4f35afcb83003538e153af1..eb895090384b6ce0943e8286a3aae55506f4310a 100644 +index a193583f596c0a587cd0c2d6eac994226ee4fde0..aca63719790429d3d7c7c59a1931a98221c70fc0 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -170,7 +170,7 @@ public class CraftBlockState implements BlockState { diff --git a/patches/server/0481-Add-ignore-discounts-API.patch b/patches/server/0481-Add-ignore-discounts-API.patch index 76c60665da..94293b80ce 100644 --- a/patches/server/0481-Add-ignore-discounts-API.patch +++ b/patches/server/0481-Add-ignore-discounts-API.patch @@ -91,7 +91,7 @@ index 1d755d04515f20dbd69931084b4cc894e52d35c9..4f7457578ab3118d10e0d5dfc23d79c9 } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java -index 335d65c22efc2b8fd53476e3efd6e74fce5609cf..c48f67f4202e32d9793b462609bd3b95c9765bbd 100644 +index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b88e6aa16 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java @@ -18,11 +18,19 @@ public class CraftMerchantRecipe extends MerchantRecipe { @@ -125,7 +125,7 @@ index 335d65c22efc2b8fd53476e3efd6e74fce5609cf..c48f67f4202e32d9793b462609bd3b95 ); this.setSpecialPrice(specialPrice); @@ -108,6 +117,18 @@ public class CraftMerchantRecipe extends MerchantRecipe { - handle.priceMultiplier = priceMultiplier; + this.handle.priceMultiplier = priceMultiplier; } + // Paper start @@ -141,7 +141,7 @@ index 335d65c22efc2b8fd53476e3efd6e74fce5609cf..c48f67f4202e32d9793b462609bd3b95 + // Paper end + public net.minecraft.world.item.trading.MerchantOffer toMinecraft() { - List ingredients = getIngredients(); + List ingredients = this.getIngredients(); Preconditions.checkState(!ingredients.isEmpty(), "No offered ingredients"); @@ -122,7 +143,7 @@ public class CraftMerchantRecipe extends MerchantRecipe { if (recipe instanceof CraftMerchantRecipe) { diff --git a/patches/server/0512-Implement-API-to-get-Material-from-Boats-and-Minecar.patch b/patches/server/0512-Implement-API-to-get-Material-from-Boats-and-Minecar.patch index b55ce8ee32..754c03c42c 100644 --- a/patches/server/0512-Implement-API-to-get-Material-from-Boats-and-Minecar.patch +++ b/patches/server/0512-Implement-API-to-get-Material-from-Boats-and-Minecar.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement API to get Material from Boats and Minecarts diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java -index ff83b62207652903334e3c2631f22a6456788fe2..d7d54df20984352d84ffb9f7b7da583c34587b85 100644 +index f332bd4e6f663147c9ef6ce03d926feb74b55e93..d161cbf9c83cd78593864850b98f688da2c85aa5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java @@ -79,6 +79,13 @@ public class CraftBoat extends CraftVehicle implements Boat { @@ -23,7 +23,7 @@ index ff83b62207652903334e3c2631f22a6456788fe2..d7d54df20984352d84ffb9f7b7da583c public Status getStatus() { return CraftBoat.boatStatusFromNms(this.getHandle().status); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java -index 053112d7411caa6f439bd344e74aff8c844d93ac..067fcc1f44d59dd675a9cc5485234c87366ffe10 100644 +index ee010d53f8c671d17d68f3f43dca9978e23ac8ab..8920af5a0dfe737c1f38d906b53e6a278456d2aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java @@ -1,8 +1,10 @@ @@ -59,4 +59,4 @@ index 053112d7411caa6f439bd344e74aff8c844d93ac..067fcc1f44d59dd675a9cc5485234c87 + @Override public AbstractMinecart getHandle() { - return (AbstractMinecart) entity; + return (AbstractMinecart) this.entity; diff --git a/patches/server/0517-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0517-Fix-interact-event-not-being-called-sometimes.patch index fc338d7446..4670eeb506 100644 --- a/patches/server/0517-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0517-Fix-interact-event-not-being-called-sometimes.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a32e63f4ffff849aa13daf831b1e436c1112dde2..63535d38c0f7a7fbf19a1e91747f6989d0f72a60 100644 +index 059d2521bb2b86ccafd4b51a014bc6822692d854..95cc9134244eb226480969674201cd234a055964 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1733,7 +1733,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -24,13 +24,13 @@ index a32e63f4ffff849aa13daf831b1e436c1112dde2..63535d38c0f7a7fbf19a1e91747f6989 } } @@ -2295,13 +2295,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - double d3 = player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; + double d3 = this.player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities - org.bukkit.util.RayTraceResult result = this.player.level().getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.1, entity -> { + org.bukkit.util.RayTraceResult result = this.player.level().getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.0, entity -> { // Paper - change raySize from 0.1 to 0.0 Entity handle = ((CraftEntity) entity).getHandle(); - return entity != this.player.getBukkitEntity() && this.player.getBukkitEntity().canSee(entity) && !handle.isSpectator() && handle.isPickable() && !handle.isPassengerOfSameVehicle(player); + return entity != this.player.getBukkitEntity() && this.player.getBukkitEntity().canSee(entity) && !handle.isSpectator() && handle.isPickable() && !handle.isPassengerOfSameVehicle(this.player); }); if (result == null) { CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND); diff --git a/patches/server/0564-Expand-world-key-API.patch b/patches/server/0564-Expand-world-key-API.patch index c839ef77bc..bd45d36dbb 100644 --- a/patches/server/0564-Expand-world-key-API.patch +++ b/patches/server/0564-Expand-world-key-API.patch @@ -20,7 +20,7 @@ index 93f44ca0c8388935baaa41f9b0ebb6de2f6906bb..53b62be779bbb31723c4953221d8b5f2 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dac43bcd9dc796ffec983013291530f3bc541a26..e57af8c8f4a1ddfcf9689c8d721b2e2dc887f0be 100644 +index 98fe64fcab9d0f8497794ccb8df563be782798d9..44d74515165f1ebce5fb5c875ba9c4a53eab9980 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1139,9 +1139,15 @@ public final class CraftServer implements Server { @@ -49,7 +49,7 @@ index dac43bcd9dc796ffec983013291530f3bc541a26..e57af8c8f4a1ddfcf9689c8d721b2e2d + worldKey = ResourceKey.create(Registries.DIMENSION, new net.minecraft.resources.ResourceLocation(creator.key().getNamespace().toLowerCase(java.util.Locale.ENGLISH), creator.key().getKey().toLowerCase(java.util.Locale.ENGLISH))); // Paper } - ServerLevel internal = (ServerLevel) new ServerLevel(this.console, console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), + ServerLevel internal = (ServerLevel) new ServerLevel(this.console, this.console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), @@ -1321,6 +1327,15 @@ public final class CraftServer implements Server { return null; } diff --git a/patches/server/0569-Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/server/0569-Don-t-ignore-result-of-PlayerEditBookEvent.patch index cd72f30d90..e8b8c0ce59 100644 --- a/patches/server/0569-Don-t-ignore-result-of-PlayerEditBookEvent.patch +++ b/patches/server/0569-Don-t-ignore-result-of-PlayerEditBookEvent.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c6f983b66fa1c61f8d0a7d7806937dced4ea72c1..d45c8e234332978154f1fafad6ed5edf927f6103 100644 +index a4f10823242f412ccfece093ed0986512131c4ba..b84cc507ee467e61e90a31da1ca8568f0d947f6b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1186,7 +1186,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } itemstack.addTagElement("pages", nbttaglist); -- CraftEventFactory.handleEditBookEvent(player, slot, handItem, itemstack); // CraftBukkit -+ this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) +- CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack); // CraftBukkit ++ this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) } @Override diff --git a/patches/server/0573-Add-bypass-host-check.patch b/patches/server/0573-Add-bypass-host-check.patch index b67a7be20b..21a11f4ee1 100644 --- a/patches/server/0573-Add-bypass-host-check.patch +++ b/patches/server/0573-Add-bypass-host-check.patch @@ -8,7 +8,7 @@ Paper.bypassHostCheck Seriously, fix your firewalls. -.- diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 65ee0a7183abb0a4b1f36d2ef9631c00b52eb99e..f72a63d654bf5b7edebfc5afdced0b204d70966d 100644 +index 2ee5c884571228a353120f658f1a2d39373ea4ca..bb8ba0ba5c70f321d4fd195f14cfb4d75ec0e42f 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -30,6 +30,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -25,6 +25,6 @@ index 65ee0a7183abb0a4b1f36d2ef9631c00b52eb99e..f72a63d654bf5b7edebfc5afdced0b20 // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! - if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { + if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - connection.hostname = split[0]; - connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); - connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); + this.connection.hostname = split[0]; + this.connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); + this.connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); diff --git a/patches/server/0602-Fix-and-optimise-world-force-upgrading.patch b/patches/server/0602-Fix-and-optimise-world-force-upgrading.patch index f76a27b6fd..cb7fbee987 100644 --- a/patches/server/0602-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/0602-Fix-and-optimise-world-force-upgrading.patch @@ -275,7 +275,7 @@ index 0ea4b588ae7426c59a47ec30e39c878c5fe3df85..963e9887bda7bbcd9555fcbb17d63362 Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6fbe95fea9faa830cde4ff8a8031d148223023e5..171ee674689042ec571c15bfde529bede7056f07 100644 +index 992aa1fa85f0b0240d317773be5086e64889996a..1400fd3f8eb38c15e85221b5805080e1d792215f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -540,11 +540,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop true, iregistry); +- if (this.console.options.has("forceUpgrade")) { +- net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistry); - } + // Paper - move down @@ -379,9 +379,9 @@ index 87374f4f81affc7ae72d7178f4c414026518a5f6..ab1c96a6d7e0d3f8bb651936256e9a66 } + // Paper start - fix and optimise world upgrading -+ if (console.options.has("forceUpgrade")) { ++ if (this.console.options.has("forceUpgrade")) { + net.minecraft.server.Main.convertWorldButItWorks( -+ actualDimension, worldSession, DataFixers.getDataFixer(), worlddimension.generator().getTypeNameForDataFixer(), console.options.has("eraseCache") ++ actualDimension, worldSession, DataFixers.getDataFixer(), worlddimension.generator().getTypeNameForDataFixer(), this.console.options.has("eraseCache") + ); + } + // Paper end - fix and optimise world upgrading diff --git a/patches/server/0604-Add-Unix-domain-socket-support.patch b/patches/server/0604-Add-Unix-domain-socket-support.patch index d76d9a1bc5..c1d9e612c9 100644 --- a/patches/server/0604-Add-Unix-domain-socket-support.patch +++ b/patches/server/0604-Add-Unix-domain-socket-support.patch @@ -11,7 +11,7 @@ Tested-by: Mariell Hoversholm Reviewed-by: Mariell Hoversholm diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index f598c87dac7a2f852eb8a3948b5ba1a299e85492..b9a4447e790f34fd8f88f353bf0e24a18a298ee6 100644 +index 3c751c98de1d5a9b41ebd832be0ae317d4ac9362..51c924f051c25cac8172b0ddab83f3b7a69adfe6 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -219,6 +219,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -93,7 +93,7 @@ index 6641fd04821240b1bbeff1bd8d996a8f2fff8385..5f625acf04ddb56e3596d086252f9bfc } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f8b5122ed55574260391206b99f165fa1515bb02..c4f43ce78f6cf28deee2dbf2bfd942e6b7976a52 100644 +index ef66cd1bac6f80120c14c884d4de5036a3d1d9cc..24e3f3ee7f8af6ec9d61afd8e80e0909ee48c8f0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2460,6 +2460,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -109,7 +109,7 @@ index f8b5122ed55574260391206b99f165fa1515bb02..c4f43ce78f6cf28deee2dbf2bfd942e6 } // Spigot End diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index f72a63d654bf5b7edebfc5afdced0b204d70966d..ae6efc0b8fe1787300a4c6d223dfe48df861ecc6 100644 +index bb8ba0ba5c70f321d4fd195f14cfb4d75ec0e42f..0b3d6b309ea653d44bcfcd6dd418f692e040c87b 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -45,6 +45,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -133,11 +133,11 @@ index f72a63d654bf5b7edebfc5afdced0b204d70966d..ae6efc0b8fe1787300a4c6d223dfe48d // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper + // Paper start - Unix domain socket support -+ java.net.SocketAddress socketAddress = connection.getRemoteAddress(); - connection.hostname = split[0]; -- connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); -+ connection.address = new java.net.InetSocketAddress(split[1], socketAddress instanceof java.net.InetSocketAddress ? ((java.net.InetSocketAddress) socketAddress).getPort() : 0); ++ java.net.SocketAddress socketAddress = this.connection.getRemoteAddress(); + this.connection.hostname = split[0]; +- this.connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); ++ this.connection.address = new java.net.InetSocketAddress(split[1], socketAddress instanceof java.net.InetSocketAddress ? ((java.net.InetSocketAddress) socketAddress).getPort() : 0); + // Paper end - connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); + this.connection.spoofedUUID = com.mojang.util.UndashedUuid.fromStringLenient( split[2] ); } else { diff --git a/patches/server/0607-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0607-Add-cause-to-Weather-ThunderChangeEvents.patch index 5b4a0ffe19..9a9a933443 100644 --- a/patches/server/0607-Add-cause-to-Weather-ThunderChangeEvents.patch +++ b/patches/server/0607-Add-cause-to-Weather-ThunderChangeEvents.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0f59f5da41f3ab18148a7b44b0872632f03ad078..508b18f5e7dd6240a680e73be639d0cf9e4e5d07 100644 +index f6ee996e6d85e1ab886ffc941a4a8cc05857e4e0..61b8ec1ba224551f6898f3e2abbb67992dbb7001 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -666,8 +666,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -48,7 +48,7 @@ index 0f59f5da41f3ab18148a7b44b0872632f03ad078..508b18f5e7dd6240a680e73be639d0cf // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... diff --git a/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java b/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java -index 14b8011c8874e05647eb1636ee1eed5d90da8200..7bfc5bbfcf67e5bbf57e99e648ff5bed4d6b477f 100644 +index 8f661e3080f8145c1e78ff7bd84d77707eef6d9e..6357ac8640fdf9f47a94ad69e77a67f60ddf101f 100644 --- a/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java +++ b/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java @@ -394,6 +394,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData { @@ -95,15 +95,15 @@ index 14b8011c8874e05647eb1636ee1eed5d90da8200..7bfc5bbfcf67e5bbf57e99e648ff5bed if (weather.isCancelled()) { return; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 784001a514b2400b07f64f7d60ec0926891b7b51..a08d724c327b8f3eb819f72713b7fe4be18c1940 100644 +index def1c8a46d686f8be5837c76c15b7463dec553ce..a50a9f239ef27807d876aca9b18fbbb1dfbb14fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1187,7 +1187,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setStorm(boolean hasStorm) { -- world.levelData.setRaining(hasStorm); -+ world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper +- this.world.levelData.setRaining(hasStorm); ++ this.world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) } @@ -111,8 +111,8 @@ index 784001a514b2400b07f64f7d60ec0926891b7b51..a08d724c327b8f3eb819f72713b7fe4b @Override public void setThundering(boolean thundering) { -- world.serverLevelData.setThundering(thundering); -+ world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper +- this.world.serverLevelData.setThundering(thundering); ++ this.world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper this.setThunderDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) } diff --git a/patches/server/0608-More-Lidded-Block-API.patch b/patches/server/0608-More-Lidded-Block-API.patch index a72c613eb8..e65c6a26cb 100644 --- a/patches/server/0608-More-Lidded-Block-API.patch +++ b/patches/server/0608-More-Lidded-Block-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More Lidded Block API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java -index d1046001f0c994174e5ead9e9bf423e61f4ae5c7..3ee3bbb2231d8fcdd6ff9610ec38d40ac5dd219d 100644 +index 08a84f66478d765080367a1c1acd77908ce605a8..7a09fde1a6fbd460548b43ff52301c51d8f5afbc 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java @@ -67,4 +67,11 @@ public class CraftBarrel extends CraftLootable implements Bar @@ -21,7 +21,7 @@ index d1046001f0c994174e5ead9e9bf423e61f4ae5c7..3ee3bbb2231d8fcdd6ff9610ec38d40a + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index 51b5edd8adf029041da69a33da0423da8f6803c8..09dc268cf5a6ba675ed198e03f252c944f4f7117 100644 +index b742d9d231bf79ed53d3fe4deaa81e64c6801c4c..b5d9e750965b21c27ec4aa12b0997176adbad527 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -87,4 +87,11 @@ public class CraftChest extends CraftLootable implements Chest @@ -37,7 +37,7 @@ index 51b5edd8adf029041da69a33da0423da8f6803c8..09dc268cf5a6ba675ed198e03f252c94 + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java -index aeaf0dc35ffa230664f7e6a45e1881fa093fdac6..89f95b39a4e655ed6999e3de2f0d928ba9bace70 100644 +index 79fafa30e4f09dc375cc3fcb1d95a9ab6c8fb9f4..872a579460ebe8d6085188a6be9c9eb9b8d4bfa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java @@ -45,4 +45,11 @@ public class CraftEnderChest extends CraftBlockEntityState implem - if (getTileEntity().opened && getWorldHandle() instanceof net.minecraft.world.level.Level) { - net.minecraft.world.level.Level world = getTileEntity().getLevel(); - world.blockEvent(getPosition(), getTileEntity().getBlockState().getBlock(), 1, 0); -- world.playSound(null, getPosition(), SoundEvents.SHULKER_BOX_OPEN, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); -+ world.playSound(null, getPosition(), SoundEvents.SHULKER_BOX_CLOSE, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); // Paper - More Lidded Block API (Wrong sound) + if (this.getTileEntity().opened && this.getWorldHandle() instanceof net.minecraft.world.level.Level) { + net.minecraft.world.level.Level world = this.getTileEntity().getLevel(); + world.blockEvent(this.getPosition(), this.getTileEntity().getBlockState().getBlock(), 1, 0); +- world.playSound(null, this.getPosition(), SoundEvents.SHULKER_BOX_OPEN, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); ++ world.playSound(null, this.getPosition(), SoundEvents.SHULKER_BOX_CLOSE, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); // Paper - More Lidded Block API (Wrong sound) } - getTileEntity().opened = false; + this.getTileEntity().opened = false; } @@ -68,4 +68,11 @@ public class CraftShulkerBox extends CraftLootable implem public CraftShulkerBox copy() { diff --git a/patches/server/0610-Add-PlayerKickEvent-causes.patch b/patches/server/0610-Add-PlayerKickEvent-causes.patch index 16e21badd0..d90f5b0d02 100644 --- a/patches/server/0610-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0610-Add-PlayerKickEvent-causes.patch @@ -36,7 +36,7 @@ index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834 public boolean shouldDisconnect() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 171ee674689042ec571c15bfde529bede7056f07..7e4f3b7a5790292b3b8439fb4696d9d6cfec0167 100644 +index 1400fd3f8eb38c15e85221b5805080e1d792215f..d74313b58b660f3c03b8a6db4f80b6b073b6b795 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2151,7 +2151,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop(list.size()); for (int index = 0; index < list.size(); index++) { - String line = limit( list.getString(index), 8192 ); // Spigot diff --git a/patches/server/0626-Missing-Entity-API.patch b/patches/server/0626-Missing-Entity-API.patch index 4f78dd69d2..04b4f8487e 100644 --- a/patches/server/0626-Missing-Entity-API.patch +++ b/patches/server/0626-Missing-Entity-API.patch @@ -268,7 +268,7 @@ index c23f05f0d951e0036fe2cf524989747fe236730b..cd59500565a305757872aaf41b03b49f @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 5b3da07def02830e4332d7d3a7f7b968e5663c7b..74a4b1cdfe643007e0afd73f8eb0b1fbe29722cf 100644 +index 8e72958dec9d4eb35330b72e057733a268e83745..decd59f7104ba26145e2150c3b8e5e0404d31885 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java @@ -457,6 +457,16 @@ public class EnderMan extends Monster implements NeutralMob { @@ -306,7 +306,7 @@ index e398a7d5c560b1d94b21fe3241365ef8592d9fc8..c135bc245f59a1af706f98b9d140dee7 protected boolean shouldDespawnInPeaceful() { return true; diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -index 4657bfce13ad95edf1964eb361d5679f93ca2ab2..4b2cd6d34ea4081cad86041f57ccda41807d4279 100644 +index c043f63ff861ccb0194fc8cf102c27af5bcfe491..d4ac3e566b47cfc8688bcc2ab08385b6de4693f8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java @@ -201,6 +201,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -387,7 +387,7 @@ index c3a26a55f46737a470448c6554d6827b1d6fc89c..c0186224fd64d70770a0e16752d17c08 entity = net.minecraft.world.entity.EntityType.TADPOLE.create(world); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java -index 3f1f4d65525562b3117fdc21c8a7f535b12c3c46..90a989c7c9de6f9ba55ab640761915e98320642a 100644 +index 264b3fb45c47fbb6be78262838a5c0438860915f..f9cd595ec28f0284d11bae6bfc5bf92d56526ef9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java @@ -114,4 +114,36 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac @@ -450,7 +450,7 @@ index 35580198ee9ea566dd2643a707653512c6cd938f..a46b2dfb2f1c0c7c3b55d81fc881e481 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java -index f049fd8b8fdfca6e64010741d000a2e3efddc83b..7592ecac3d0893974d9d22ce40c50f1008ab9695 100644 +index b0a3531476f5a05ae846b68d825eddc35ebddea9..1bb72f28085f3885bec068b586ec222111044884 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java @@ -27,4 +27,25 @@ public class CraftBat extends CraftAmbient implements Bat { @@ -480,7 +480,7 @@ index f049fd8b8fdfca6e64010741d000a2e3efddc83b..7592ecac3d0893974d9d22ce40c50f10 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java -index 86ad6073a130100258908d3f2c93c54e21e998f3..17608e0e8cc5288905d2e42ae1429f7d947511fb 100644 +index cfff1be6a4a4936a2dadb2590abc3d33c123d048..3dac93b0ab5d5acf5b33dc4b0efed60319eb657b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java @@ -86,4 +86,42 @@ public class CraftBee extends CraftAnimals implements Bee { @@ -558,7 +558,7 @@ index 94be7d7d88b38d73592a6a76ee9b9b755ba6c588..6c9531c018be29b5794d047b50007fde + // Paper End - More cat api } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java -index c2c653e269330b8494eca98e9cf5a4abb79a6933..5e0b611db52452c00bf3cd2fc07dd713f238a581 100644 +index 64b75682a936e071353707f7615d6ff512fd617d..96f6e2fd9c6b20d34122abfe5c7fba732502d5a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java @@ -18,4 +18,26 @@ public class CraftChicken extends CraftAnimals implements Chicken { @@ -602,7 +602,7 @@ index fa0bf7db880063427ba12df1df1c72240fff93e9..63e6b07e3b159c74d9ef17be20b5ab43 public CraftCod(CraftServer server, net.minecraft.world.entity.animal.Cod entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -index cb161c3d1a08d9c143201040018664298e98eafe..92eb829161079c4a96447698aee58cc6e7cbd29f 100644 +index 21dc209e6f98b6306833b41e2763e746047d5a94..983b9d6ddb58eff297e96e5c8b28ec427efa267d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -40,6 +40,28 @@ public class CraftEnderman extends CraftMonster implements Enderman { @@ -633,7 +633,7 @@ index cb161c3d1a08d9c143201040018664298e98eafe..92eb829161079c4a96447698aee58cc6 + @Override public EnderMan getHandle() { - return (EnderMan) entity; + return (EnderMan) this.entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java @@ -655,7 +655,7 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index a63fb984e905e51dc100eba30cbd71cac173ae22..2ea8b72ef450b60ec6d7ec10f3f94d2154e06670 100644 +index d270d9ca6f1dea0ad4e6a919b58b845eebf3dc87..0a29960fca388dd95710bdba19f37fde6be52073 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -232,10 +232,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -679,7 +679,7 @@ index a63fb984e905e51dc100eba30cbd71cac173ae22..2ea8b72ef450b60ec6d7ec10f3f94d21 else { return new CraftFish(server, (AbstractFish) entity); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java -index 08911b340c45f0b6d4657bfe46f0b153997e4d49..6149067a14b950e727d3387055016a19e55c0fc6 100644 +index 17164811bbcf983bef62c47bc99330074762267b..c455deb4fd2a7684bcc01a8212c362a2375c190b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java @@ -113,4 +113,41 @@ public class CraftFox extends CraftAnimals implements Fox { @@ -725,7 +725,7 @@ index 08911b340c45f0b6d4657bfe46f0b153997e4d49..6149067a14b950e727d3387055016a19 + // Paper end - Add more fox behavior API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java -index 24938472b7898c4111a1f7244b207fd32fcf6e80..3adcf36c7b4beb0f752f91b7333593a610ec118c 100644 +index 2cec61a1bb050c1ef81c5fc3d0afafe9ff29d459..97fa4e1e70203194bd939618b2fad92665af6d59 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java @@ -28,4 +28,17 @@ public class CraftGhast extends CraftFlying implements Ghast, CraftEnemy { @@ -788,12 +788,12 @@ index 9986ac517e11b076a29a8c8e3f480ec286fa5825..0ad16ee7b33582d214dab41eeee378d5 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -index 3ba7e8ef1035e1de2c195b6919fe57aee398af51..fbabf86510c582e372b0b1ac5585c7287734c985 100644 +index 17f5684cba9d3ed22d9925d1951520cc4751dfe2..3a3563a1bdbc0d84d973b3a04b50b78b4bc3d379 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java @@ -33,4 +33,20 @@ public final class CraftMinecartHopper extends CraftMinecartContainer implements public void setEnabled(boolean enabled) { - ((MinecartHopper) getHandle()).setEnabled(enabled); + ((MinecartHopper) this.getHandle()).setEnabled(enabled); } + // Paper start + @Override @@ -813,7 +813,7 @@ index 3ba7e8ef1035e1de2c195b6919fe57aee398af51..fbabf86510c582e372b0b1ac5585c728 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -index de54d45d1764228bdbfb5a73173b551f25440898..7d9b8968334e536457b29be196545a1f4e312a83 100644 +index 77cede9c565a3bc404878c9a4028cadc90f6c010..ade11598bee28fea252e3500aaa1daefc506c175 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java @@ -27,6 +27,28 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow { @@ -955,7 +955,7 @@ index 8b9695de6e3411cbcc2f97e4a4e243ec1d1dd076..03e74b29ebf0f9b9a0dbc6ffc872e22a + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java -index bf216a7b5438a16f1f50fa6d2fb67eebe1408ad3..3c4cbde06c768912332edf57768eabe082e47345 100644 +index c7aec6f28e5d3546235b30f6b1112440a76163c5..fe075cfdf3097d6cb768e71b8cc360abb8eaf367 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java @@ -17,4 +17,16 @@ public class CraftPolarBear extends CraftAnimals implements PolarBear { @@ -976,7 +976,7 @@ index bf216a7b5438a16f1f50fa6d2fb67eebe1408ad3..3c4cbde06c768912332edf57768eabe0 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java -index 3c86feb0fea21d37e0c5175776a3d7844272e911..1a1dfb9e5164f9962059ebf11a9c3334a1987153 100644 +index be20d5a3d5914683f40dc4a585b08a2f55616580..eb7e2902dc134847711284dd2af8abda7627c7ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java @@ -30,4 +30,15 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { @@ -1049,7 +1049,7 @@ index b8140aa25a25870259b5644091c6643da1e14b54..d4d8ce60098c74508e2de9541bf65349 public CraftSalmon(CraftServer server, net.minecraft.world.entity.animal.Salmon entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java -index 0e23bb2d8754a4124126803a6bbca22129d32381..730a25ef2fe934f64f65c21e4e007cf1dbab8bf2 100644 +index 451a9bfd9b9b6945e224f1bb05c7951ed934b4e3..d7c6a0bbc5671ea8f2488230c94df5146a1e98b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java @@ -28,4 +28,15 @@ public class CraftTadpole extends CraftFish implements org.bukkit.entity.Tadpole @@ -1101,7 +1101,7 @@ index 2d1fcbbaba2b88f2c19ae7553d89e50b30cf6581..c628594b981f276acae7b9337100d811 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java -index 9982d94f19d0f201840653c227f1875c83de0723..d1d932dd27cff00e0ab69443a58715e3cbc1e57c 100644 +index e3bde6d1c0e03407af1382a61748470063bb2e18..9e53c30801c700719c78c0fd521fd615c94e02c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java @@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -1114,7 +1114,7 @@ index 9982d94f19d0f201840653c227f1875c83de0723..d1d932dd27cff00e0ab69443a58715e3 public CraftTropicalFish(CraftServer server, net.minecraft.world.entity.animal.TropicalFish entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java -index c4f7216c7ca7a49048fcf5240ef2a8f80e843f1c..6079581ba2eef8ac9272d0bbbf77e31f593edf0f 100644 +index 1cfbe9c476f4a254edf3edf4b70696bbaba78558..e9ec3455eabc473e104b5342a615a38c1ac25a4f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java @@ -29,6 +29,26 @@ public class CraftVex extends CraftMonster implements Vex { @@ -1171,7 +1171,7 @@ index e2a0c11867abee6add8775259c54f2052de7b1ad..fd968881eeec6dc5bdf90decc23a2bfc } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java -index 4a6700d7d2f40cf516054e2e3d09049f1ce4fd17..fd6ac99dae7e54b90f2b0e01430ac6db9410ccd4 100644 +index 0e597394a3dd08f022614fc9777302fea581eb55..3cceefa0d6278924a19641a49bdf16bcdacb2233 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java @@ -49,5 +49,25 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande @@ -1201,7 +1201,7 @@ index 4a6700d7d2f40cf516054e2e3d09049f1ce4fd17..fd6ac99dae7e54b90f2b0e01430ac6db // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java -index 360c971f73a85e3841063dee9bc1da2ddfda4dae..46e3cc146a4b109c4baaf94f42d825646abade68 100644 +index 794e4fe0a3fbd967f665b2707865c15491370c76..c284eb96a1e330078076cbe61f0f6e2ff4ed89bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java @@ -37,6 +37,13 @@ public class CraftWarden extends CraftMonster implements org.bukkit.entity.Warde @@ -1219,7 +1219,7 @@ index 360c971f73a85e3841063dee9bc1da2ddfda4dae..46e3cc146a4b109c4baaf94f42d82564 public void increaseAnger(Entity entity, int increase) { Preconditions.checkArgument(entity != null, "Entity cannot be null"); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -index 83353863e0c58995d3699d5f812d38cae056f695..5a97c92f9b044d8ab7bd3346ceb464455a09046e 100644 +index 1113533d281ed159bb735040fb1f913482debf3a..7a8ce6956db56061af93ba9761f5d1057a90bc49 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java @@ -67,4 +67,36 @@ public class CraftWither extends CraftMonster implements Wither, com.destroystok diff --git a/patches/server/0654-Change-EnderEye-target-without-changing-other-things.patch b/patches/server/0654-Change-EnderEye-target-without-changing-other-things.patch index 71e04b67ea..48c5524ab8 100644 --- a/patches/server/0654-Change-EnderEye-target-without-changing-other-things.patch +++ b/patches/server/0654-Change-EnderEye-target-without-changing-other-things.patch @@ -32,7 +32,7 @@ index ee6bbe96503e9205349e9a5c411dc60dd952ec9e..e48706e2fefc39fcce3c65f629153fdc @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java -index c0c917b928a648206ff6fd53f13fbe3bcb0cdda7..18712bfd46d3852bc1210c8f0dea7e9af3e55b4d 100644 +index d4dfc7a0266086b9bf2c3966c6e149453d0583ba..1fb5760681bf0c745f9f3517489a83666a6d6805 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java @@ -32,8 +32,15 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal { @@ -46,7 +46,7 @@ index c0c917b928a648206ff6fd53f13fbe3bcb0cdda7..18712bfd46d3852bc1210c8f0dea7e9a + @Override + public void setTargetLocation(Location location, boolean update) { + // Paper end - Preconditions.checkArgument(getWorld().equals(location.getWorld()), "Cannot target EnderSignal across worlds"); + Preconditions.checkArgument(this.getWorld().equals(location.getWorld()), "Cannot target EnderSignal across worlds"); - this.getHandle().signalTo(CraftLocation.toBlockPosition(location)); + this.getHandle().signalTo(CraftLocation.toBlockPosition(location), update); // Paper } diff --git a/patches/server/0656-Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/server/0656-Option-to-prevent-NBT-copy-in-smithing-recipes.patch index 5f0bb00e06..1002fe00f7 100644 --- a/patches/server/0656-Option-to-prevent-NBT-copy-in-smithing-recipes.patch +++ b/patches/server/0656-Option-to-prevent-NBT-copy-in-smithing-recipes.patch @@ -86,7 +86,7 @@ index e0b24c140e04a159a7b8aaef64ab94e19fc03dfd..2f26ef211322398e795cbdc75b565fc7 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java -index cd04f4a5d87d423ec878dbbc522f3f7fbc325eb6..c81eb74f901a71419b919afc2fcd59a2937575da 100644 +index 8c381e2745e7d5b63e72a60c5541b549f0d1b9bf..8b0e3a92e9893af954bc85adb2566502b65a0fa4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTransformRecipe.java @@ -12,12 +12,17 @@ public class CraftSmithingTransformRecipe extends SmithingTransformRecipe implem @@ -112,12 +112,12 @@ index cd04f4a5d87d423ec878dbbc522f3f7fbc325eb6..c81eb74f901a71419b919afc2fcd59a2 public void addToCraftingManager() { ItemStack result = this.getResult(); -- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(toNMS(this.getTemplate(), true), toNMS(this.getBase(), true), toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result)))); -+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(toNMS(this.getTemplate(), true), toNMS(this.getBase(), true), toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result), this.willCopyNbt()))); // Paper +- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result)))); ++ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTransformRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result), this.willCopyNbt()))); // Paper } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java -index f1206c4626034b70d462a8a81e7ed4f5dfd9f2f8..6207320f0e39a46e78a96b9c15cfdd29b5c36d6f 100644 +index 87f20a4811d082f217638768417c1c0feb84f741..105c72a674e1a8ca4eb6003841f5d933d3a2c275 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSmithingTrimRecipe.java @@ -12,17 +12,22 @@ public class CraftSmithingTrimRecipe extends SmithingTrimRecipe implements Craft @@ -141,7 +141,7 @@ index f1206c4626034b70d462a8a81e7ed4f5dfd9f2f8..6207320f0e39a46e78a96b9c15cfdd29 @Override public void addToCraftingManager() { -- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(toNMS(this.getTemplate(), true), toNMS(this.getBase(), true), toNMS(this.getAddition(), true)))); -+ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(toNMS(this.getTemplate(), true), toNMS(this.getBase(), true), toNMS(this.getAddition(), true), this.willCopyNbt()))); // Paper +- MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true)))); ++ MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftNamespacedKey.toMinecraft(this.getKey()), new net.minecraft.world.item.crafting.SmithingTrimRecipe(this.toNMS(this.getTemplate(), true), this.toNMS(this.getBase(), true), this.toNMS(this.getAddition(), true), this.willCopyNbt()))); // Paper } } diff --git a/patches/server/0660-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0660-Add-methods-to-find-targets-for-lightning-strikes.patch index 85e5229ebe..827935032f 100644 --- a/patches/server/0660-Add-methods-to-find-targets-for-lightning-strikes.patch +++ b/patches/server/0660-Add-methods-to-find-targets-for-lightning-strikes.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add methods to find targets for lightning strikes public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 31d30840ec0acfd0d666163f77c8deb0efced922..a11bd2d9f5b2fb248cc322ea61886050fa2e73a9 100644 +index eb4ad9cfd2291b01fd09be2114b56502149fe049..9fd3eca485fc71e5da142f8b6763e44691e3f41c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -976,6 +976,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -31,7 +31,7 @@ index 31d30840ec0acfd0d666163f77c8deb0efced922..a11bd2d9f5b2fb248cc322ea61886050 blockposition1 = blockposition1.above(2); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 286db6e246d48fb391c609f4e8a0222f1b294cfc..b137d0946b45b1f1a0170177b47fcece406a70dc 100644 +index b69c0e32965b3ed5b3e41d7cdee6f07b572d2b7c..bf92ff17e5f084df565b682c8b026dc20f580912 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -699,6 +699,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -57,4 +57,4 @@ index 286db6e246d48fb391c609f4e8a0222f1b294cfc..b137d0946b45b1f1a0170177b47fcece + @Override public boolean generateTree(Location loc, TreeType type) { - return generateTree(loc, CraftWorld.rand, type); + return this.generateTree(loc, CraftWorld.rand, type); diff --git a/patches/server/0680-Name-craft-scheduler-threads-according-to-the-plugin.patch b/patches/server/0680-Name-craft-scheduler-threads-according-to-the-plugin.patch index e2e0d713f0..e97fc69558 100644 --- a/patches/server/0680-Name-craft-scheduler-threads-according-to-the-plugin.patch +++ b/patches/server/0680-Name-craft-scheduler-threads-according-to-the-plugin.patch @@ -8,7 +8,7 @@ Provides quick access to culprits running far more threads than they should be diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java -index 2f3e2a404f55f09ae4db8261e495275e31228034..6d66f83afbeb650b10669fd7eeb24a315951fa86 100644 +index 365b7e7c665bec357fb76d1479bf17da6f603590..b17d40ced3f2d5859c61f1826ead72c5f07abe9f 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncTask.java @@ -25,7 +25,10 @@ class CraftAsyncTask extends CraftTask { @@ -20,7 +20,7 @@ index 2f3e2a404f55f09ae4db8261e495275e31228034..6d66f83afbeb650b10669fd7eeb24a31 + final String nameBefore = thread.getName(); + thread.setName(nameBefore + " - " + this.getOwner().getName()); + try { synchronized (this.workers) { // Paper end - name threads according to running plugin - if (getPeriod() == CraftTask.CANCEL) { + if (this.getPeriod() == CraftTask.CANCEL) { // Never continue running after cancelled. // Checking this with the lock is important! @@ -92,6 +95,7 @@ class CraftAsyncTask extends CraftTask { diff --git a/patches/server/0711-Fix-upstreams-block-state-factories.patch b/patches/server/0711-Fix-upstreams-block-state-factories.patch index 86d1fc56bc..da98b563f3 100644 --- a/patches/server/0711-Fix-upstreams-block-state-factories.patch +++ b/patches/server/0711-Fix-upstreams-block-state-factories.patch @@ -26,7 +26,7 @@ index d156f7cc71050f13b2feca00c52ca6b64572b60e..e3557f4c8cee7c88b3e352cd246078da if (state instanceof InventoryHolder) return (InventoryHolder) state; return null; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index 2ced6d0b3a839935dfb715f339a9501e9e519cf8..a78f0f94302a2a887b79dafdcbbbc3433c663092 100644 +index f7f211b4f08a7f21a183078affd6f875aa30dd50..a8290624d8c5b19506f628d049984d2e59c4423c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -13,7 +13,7 @@ import org.bukkit.persistence.PersistentDataContainer; @@ -50,7 +50,7 @@ index 2ced6d0b3a839935dfb715f339a9501e9e519cf8..a78f0f94302a2a887b79dafdcbbbc343 // Paper start @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52ed39323f 100644 +index c9ef19bdeeb130561659ff8161bf4e196cf4f53f..e44cd3b8eef25a3e7eedbe8ae597d74585ecd627 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; @@ -370,7 +370,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 } private static BlockStateFactory getFactory(Material material) { - return CraftBlockStates.FACTORIES.getOrDefault(material, DEFAULT_FACTORY); + return CraftBlockStates.FACTORIES.getOrDefault(material, CraftBlockStates.DEFAULT_FACTORY); } + // Paper start diff --git a/patches/server/0720-Hide-unnecessary-itemmeta-from-clients.patch b/patches/server/0720-Hide-unnecessary-itemmeta-from-clients.patch index 8247d73bf8..08638e9536 100644 --- a/patches/server/0720-Hide-unnecessary-itemmeta-from-clients.patch +++ b/patches/server/0720-Hide-unnecessary-itemmeta-from-clients.patch @@ -18,22 +18,22 @@ index 8d2870c780c4c253f6570c7ef73f6e7c2ccc46ad..0cbb5dd17c5b37ad90ce11a31b644707 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e8ca93305e8baaee3e72932b630a2d6907444593..65f36454b08d7527aca0d3e667979fd58f3dcf6f 100644 +index f1c0ff296b58aa020b00d6681ecf3cb4db09f561..88c543881c8e7453fffc08e1d5a3226505a8889e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2550,8 +2550,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Refresh the current entity metadata - entity.getEntityData().refresh(player); + entity.getEntityData().refresh(ServerGamePacketListenerImpl.this.player); // SPIGOT-7136 - Allays - if (entity instanceof Allay) { -- send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList()))); +- ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList()))); + if (entity instanceof Allay allay) { // Paper -+ send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, allay.stripMeta(allay.getItemBySlot(slot), true))).collect(Collectors.toList()))); // Paper - remove unnecessary item meta - player.containerMenu.sendAllDataToRemote(); ++ ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, allay.stripMeta(allay.getItemBySlot(slot), true))).collect(Collectors.toList()))); // Paper - remove unnecessary item meta + ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f8738a28fb30c8fdb52ed3e6f8000144129c1f00..4dc9647b9c7206b1e98554d2db0f193b0dce0a94 100644 +index 8959e7d6142025937f9fea3fb8dc25410564cec7..9e1a5eb4cc834305e8959bb1552202c3b64fc869 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3196,7 +3196,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0726-Collision-optimisations.patch b/patches/server/0726-Collision-optimisations.patch index c8215111b7..9922ee6fbb 100644 --- a/patches/server/0726-Collision-optimisations.patch +++ b/patches/server/0726-Collision-optimisations.patch @@ -2204,7 +2204,7 @@ index d0a8092bf57a29ab7c00ec0ddf52a9fdb2a33267..392406722b0a040c1d41fdc1154d75d3 private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) { this.data3d = id; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index c9eb785457b606d8f7c4fe3f824fd6d0a1d1070e..19f94236df83d73686aded9658a6469b3840c0c3 100644 +index 3e591d1d7487da42d1f2a655a3535cfb538c3141..ca7ca9fcd00a70e5d48ce1028e2af4df9be3a9de 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -462,7 +462,7 @@ public class ServerPlayer extends Player { @@ -2226,7 +2226,7 @@ index c9eb785457b606d8f7c4fe3f824fd6d0a1d1070e..19f94236df83d73686aded9658a6469b } } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 965dd34bd9a23a2fb17e5800af3b294b75b1146a..c493f883940819913f0cecb5e374fe94123df24c 100644 +index 87fc2c057667eaf7303f3be474e436e0d4cf109a..f505977aaa48ab25b0a8a630f51e36551cb0fa79 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -892,7 +892,7 @@ public abstract class PlayerList { @@ -2239,7 +2239,7 @@ index 965dd34bd9a23a2fb17e5800af3b294b75b1146a..c493f883940819913f0cecb5e374fe94 entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 4b135772f8346103c2e6e1473af95f0bfa9754ef..f91cbf742ee12f29cdebbd0a1481f0ea6db8d50b 100644 +index 6474a847f918246b9352f48f8fc55dcf8f125838..b46a1ad08f48a7ed1fdd7775376677c7c4b011d5 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1177,9 +1177,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2469,7 +2469,7 @@ index 4b135772f8346103c2e6e1473af95f0bfa9754ef..f91cbf742ee12f29cdebbd0a1481f0ea } diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 25bf917fae922b34cc639148993bac39a50b4ce5..1c7702a5c888846f93f8f80d3b854a26c11499be 100644 +index d972c59ec98e73d7ccd774e0f06c686251ffe4cf..9dcf28bdcb5770a191e62353a60c953731671283 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -353,7 +353,7 @@ public class ArmorStand extends LivingEntity { @@ -2629,12 +2629,12 @@ index a25497eec004add7408a63b1a0f09e3fa443b324..9f892de55ab03367daed4c30cc44c9dd // Paper start diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 270ce3995229aa79074e981bb45e5480a5e924d4..627758e4f55283c5dcf23d494efb92bfa9f6b005 100644 +index 5e7a53d1cae4c94a08fb89d7599d183de21cdfaa..330ce28f128ff2e5ca80f0938ac3ea7b195e9d82 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -297,6 +297,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); + this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); + this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + // Paper start - optimise collisions + this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); diff --git a/patches/server/0728-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/0728-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch index 43b65982be..3302cf5d13 100644 --- a/patches/server/0728-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch +++ b/patches/server/0728-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix ChunkSnapshot#isSectionEmpty(int) and optimize diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 40f0fbd5492ccd9cbb622359c17a23041ede7fb6..2d36a132bdf67413b40d3b2dd97f52a741538a6f 100644 +index b4b2f961d1e4f8b5b199052efefd96bcbfc3e68b..41981307bc7d5bfce99f902290201ddd377dfc22 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -291,13 +291,17 @@ public class CraftChunk implements Chunk { @@ -30,7 +30,7 @@ index 40f0fbd5492ccd9cbb622359c17a23041ede7fb6..2d36a132bdf67413b40d3b2dd97f52a7 + // Paper end LevelLightEngine lightengine = this.worldServer.getLightEngine(); - DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(x, chunk.getSectionYFromSectionIndex(i), z)); // SPIGOT-7498: Convert section index + DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(this.x, chunk.getSectionYFromSectionIndex(i), this.z)); // SPIGOT-7498: Convert section index @@ -316,8 +320,7 @@ public class CraftChunk implements Chunk { } diff --git a/patches/server/0740-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/server/0740-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch index 9f3ee548ee..d7ccde8439 100644 --- a/patches/server/0740-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch +++ b/patches/server/0740-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Expose isFuel and canSmelt methods to FurnaceInventory diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java -index 05c29a788c96282fc18066ae253cf0b5be37e95c..e8e53d3c7d8b1bba7d77dc0c76d242eb177ad851 100644 +index 29a8cd7667860c4598a556e6ef3af39c731683db..4ce9fd8e4e124600f48f34c6943512f39444cb9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java @@ -40,6 +40,20 @@ public class CraftInventoryFurnace extends CraftInventory implements FurnaceInve - setItem(0, stack); + this.setItem(0, stack); } + // Paper start @@ -28,4 +28,4 @@ index 05c29a788c96282fc18066ae253cf0b5be37e95c..e8e53d3c7d8b1bba7d77dc0c76d242eb + @Override public Furnace getHolder() { - return (Furnace) inventory.getOwner(); + return (Furnace) this.inventory.getOwner(); diff --git a/patches/server/0748-Multiple-Entries-with-Scoreboards.patch b/patches/server/0748-Multiple-Entries-with-Scoreboards.patch index f5b866130a..69772b2ea9 100644 --- a/patches/server/0748-Multiple-Entries-with-Scoreboards.patch +++ b/patches/server/0748-Multiple-Entries-with-Scoreboards.patch @@ -70,11 +70,11 @@ index e84332b6f031e83283c1b6e90bb82a6053ff46d7..03d13c2425170a6513ea7442a4a12fc9 public void onObjectiveAdded(Objective objective) { super.onObjectiveAdded(objective); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java -index 4d65d1a0dd52aaeeeef8acf2b0023f27257f60a2..9c3520524cfb903da6a5401760394ec1b49a1825 100644 +index f0b59dd4b7c3d857f7aa7c8263c760f7a46c6e34..c25ab8baf2eb66f85a60280e32a134c99f21b40c 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -229,6 +229,21 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { - scoreboard.board.addPlayerToTeam(entry, team); + scoreboard.board.addPlayerToTeam(entry, this.team); } + // Paper start diff --git a/patches/server/0760-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0760-API-for-creating-command-sender-which-forwards-feedb.patch index 79a9f6de1f..b92c1c2856 100644 --- a/patches/server/0760-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/server/0760-API-for-creating-command-sender-which-forwards-feedb.patch @@ -122,11 +122,11 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 46944a7f368b8c1da29400a171876b903844377c..6254c962346c243a596ba3ace41a2d5218c86776 100644 +index c2ea7afae83b1cbecff86c519b9c6983c083d2a1..0bca5e89bc8df486b44c0921e217d0546a490d4e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2015,6 +2015,13 @@ public final class CraftServer implements Server { - return console.console; + return this.console.console; } + // Paper start @@ -161,7 +161,7 @@ index eaff8df6c8c12c64e005a68a02e2e35ed88f757c..1c638a4b1f2c841928d8b2a7ae43e4eb if (this instanceof CraftBlockCommandSender) { if (ServerCommandSender.blockPermInst == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -index d6a4507f547893bf7f8318723b5f86cc779e47a2..c429e580ac791d181916aea2776c558d576d5b3a 100644 +index 13804bb81a13d51d2e9e55d8a477369ba20fc301..3453eccf524d58c25f09b7a9772da703b85f4865 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -83,6 +83,11 @@ public final class VanillaCommandWrapper extends BukkitCommand { diff --git a/patches/server/0769-Add-missing-block-data-mins-and-maxes.patch b/patches/server/0769-Add-missing-block-data-mins-and-maxes.patch index 2096473939..bf5dcd67c2 100644 --- a/patches/server/0769-Add-missing-block-data-mins-and-maxes.patch +++ b/patches/server/0769-Add-missing-block-data-mins-and-maxes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add missing block data mins and maxes diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java -index 83f86725c00f0e175cb46c7e27705ca777f413ba..24d16825c10edfed6d22e8e37ddb9fd804b716c4 100644 +index 2230160d5e04e979467a56346600436c1e5dd70c..08436bfeba2f35fb11b16c4f71f76e13c0d44b1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java @@ -31,6 +31,12 @@ public final class CraftCandle extends org.bukkit.craftbukkit.block.data.CraftBl @@ -22,12 +22,12 @@ index 83f86725c00f0e175cb46c7e27705ca777f413ba..24d16825c10edfed6d22e8e37ddb9fd8 // org.bukkit.craftbukkit.block.data.CraftLightable diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java -index bd1c7e41f0d21c69b1d1b4d4021d188502d7fee3..82da57f7d288da45062f7d61325caf0e47e6d4f6 100644 +index af29ff861eb2c504ef31cc3236adf1e7f6b46049..bc32c5d4c7568ed4392e4bdb5872066846aa62b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCherryLeaves.java @@ -51,4 +51,16 @@ public final class CraftCherryLeaves extends org.bukkit.craftbukkit.block.data.C public void setWaterlogged(boolean waterlogged) { - set(CraftCherryLeaves.WATERLOGGED, waterlogged); + this.set(CraftCherryLeaves.WATERLOGGED, waterlogged); } + + // Paper start @@ -43,7 +43,7 @@ index bd1c7e41f0d21c69b1d1b4d4021d188502d7fee3..82da57f7d288da45062f7d61325caf0e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java -index 780b6a29592571f4a730a858734256f69519cca7..ef97e77b25562a8aed35d68d42ced4825d43a29d 100644 +index 7ce2e8b733bcd496dcfccb1ddfcb7c5c1b64052e..5ae27fc8f9d18bae949d335ea53e7e70917f0e80 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java @@ -31,4 +31,11 @@ public final class CraftComposter extends org.bukkit.craftbukkit.block.data.Craf @@ -59,7 +59,7 @@ index 780b6a29592571f4a730a858734256f69519cca7..ef97e77b25562a8aed35d68d42ced482 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java -index f083cf727e7fd55f0749e85e3d034b5606121110..e40cda2f23d63e9d2029a8c8818103b6eeb6a925 100644 +index 70d734fc71a4499bbf569b3908aa5fbbdf19e6a0..1af5fe48c5861077555e6bdeb6312859b7b37eb2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftFluids.java @@ -31,4 +31,11 @@ public final class CraftFluids extends org.bukkit.craftbukkit.block.data.CraftBl @@ -75,7 +75,7 @@ index f083cf727e7fd55f0749e85e3d034b5606121110..e40cda2f23d63e9d2029a8c8818103b6 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java -index 0d08c81dd8582ef4f259f0e0db88e1b85d79f2a1..5b96ec73bf7bd4d90ce77cfe8ffec82580b20d2b 100644 +index bf0d53f65f8a672c385b2e798b109a9662725f9e..c0e0cbceb0b5c36f4ac4672f217027a5898900a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLayeredCauldron.java @@ -31,4 +31,11 @@ public final class CraftLayeredCauldron extends org.bukkit.craftbukkit.block.dat @@ -91,12 +91,12 @@ index 0d08c81dd8582ef4f259f0e0db88e1b85d79f2a1..5b96ec73bf7bd4d90ce77cfe8ffec825 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java -index 2775bcc7d61806764a121d45621a8928f5e301e7..8cb0f9bf8a2e264e089a0278d5fb4b157844f6e4 100644 +index 33d9a950ed678595fe2573e9f89a8d1716040503..ab336b400c1937ff86b681b27b1550e4b7f1ab79 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java @@ -51,4 +51,16 @@ public final class CraftLeaves extends org.bukkit.craftbukkit.block.data.CraftBl public void setWaterlogged(boolean waterlogged) { - set(CraftLeaves.WATERLOGGED, waterlogged); + this.set(CraftLeaves.WATERLOGGED, waterlogged); } + + // Paper start @@ -112,7 +112,7 @@ index 2775bcc7d61806764a121d45621a8928f5e301e7..8cb0f9bf8a2e264e089a0278d5fb4b15 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLight.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLight.java -index de882af105fae1166aced908cfe45b826a07f418..0d430382a05dfc0802a2569816c5ec876a053f16 100644 +index 49f314b1447212a1a5a7623d2302b5960a44ce6e..8c936a95effa84ba0337d2aaf880cc561591fb33 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLight.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLight.java @@ -32,6 +32,13 @@ public final class CraftLight extends org.bukkit.craftbukkit.block.data.CraftBlo @@ -130,12 +130,12 @@ index de882af105fae1166aced908cfe45b826a07f418..0d430382a05dfc0802a2569816c5ec87 private static final net.minecraft.world.level.block.state.properties.BooleanProperty WATERLOGGED = getBoolean(net.minecraft.world.level.block.LightBlock.class, "waterlogged"); diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java -index f070c35833b33ad2d7cfa629d8702a95e9bc6d04..5a021dc1931d35cbe235ab399aa98f3c7e93ded3 100644 +index 7a1f2fd2f7f8f1b46352fe2c4d0cdf23a88020fd..8b621aaeadcf2cc6e2ccdbab92f4ae2b89a6ca08 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftMangroveLeaves.java @@ -51,4 +51,16 @@ public final class CraftMangroveLeaves extends org.bukkit.craftbukkit.block.data public void setWaterlogged(boolean waterlogged) { - set(CraftMangroveLeaves.WATERLOGGED, waterlogged); + this.set(CraftMangroveLeaves.WATERLOGGED, waterlogged); } + + // Paper start @@ -151,7 +151,7 @@ index f070c35833b33ad2d7cfa629d8702a95e9bc6d04..5a021dc1931d35cbe235ab399aa98f3c + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java -index c6bd91bdf6bf64701ffc69619174cc3b43b72d88..c6289306f0f933b67ff1f6db63ef976df7aa5438 100644 +index 5003386cb1ce9977e517a26c3ec8e80e5fb4fb15..ffce9e3ce33fc5581f46543105f5dd04fe56f8e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftPowderSnowCauldron.java @@ -31,4 +31,11 @@ public final class CraftPowderSnowCauldron extends org.bukkit.craftbukkit.block. diff --git a/patches/server/0771-Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/0771-Put-world-into-worldlist-before-initing-the-world.patch index 39f0aea5a8..63add2e773 100644 --- a/patches/server/0771-Put-world-into-worldlist-before-initing-the-world.patch +++ b/patches/server/0771-Put-world-into-worldlist-before-initing-the-world.patch @@ -7,7 +7,7 @@ Some parts of legacy conversion will need the overworld to get the legacy structure data storage diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7d944606f7e136aa60a0ea376ef325887bd4e6a8..e7bd891260ad4c95c6161542e6d1412c6e9daea0 100644 +index ebf31af53f26d33a745badbfc6fa4e7f84aea87d..9f56553b416df71ec60a3327a58d843be95dded8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -589,9 +589,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop entities = world.getEntities((Entity)null, maxBB, null); + java.util.List entities = world.getEntities((Entity)null, ActivationRange.maxBB, null); + boolean tickMarkers = world.paperConfig().entities.markers.tick; // Paper - configurable marker ticking for (int i = 0; i < entities.size(); i++) { Entity entity = entities.get(i); diff --git a/patches/server/0832-More-Teleport-API.patch b/patches/server/0832-More-Teleport-API.patch index 56e6375cd1..519cdbe10e 100644 --- a/patches/server/0832-More-Teleport-API.patch +++ b/patches/server/0832-More-Teleport-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More Teleport API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b1be147250d3850930e103a2fa2823a6c992f0dd..675467a6552cfc1f951e7c81a9be0d423cae8c44 100644 +index 7e388fc82cb4f7a71b36a204c5af827509ab60f3..331d8c69dc4464ff6b44b4b37ecf426ff3514fc3 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1605,11 +1605,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -29,7 +29,7 @@ index b1be147250d3850930e103a2fa2823a6c992f0dd..675467a6552cfc1f951e7c81a9be0d42 d0 = to.getX(); d1 = to.getY(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index c924ee182c150feca61deab9b8cc54806a23c49a..6fdde2f766b91833dc2318526f84e96cb26233b4 100644 +index b9c69703bb41f7d04f95bef27eb0614c5931c326..706eeebe3ebbecd431c42140e7f351d5f7faf032 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -566,15 +566,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -72,7 +72,7 @@ index c924ee182c150feca61deab9b8cc54806a23c49a..6fdde2f766b91833dc2318526f84e96c // Let the server handle cross world teleports if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 86f9950c6188f407b547cb19330444c5e29f5838..0fc4a90383a5b332cad58ec55e30dc363aed16ca 100644 +index ed7d6c2303873b39ecabfe78d0950cf698f6f61c..8bdfbe71e2718e0e24b1de048c8e48927fae1e3a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1212,13 +1212,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -211,4 +211,4 @@ index 86f9950c6188f407b547cb19330444c5e29f5838..0fc4a90383a5b332cad58ec55e30dc36 + entity.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), relativeArguments); // Paper - Teleport API } else { // The respawn reason should never be used if the passed location is non null. - server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck, null); // Paper + this.server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck, null); // Paper diff --git a/patches/server/0842-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0842-Add-Velocity-IP-Forwarding-Support.patch index 2795895eb5..85a2ae83e6 100644 --- a/patches/server/0842-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0842-Add-Velocity-IP-Forwarding-Support.patch @@ -95,11 +95,11 @@ index 0000000000000000000000000000000000000000..a34381122de53123169927e181df6628 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 2d06a8f85c5e29688aa0fd4726fd576721535384..dbccbcb9b44e4efacdf53c2d161115cc20b36cff 100644 +index 321675996b83fbe34d7e0d690eafe170d7466e17..2b5d82fbf4e7ec32d0c53dd3e8207b1dba708bbd 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -274,13 +274,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface - server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP); + this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP); // CraftBukkit end + // Paper start @@ -123,7 +123,7 @@ index 2d06a8f85c5e29688aa0fd4726fd576721535384..dbccbcb9b44e4efacdf53c2d161115cc DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); } diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index f7ad9f51d4fb45d41c718a97c1fad72504d0c0ad..78810048fde7fd6299cdc99634ba646755e0c41c 100644 +index 5ff49a0f2f42b63d606c7d9205c0e63fe39e163f..aac84898d2563bfb45c7d0884d65be2346d2911e 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -62,6 +62,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -215,7 +215,7 @@ index f7ad9f51d4fb45d41c718a97c1fad72504d0c0ad..78810048fde7fd6299cdc99634ba6467 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7441b15d074de921d3dc0f594e491d036b1f6064..34bde8263dd0f3eeae81d896e2d328d276353e7a 100644 +index a148d03d746d4580777e1e193c07dad922a080e0..2384ad530ce9c8329e378e7488701df7c2f389fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -805,7 +805,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0851-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/0851-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch index 81fbb79345..536e9fbff4 100644 --- a/patches/server/0851-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch +++ b/patches/server/0851-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add a consumer parameter to ProjectileSource#launchProjectile diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 26054a3b4e2609cb68751d6e37bce22df94c46b8..8c8431f40e9415b32e43acea4cd91a20d82d8d08 100644 +index 9d9b27f21c1d62dac7dd63e8af44601691e656be..f19ebe71b46d31772b486cae5d96535f28c86824 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -509,8 +509,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -24,7 +24,7 @@ index 26054a3b4e2609cb68751d6e37bce22df94c46b8..8c8431f40e9415b32e43acea4cd91a20 + // Paper end - launchProjectile consumer Preconditions.checkState(!this.getHandle().generation, "Cannot launch projectile during world generation"); - net.minecraft.world.level.Level world = ((CraftWorld) getWorld()).getHandle(); + net.minecraft.world.level.Level world = ((CraftWorld) this.getWorld()).getHandle(); @@ -593,6 +600,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { if (velocity != null) { ((T) launch.getBukkitEntity()).setVelocity(velocity); diff --git a/patches/server/0865-Allow-changing-bed-s-occupied-property.patch b/patches/server/0865-Allow-changing-bed-s-occupied-property.patch index 4d0128b6d3..f1d50caf78 100644 --- a/patches/server/0865-Allow-changing-bed-s-occupied-property.patch +++ b/patches/server/0865-Allow-changing-bed-s-occupied-property.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Allow changing bed's 'occupied' property diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java -index c892c0e37bd4f9b208147e2df16fc9ed024eacf7..71df14b932306aa4c8ea6d4883f6ba053955ec28 100644 +index f636a6b69143e88fc3bebd11620083ab6a419d48..e6ff5225fe8253cbaa79ed15b4c12f3735fc7021 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftBed.java @@ -22,4 +22,11 @@ public abstract class CraftBed extends CraftBlockData implements Bed { public boolean isOccupied() { - return get(CraftBed.OCCUPIED); + return this.get(CraftBed.OCCUPIED); } + + // Paper start @@ -21,12 +21,12 @@ index c892c0e37bd4f9b208147e2df16fc9ed024eacf7..71df14b932306aa4c8ea6d4883f6ba05 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java -index 66a183fa0af6978dd220a3dde27255ad45e47137..108fbb8ab9142a6f779651f3562a81c6cfaa3c30 100644 +index 2ccf3fbe3f991b7a014cff3bcd424e6a81bc310a..e5450d3511389bf3bd6461fb6ec65ea82e4ae9f0 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java +++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftBed.java @@ -51,4 +51,11 @@ public final class CraftBed extends org.bukkit.craftbukkit.block.data.CraftBlock public java.util.Set getFaces() { - return getValues(CraftBed.FACING, org.bukkit.block.BlockFace.class); + return this.getValues(CraftBed.FACING, org.bukkit.block.BlockFace.class); } + + // Paper start diff --git a/patches/server/0871-Add-fire-tick-delay-option.patch b/patches/server/0871-Add-fire-tick-delay-option.patch index e9a876ed2b..7649d101c9 100644 --- a/patches/server/0871-Add-fire-tick-delay-option.patch +++ b/patches/server/0871-Add-fire-tick-delay-option.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add fire-tick-delay option diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java -index 7f88b910dfd0303f69b4fd1c7918a401c1f369f2..4002e0fffb60556e7af1aeff71b4be244f02b0f5 100644 +index a3021fbc570ae47eb6b0d4a89388c8ed893aced7..2c7847aebabe14da44b9a42f5ecae77858fb9dd3 100644 --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java @@ -165,7 +165,7 @@ public class FireBlock extends BaseFireBlock { @@ -16,7 +16,7 @@ index 7f88b910dfd0303f69b4fd1c7918a401c1f369f2..4002e0fffb60556e7af1aeff71b4be24 + world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world)); // Paper if (world.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { if (!state.canSurvive(world, pos)) { - fireExtinguished(world, pos); // CraftBukkit - invalid place location + this.fireExtinguished(world, pos); // CraftBukkit - invalid place location @@ -366,11 +366,13 @@ public class FireBlock extends BaseFireBlock { public void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, UseOnContext itemActionContext) { super.onPlace(iblockdata, world, blockposition, iblockdata1, flag, itemActionContext); diff --git a/patches/server/0893-Properly-resend-entities.patch b/patches/server/0893-Properly-resend-entities.patch index b24467fe53..14cfb1b688 100644 --- a/patches/server/0893-Properly-resend-entities.patch +++ b/patches/server/0893-Properly-resend-entities.patch @@ -82,20 +82,20 @@ index d088479d160dbd2fc90b48a30553be141db8eef2..15add3f4dfd718ec09bb1db4f2222346 public static class DataItem { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index db5368bf4970c63f21ef1e5fc7428787c90de4dd..9372f2363b13dca1b5ae77a509daaec7fbbf5e4f 100644 +index bfa2e9919275a1eb5d83403c5ed88eee245e3194..c4425cd7357049e74e825b824e30b9691ad93196 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2648,7 +2648,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { -- send(new ClientboundAddEntityPacket(entity)); +- ServerGamePacketListenerImpl.this.send(new ClientboundAddEntityPacket(entity)); + entity.getEntityData().resendPossiblyDesyncedEntity(player); // Paper - The entire mob gets deleted, so resend it. - player.containerMenu.sendAllDataToRemote(); + ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 255f7ab2560e493770bd99a8404f3c122cfca2ad..a56995333931685eecf6ea90ff1a89d38b4a2336 100644 +index ce04374971e679b4883d8a6ebba4c6832b606a65..19a01b59ce3e75a0ed48e8fc7678063576d9a2b0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -357,7 +357,7 @@ public abstract class PlayerList { @@ -122,7 +122,7 @@ index 37596c7b65f280be00e8e59ae18bd1aceae21080..eca18540aeb0b0d4098477d73b14c78a } entity.playSound(((Bucketable) entity).getPickupSound(), 1.0F, 1.0F); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 8733255559e63d8709d2502e58f16decdf1714ae..6759dad436d9e82f9c959e2c183e6e95c37abdcb 100644 +index 53bda7a59a3abf6f99a044df5f2c44bedf1af501..dc1cc4db2195d4f346bdc5f39e2e14dba454f13d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1258,7 +1258,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -139,7 +139,7 @@ index 8733255559e63d8709d2502e58f16decdf1714ae..6759dad436d9e82f9c959e2c183e6e95 private static PermissibleBase getPermissibleBase() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java -index 4dbe8af49fcb4d2c2f517083c013d83f64225b4b..58489a6a34e66cd6fc0d0e28141a3ebc32ac0e05 100644 +index 0801bcdee8fcff0d388d302387e4f1d587e0a283..2fcd9b836d42e3549a3b6b921c57a4c103146dff 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java @@ -39,9 +39,11 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame { diff --git a/patches/server/0903-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0903-Add-missing-SpigotConfig-logCommands-check.patch index 128115cbc3..6234450db8 100644 --- a/patches/server/0903-Add-missing-SpigotConfig-logCommands-check.patch +++ b/patches/server/0903-Add-missing-SpigotConfig-logCommands-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 647069b24b16aaa5f9b77a32932d8b072343331c..cb12c626db3bdc021895cbfb3fab749a0ef5079f 100644 +index 0cd46c761253c197e94b16a78f15110b35b12c12..a6630c0aefb31b4b07b62219e27ce724325d291c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2112,7 +2112,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -16,5 +16,5 @@ index 647069b24b16aaa5f9b77a32932d8b072343331c..cb12c626db3bdc021895cbfb3fab749a ServerGamePacketListenerImpl.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + command); + } // Paper - PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(getCraftPlayer(), command, new LazyPlayerSet(server)); + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getCraftPlayer(), command, new LazyPlayerSet(this.server)); this.cserver.getPluginManager().callEvent(event); diff --git a/patches/server/0927-Fix-beehives-generating-from-using-bonemeal.patch b/patches/server/0927-Fix-beehives-generating-from-using-bonemeal.patch index 5983c5fc9a..ebf4eed61e 100644 --- a/patches/server/0927-Fix-beehives-generating-from-using-bonemeal.patch +++ b/patches/server/0927-Fix-beehives-generating-from-using-bonemeal.patch @@ -17,7 +17,7 @@ index e0e80f94a005fb21cce76059f66cf4c7ee0f2bfc..c73b57ffd622ccc2e6c570cf874ed118 entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java -index e3e06dc0e8dad4a478f3c8a0178cf6feb64b26cb..38ccf1a75b37e7745426706c2ccbe86506b93f51 100644 +index 2aab5ba9e90f09e6d679ee0d0d5d5e52c44b677f..a8760f015b9ee3ee408c3b9220266eb76b313ba0 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java @@ -31,6 +31,12 @@ public final class CapturedBlockState extends CraftBlockState { @@ -31,7 +31,7 @@ index e3e06dc0e8dad4a478f3c8a0178cf6feb64b26cb..38ccf1a75b37e7745426706c2ccbe865 + public void checkTreeBlockHack() { + // Paper end // SPIGOT-5537: Horrible hack to manually add bees given World.captureTreeGeneration does not support tiles - if (this.treeBlock && getType() == Material.BEE_NEST) { + if (this.treeBlock && this.getType() == Material.BEE_NEST) { WorldGenLevel generatoraccessseed = this.world.getHandle(); @@ -53,7 +59,7 @@ public final class CapturedBlockState extends CraftBlockState { // End copied block diff --git a/patches/server/0948-Ignore-inline-definitions-of-trim-material-pattern.patch b/patches/server/0948-Ignore-inline-definitions-of-trim-material-pattern.patch index 9b113e0bfe..2b71534642 100644 --- a/patches/server/0948-Ignore-inline-definitions-of-trim-material-pattern.patch +++ b/patches/server/0948-Ignore-inline-definitions-of-trim-material-pattern.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Ignore inline definitions of trim material & pattern diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java -index 742d4039392403a75882f83bb2f64453898adf76..c92981aedebe934cefa1c96a0328fb91fe17acbc 100644 +index 24b87a1566b48be1367970a9ba887a6b3a785bb9..f393e0844889c967d9e83d9a1e73c134fcb6e33b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java @@ -67,7 +67,7 @@ public class CraftMetaArmor extends CraftMetaItem implements ArmorMeta { - if (tag.contains(TRIM.NBT)) { - CompoundTag trimCompound = tag.getCompound(TRIM.NBT); + if (tag.contains(CraftMetaArmor.TRIM.NBT)) { + CompoundTag trimCompound = tag.getCompound(CraftMetaArmor.TRIM.NBT); -- if (trimCompound.contains(TRIM_MATERIAL.NBT) && trimCompound.contains(TRIM_PATTERN.NBT)) { -+ if (trimCompound.contains(TRIM_MATERIAL.NBT, net.minecraft.nbt.Tag.TAG_STRING) && trimCompound.contains(TRIM_PATTERN.NBT, net.minecraft.nbt.Tag.TAG_STRING)) { // Paper - for now, ignore inline definitions of trim material & pattern - TrimMaterial trimMaterial = Registry.TRIM_MATERIAL.get(NamespacedKey.fromString(trimCompound.getString(TRIM_MATERIAL.NBT))); - TrimPattern trimPattern = Registry.TRIM_PATTERN.get(NamespacedKey.fromString(trimCompound.getString(TRIM_PATTERN.NBT))); +- if (trimCompound.contains(CraftMetaArmor.TRIM_MATERIAL.NBT) && trimCompound.contains(CraftMetaArmor.TRIM_PATTERN.NBT)) { ++ if (trimCompound.contains(CraftMetaArmor.TRIM_MATERIAL.NBT, net.minecraft.nbt.Tag.TAG_STRING) && trimCompound.contains(CraftMetaArmor.TRIM_PATTERN.NBT, net.minecraft.nbt.Tag.TAG_STRING)) { // Paper - for now, ignore inline definitions of trim material & pattern + TrimMaterial trimMaterial = Registry.TRIM_MATERIAL.get(NamespacedKey.fromString(trimCompound.getString(CraftMetaArmor.TRIM_MATERIAL.NBT))); + TrimPattern trimPattern = Registry.TRIM_PATTERN.get(NamespacedKey.fromString(trimCompound.getString(CraftMetaArmor.TRIM_PATTERN.NBT))); diff --git a/patches/server/0950-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/0950-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch index 2c692b14f6..efa2da58fc 100644 --- a/patches/server/0950-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch +++ b/patches/server/0950-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch @@ -5,16 +5,16 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 34bde8263dd0f3eeae81d896e2d328d276353e7a..b159ada5e593ee4e8e0059eb5cb554c723231e88 100644 +index 2384ad530ce9c8329e378e7488701df7c2f389fb..a2a2260f52032c50d57c2031b41d05f052394866 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -359,7 +359,11 @@ public final class CraftServer implements Server { } this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile()); this.commandsConfiguration.options().copyDefaults(true); -- this.commandsConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8))); +- this.commandsConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8))); + // Paper start - don't enforce icanhasbukkit default if alias block exists -+ final YamlConfiguration commandsDefaults = YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8)); ++ final YamlConfiguration commandsDefaults = YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8)); + if (this.commandsConfiguration.contains("aliases")) commandsDefaults.set("aliases", null); + this.commandsConfiguration.setDefaults(commandsDefaults); + // Paper stop - dont enforce icanhasbukkit default if alias block exists diff --git a/patches/server/0952-Fix-sniffer-removeExploredLocation.patch b/patches/server/0952-Fix-sniffer-removeExploredLocation.patch index ca06cc2a5e..e8b1703090 100644 --- a/patches/server/0952-Fix-sniffer-removeExploredLocation.patch +++ b/patches/server/0952-Fix-sniffer-removeExploredLocation.patch @@ -6,14 +6,14 @@ Subject: [PATCH] Fix sniffer removeExploredLocation Add support to remove explored location in different world diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java -index 1c8b67de03aefe91bf80782fb14fb629a458ecc3..01328768ef2baba2aa7fea7e10b0eb9783497f4b 100644 +index 60251107371ef876d29fc9aa578835250715c4bc..555337018fe218ac5a296a5e6a1d82720fee05e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java @@ -34,12 +34,13 @@ public class CraftSniffer extends CraftAnimals implements Sniffer { @Override public void removeExploredLocation(Location location) { Preconditions.checkArgument(location != null, "location cannot be null"); -- if (location.getWorld() != getWorld()) { +- if (location.getWorld() != this.getWorld()) { - return; - } diff --git a/patches/server/0967-Suppress-Item-Meta-Validation-Checks.patch b/patches/server/0967-Suppress-Item-Meta-Validation-Checks.patch index 531096371c..4e1d19bbf6 100644 --- a/patches/server/0967-Suppress-Item-Meta-Validation-Checks.patch +++ b/patches/server/0967-Suppress-Item-Meta-Validation-Checks.patch @@ -6,15 +6,15 @@ Subject: [PATCH] Suppress Item Meta Validation Checks In some cases ItemMeta could validate tags in an ItemStack. This suppresses those warnings and ignores reading the value. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java -index c92981aedebe934cefa1c96a0328fb91fe17acbc..80138632e5216c71fe7060a59dbb2915e740a3c8 100644 +index f393e0844889c967d9e83d9a1e73c134fcb6e33b..f8996ee643a46db301577f6c523f24e973e8f309 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java @@ -68,13 +68,33 @@ public class CraftMetaArmor extends CraftMetaItem implements ArmorMeta { - CompoundTag trimCompound = tag.getCompound(TRIM.NBT); + CompoundTag trimCompound = tag.getCompound(CraftMetaArmor.TRIM.NBT); - if (trimCompound.contains(TRIM_MATERIAL.NBT, net.minecraft.nbt.Tag.TAG_STRING) && trimCompound.contains(TRIM_PATTERN.NBT, net.minecraft.nbt.Tag.TAG_STRING)) { // Paper - for now, ignore inline definitions of trim material & pattern -- TrimMaterial trimMaterial = Registry.TRIM_MATERIAL.get(NamespacedKey.fromString(trimCompound.getString(TRIM_MATERIAL.NBT))); -- TrimPattern trimPattern = Registry.TRIM_PATTERN.get(NamespacedKey.fromString(trimCompound.getString(TRIM_PATTERN.NBT))); + if (trimCompound.contains(CraftMetaArmor.TRIM_MATERIAL.NBT, net.minecraft.nbt.Tag.TAG_STRING) && trimCompound.contains(CraftMetaArmor.TRIM_PATTERN.NBT, net.minecraft.nbt.Tag.TAG_STRING)) { // Paper - for now, ignore inline definitions of trim material & pattern +- TrimMaterial trimMaterial = Registry.TRIM_MATERIAL.get(NamespacedKey.fromString(trimCompound.getString(CraftMetaArmor.TRIM_MATERIAL.NBT))); +- TrimPattern trimPattern = Registry.TRIM_PATTERN.get(NamespacedKey.fromString(trimCompound.getString(CraftMetaArmor.TRIM_PATTERN.NBT))); + // Paper start + TrimMaterial trimMaterial = getRegistry(Registry.TRIM_MATERIAL, trimCompound.getString(TRIM_MATERIAL.NBT)); + TrimPattern trimPattern = getRegistry(Registry.TRIM_PATTERN, trimCompound.getString(TRIM_PATTERN.NBT)); @@ -47,7 +47,7 @@ index c92981aedebe934cefa1c96a0328fb91fe17acbc..80138632e5216c71fe7060a59dbb2915 CraftMetaArmor(Map map) { super(map); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index f79ea76c0127b7b57ab0511afbed626a3b42fd05..3cea851c3f5389a5dd92601dfbef2975b2a5948b 100644 +index f6d2785b05b4c0a4393be706a90d7cc4388399bf..2510297df2f6ca80672c1dcbd35c0b1e0ce18ccb 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -489,7 +489,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -67,7 +67,7 @@ index f79ea76c0127b7b57ab0511afbed626a3b42fd05..3cea851c3f5389a5dd92601dfbef2975 continue; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 954768f5f04a583e343b826e832e76cba189af95..c6340b7259242f44a9a681bff2ec46cc633eada3 100644 +index 6398f31a29fdab0f6539139a09336b10d6d11d95..7e85f896dc243b2811ea87df759dffa9b6f495b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -71,11 +71,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { @@ -75,12 +75,12 @@ index 954768f5f04a583e343b826e832e76cba189af95..c6340b7259242f44a9a681bff2ec46cc super(tag); + try { // Paper - Ignore invalid game profiles - if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) { - this.setProfile(NbtUtils.readGameProfile(tag.getCompound(SKULL_OWNER.NBT))); - } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !tag.getString(SKULL_OWNER.NBT).isEmpty()) { - this.setProfile(new GameProfile(Util.NIL_UUID, tag.getString(SKULL_OWNER.NBT))); + if (tag.contains(CraftMetaSkull.SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) { + this.setProfile(NbtUtils.readGameProfile(tag.getCompound(CraftMetaSkull.SKULL_OWNER.NBT))); + } else if (tag.contains(CraftMetaSkull.SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !tag.getString(CraftMetaSkull.SKULL_OWNER.NBT).isEmpty()) { + this.setProfile(new GameProfile(Util.NIL_UUID, tag.getString(CraftMetaSkull.SKULL_OWNER.NBT))); } + } catch (Exception ignored) {} // Paper - if (tag.contains(BLOCK_ENTITY_TAG.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) { - CompoundTag nbtTagCompound = tag.getCompound(BLOCK_ENTITY_TAG.NBT).copy(); + if (tag.contains(CraftMetaSkull.BLOCK_ENTITY_TAG.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) { + CompoundTag nbtTagCompound = tag.getCompound(CraftMetaSkull.BLOCK_ENTITY_TAG.NBT).copy(); diff --git a/patches/server/0968-Fix-BanList-API.patch b/patches/server/0968-Fix-BanList-API.patch index ce35d7f74b..4dbd085a1a 100644 --- a/patches/server/0968-Fix-BanList-API.patch +++ b/patches/server/0968-Fix-BanList-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix BanList API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 3762230eeee47114f683dfa428a8e55cf2f42b48..fda82c7c3b7e28b6d3ed4b28c956a069a975c22c 100644 +index 9e01ef76bc6d18ab622fbec729f8bde3aa8d3e41..f9b2d773449fa5d332e0c37454ba6ea731982e85 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -114,17 +114,17 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -208,7 +208,7 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 77ea396950ed23ab5bf953b451b12d5b1eb4c5ec..0ab1bbb44bb483a73dbb4763d785d74a5c6ced3a 100644 +index 2981475368094b7749cfec2e5a99ec0947248eee..1be276757f241d17f2d24f35df15c5d9cdaaa10c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1635,23 +1635,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -234,9 +234,9 @@ index 77ea396950ed23ab5bf953b451b12d5b1eb4c5ec..0ab1bbb44bb483a73dbb4763d785d74a @Override - public BanEntry ban(String reason, Date expires, String source, boolean kickPlayer) { -- BanEntry banEntry = ((ProfileBanList) server.getBanList(BanList.Type.PROFILE)).addBan(this.getPlayerProfile(), reason, expires, source); +- BanEntry banEntry = ((ProfileBanList) this.server.getBanList(BanList.Type.PROFILE)).addBan(this.getPlayerProfile(), reason, expires, source); + public BanEntry ban(String reason, Date expires, String source, boolean kickPlayer) { // Paper - fix ban list API -+ BanEntry banEntry = ((ProfileBanList) server.getBanList(BanList.Type.PROFILE)).addBan(this.getPlayerProfile(), reason, expires, source); // Paper - fix ban list API ++ BanEntry banEntry = ((ProfileBanList) this.server.getBanList(BanList.Type.PROFILE)).addBan(this.getPlayerProfile(), reason, expires, source); // Paper - fix ban list API if (kickPlayer) { this.kickPlayer(reason); } @@ -256,7 +256,7 @@ index 77ea396950ed23ab5bf953b451b12d5b1eb4c5ec..0ab1bbb44bb483a73dbb4763d785d74a } diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java -index 2d877acc4cb338193449ae37cafb0cfdc452d6b0..51a6e84198f5b95488e8c757951ba14be4c55625 100644 +index 533d143969592f9a4f4d1ea1660474264150f211..c08006a010606fac5d290889a3ad9fdf9008ee72 100644 --- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java +++ b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java @@ -31,7 +31,7 @@ import org.bukkit.profile.PlayerProfile; diff --git a/patches/server/0979-API-for-updating-recipes-on-clients.patch b/patches/server/0979-API-for-updating-recipes-on-clients.patch index 04d5f1fbce..2e98d04389 100644 --- a/patches/server/0979-API-for-updating-recipes-on-clients.patch +++ b/patches/server/0979-API-for-updating-recipes-on-clients.patch @@ -5,7 +5,7 @@ Subject: [PATCH] API for updating recipes on clients diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 4b3a121e8443aa0e0e7cd26806e7d5b00ddf59af..468231acdf3bb3d8e92be5636b5a32a103709cd1 100644 +index 46433978ab9fee1602b169aaf7982c849c4bd53f..4e7141968d88ca3fbb9cceaadbef60fed0ce64eb 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1518,6 +1518,13 @@ public abstract class PlayerList { @@ -39,11 +39,11 @@ index 4b3a121e8443aa0e0e7cd26806e7d5b00ddf59af..468231acdf3bb3d8e92be5636b5a32a1 Iterator iterator1 = this.players.iterator(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4794cea2353c47bd57c86e37beb1164629791211..a97136b944991bc93d7e33a375cfae717ea86220 100644 +index e3f776c909c2d4ea4311ea98dad8476b7da1f44e..7b8f4eac4b7361415695170beae50465d6605a22 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1131,6 +1131,18 @@ public final class CraftServer implements Server { - ReloadCommand.reload(console); + ReloadCommand.reload(this.console); } + // Paper start diff --git a/patches/server/1009-Implement-OfflinePlayer-isConnected.patch b/patches/server/1009-Implement-OfflinePlayer-isConnected.patch index 94f7e36a61..2cf0e8deb5 100644 --- a/patches/server/1009-Implement-OfflinePlayer-isConnected.patch +++ b/patches/server/1009-Implement-OfflinePlayer-isConnected.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement OfflinePlayer#isConnected diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index fda82c7c3b7e28b6d3ed4b28c956a069a975c22c..03fc90a470c0f63d44161843cac88bea09166858 100644 +index f9b2d773449fa5d332e0c37454ba6ea731982e85..bb794638a990488afc8d9d245dd203269c2b38b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -53,6 +53,13 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -23,11 +23,11 @@ index fda82c7c3b7e28b6d3ed4b28c956a069a975c22c..03fc90a470c0f63d44161843cac88bea public String getName() { Player player = this.getPlayer(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c961d30098b614b2c90e460dc142d5e950b3d6d4..604ed1f6742a6b028b9db2809f7bd4b9a3b38f4d 100644 +index dfa1f48b6d61c6644a02adbd5a5183f917a2982c..57229748ae446d70dbc3d71219d9f81f5c8f72b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -274,6 +274,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - return server.getPlayer(getUniqueId()) != null; + return this.server.getPlayer(this.getUniqueId()) != null; } + // Paper start diff --git a/patches/server/1036-Make-setVelocity-method-of-Fireballs-change-the-trav.patch b/patches/server/1036-Make-setVelocity-method-of-Fireballs-change-the-trav.patch index cd09cdff35..b36b8cf1f6 100644 --- a/patches/server/1036-Make-setVelocity-method-of-Fireballs-change-the-trav.patch +++ b/patches/server/1036-Make-setVelocity-method-of-Fireballs-change-the-trav.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Make setVelocity method of Fireballs change the travel diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -index e04500dcdc5b72cca7ac81b5d12e76822db9c8c5..22d59ca52229dc566b8dfb460b92ecd6318e6db0 100644 +index 2783e218d5e5c24787429237974e196761f4d02b..774ed1fdc909c911bf93a1b720285b43e9f728b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java @@ -46,6 +46,18 @@ public class CraftFireball extends AbstractProjectile implements Fireball { - update(); // SPIGOT-6579 + this.update(); // SPIGOT-6579 } + // Paper start - set direction without normalizing @@ -27,4 +27,4 @@ index e04500dcdc5b72cca7ac81b5d12e76822db9c8c5..22d59ca52229dc566b8dfb460b92ecd6 + @Override public AbstractHurtingProjectile getHandle() { - return (AbstractHurtingProjectile) entity; + return (AbstractHurtingProjectile) this.entity; diff --git a/patches/server/1039-Fix-NPE-in-SculkBloomEvent-world-access.patch b/patches/server/1039-Fix-NPE-in-SculkBloomEvent-world-access.patch index 9a68942690..f4db24ce29 100644 --- a/patches/server/1039-Fix-NPE-in-SculkBloomEvent-world-access.patch +++ b/patches/server/1039-Fix-NPE-in-SculkBloomEvent-world-access.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Fix NPE in SculkBloomEvent world access diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java -index 9ca735d77db051dade99f27bfa2d86a6043c76d5..65112ec3a6ea1c27f032477720ae74395523012b 100644 +index ccb1db9649dfded891b308c346a6aeb870b61ce2..65112ec3a6ea1c27f032477720ae74395523012b 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java @@ -32,9 +32,16 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi public SculkCatalystBlockEntity(BlockPos pos, BlockState state) { super(BlockEntityType.SCULK_CATALYST, pos, state); this.catalystListener = new SculkCatalystBlockEntity.CatalystListener(state, new BlockPositionSource(pos)); -- catalystListener.level = level; // CraftBukkit +- this.catalystListener.level = this.level; // CraftBukkit } + // Paper start