From 21ae8ff67eb6b00de02f8e41290c0c22e5b44399 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 17 Dec 2018 05:18:06 +0000 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses CraftBukkit Changes: 38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks 6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses c64fe508 Mappings Update a3c2ec03 Fix missing ServerListPingEvent call for legacy pings Spigot Changes: 1dc156ce Rebuild patches 140f654d Mappings Update --- Spigot-API-Patches/Add-more-Zombie-API.patch | 10 +- .../Ability-to-apply-mending-to-XP-API.patch | 19 +- .../Activation-Range-Improvements.patch | 24 +- ...ies-option-to-debug-dupe-uuid-issues.patch | 6 +- .../Add-EntityZapEvent.patch | 6 +- .../Add-PhantomPreSpawnEvent.patch | 2 +- .../Add-PlayerConnectionCloseEvent.patch | 10 +- .../Add-ProjectileCollideEvent.patch | 4 +- .../Add-Velocity-IP-Forwarding-Support.patch | 12 +- .../Add-World-Util-Methods.patch | 6 +- ...-to-configure-frosted_ice-properties.patch | 12 +- ...n-option-to-prevent-player-names-fro.patch | 2 +- .../Add-exception-reporting-event.patch | 28 +- ...ent-to-allow-plugins-to-handle-clien.patch | 4 +- .../Add-more-Witch-API.patch | 4 +- .../Add-more-Zombie-API.patch | 16 +- .../Add-player-view-distance-API.patch | 14 +- ...setting-for-proxy-online-mode-status.patch | 6 +- ...dd-some-Debug-to-Chunk-Entity-slices.patch | 10 +- .../Add-source-to-PlayerExpChangeEvent.patch | 4 +- .../Allow-Reloading-of-Command-Aliases.patch | 2 +- ...llow-Reloading-of-Custom-Permissions.patch | 2 +- ...rocess-chunk-removal-in-removeEntity.patch | 6 +- Spigot-Server-Patches/Anti-Xray.patch | 24 +- .../Async-Chunk-Loading-and-Generation.patch | 137 +++---- .../AsyncTabCompleteEvent.patch | 4 +- .../Auto-Save-Improvements.patch | 24 +- ...ups-for-Entity-TileEntity-Current-Ch.patch | 14 +- ...opper-searches-if-there-are-no-items.patch | 6 +- .../Basic-PlayerProfile-API.patch | 6 +- ...player-logins-during-server-shutdown.patch | 4 +- ...nd-make-tab-spam-limits-configurable.patch | 4 +- .../Cache-World-Entity-Type-counts.patch | 4 +- ...ServerListPingEvent-for-legacy-pings.patch | 88 ++--- .../Call-player-spectator-target-events.patch | 23 +- ...atch-Async-PlayerChunkMap-operations.patch | 2 +- ...entation-of-tile-entity-removal-list.patch | 6 +- ...owned-for-Villager-Aggression-Config.patch | 11 +- .../Chunk-Save-Reattempt.patch | 6 +- .../Chunk-Save-Stats-Debug-Option.patch | 6 +- .../Chunk-registration-fixes.patch | 4 +- ...figurable-Cartographer-Treasure-Maps.patch | 2 +- .../Configurable-Chunk-Inhabited-Time.patch | 2 +- ...urable-Chunks-Sends-per-Tick-setting.patch | 2 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 10 +- ...Configurable-Max-Chunk-Gens-per-Tick.patch | 24 +- .../Configurable-Player-Collision.patch | 10 +- .../Configurable-end-credits.patch | 10 +- ...le-speed-for-water-flowing-over-lava.patch | 12 +- ...nfigurable-top-of-nether-void-damage.patch | 6 +- ...unk-Unloads-based-on-Player-Movement.patch | 57 ++- ...oreboards-for-non-players-by-default.patch | 8 +- .../Disable-Vanilla-Chunk-GC.patch | 2 +- .../Disable-ice-and-snow.patch | 6 +- .../Disable-spigot-tick-limiters.patch | 2 +- .../Do-not-load-chunks-for-Pathfinding.patch | 14 +- ...t-recheck-type-after-setting-a-block.patch | 2 +- ...-after-profile-lookups-if-not-needed.patch | 26 +- ...am-reload-spawn-chunks-in-nether-end.patch | 4 +- .../Duplicate-UUID-Resolve-Option.patch | 14 +- .../Enforce-Sync-Chunk-Unloads.patch | 6 +- ...Entity-AddTo-RemoveFrom-World-Events.patch | 2 +- Spigot-Server-Patches/Entity-Origin-API.patch | 10 +- .../Entity-add-to-world-fixes.patch | 26 +- .../EntityPathfindEvent.patch | 6 +- ...ld.spawnParticle-API-and-add-Builder.patch | 4 +- .../ExperienceOrbMergeEvent.patch | 12 +- .../Expose-server-CommandMap.patch | 2 +- ...Fire-EntityCombustEvent-for-phantoms.patch | 6 +- .../Fix-Double-World-Add-issues.patch | 12 +- .../Fix-MC-117075-TE-Unload-Lag-Spike.patch | 4 +- .../Fix-Sending-Chunks-to-Client.patch | 10 +- .../Fix-SpongeAbsortEvent-handling.patch | 27 +- ...h-entity-loss-due-to-unloaded-chunks.patch | 4 +- ...-explosions-processing-dead-entities.patch | 10 +- .../Further-improve-server-tick-loop.patch | 12 +- ...aving-disabled-before-unloading-all-.patch | 4 +- ...e-Large-Packets-disconnecting-client.patch | 13 +- ...ead-Entities-in-entityList-iteration.patch | 6 +- ...nt-extended-PaperServerListPingEvent.patch | 25 +- ...item-frames-performance-and-bug-fixe.patch | 12 +- ...leHitEvent-to-include-the-BlockFace-.patch | 2 +- .../Improve-death-events.patch | 15 +- .../InventoryCloseEvent-Reason-API.patch | 12 +- Spigot-Server-Patches/Lighting-Queue.patch | 32 +- ...mit-lightning-strike-effect-distance.patch | 2 +- ...d-load-entity-AABB-to-prevent-wobble.patch | 2 +- Spigot-Server-Patches/MC-Dev-fixes.patch | 350 ++++++++++++------ Spigot-Server-Patches/MC-Utils.patch | 73 ++-- ...loadChunk-int-int-false-load-unconve.patch | 6 +- ...ke-legacy-ping-handler-more-reliable.patch | 44 +-- ...portation-adjustment-math-more-accur.patch | 6 +- ...ault-permission-message-configurable.patch | 2 +- ...-anytime-entities-change-to-guarante.patch | 4 +- .../Optimise-removeQueue.patch | 6 +- .../Optimize-Chunk-Access.patch | 8 +- Spigot-Server-Patches/Optimize-Hoppers.patch | 8 +- .../Optimize-Light-Recalculations.patch | 4 +- .../Optimize-Server-World-Map.patch | 4 +- .../Optimize-UserCache-Thread-Safe.patch | 6 +- .../Optimize-and-Fix-ExpiringMap-Issues.patch | 18 +- .../Optimize-explosions.patch | 12 +- ...Optimize-getChunkIfLoaded-type-calls.patch | 12 +- ...Location-getType-and-getBlockData-fo.patch | 8 +- .../Optimize-redstone-algorithm.patch | 4 +- ...-maximum-exp-value-when-merging-orbs.patch | 18 +- ...sable-BlockPhysicsEvent-for-Redstone.patch | 6 +- ...t-armor-stands-from-doing-entity-loo.patch | 2 +- ...tion-to-remove-corrupt-tile-entities.patch | 2 +- ...nilla-per-world-scoreboard-coloring-.patch | 18 +- .../Optional-TNT-doesn-t-move-in-water.patch | 2 +- .../Paper-config-files.patch | 20 +- .../Player-affects-spawning-API.patch | 6 +- .../PlayerPickupExperienceEvent.patch | 4 +- ...vent-Auto-Save-if-Save-Queue-is-full.patch | 6 +- ...sted-Ice-from-loading-holding-chunks.patch | 8 +- ...event-tile-entity-and-entity-crashes.patch | 8 +- ...le-async-calls-to-restart-the-server.patch | 16 +- ...emove-entities-on-dimension-teleport.patch | 6 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 4 +- ...o-use-a-versioned-world-folder-for-t.patch | 8 +- ...nilla-entity-warnings-for-duplicates.patch | 2 +- ...ve-invalid-mob-spawner-tile-entities.patch | 2 +- ...Remove-unused-World-Tile-Entity-List.patch | 2 +- .../Reset-players-airTicks-on-respawn.patch | 4 +- ...egionFileCache-and-make-configurable.patch | 22 +- ...ets-from-world-player-list-not-serve.patch | 8 +- .../Speedup-BlockPos-by-fixing-inlining.patch | 6 +- ...ts-for-each-Entity-Block-Entity-Type.patch | 2 +- ...to-current-Chunk-for-Entity-and-Bloc.patch | 14 +- Spigot-Server-Patches/Timings-v2.patch | 139 ++++--- Spigot-Server-Patches/Turtle-API.patch | 2 +- ...ed-flag-on-cancel-of-Explosion-Event.patch | 4 +- .../Use-EntityTypes-for-living-entities.patch | 62 ++-- ...oleAppender-for-console-improvements.patch | 8 +- .../Use-a-Queue-for-Queueing-Commands.patch | 8 +- .../Vanished-players-don-t-have-rights.patch | 6 +- ...rld-EntityHuman-Lookup-Optimizations.patch | 4 +- ...-more-information-to-Entity.toString.patch | 2 +- .../getPlayerUniqueId-API.patch | 2 +- .../handle-PacketPlayInKeepAlive-async.patch | 8 +- ...at-which-we-ll-consider-an-attackabl.patch | 2 +- ...urable-option-to-disable-creeper-lin.patch | 4 +- ...rt-serverside-behavior-of-keepalives.patch | 24 +- scripts/decompile.sh | 2 +- scripts/remap.sh | 6 +- work/BuildData | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 150 files changed, 1096 insertions(+), 1039 deletions(-) diff --git a/Spigot-API-Patches/Add-more-Zombie-API.patch b/Spigot-API-Patches/Add-more-Zombie-API.patch index f3bd5e56ae..e6ba3f7f7b 100644 --- a/Spigot-API-Patches/Add-more-Zombie-API.patch +++ b/Spigot-API-Patches/Add-more-Zombie-API.patch @@ -5,14 +5,13 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index 62923379..a6894903 100644 +index 48034198..615dd990 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java @@ -0,0 +0,0 @@ public interface Zombie extends Monster { + * @param time new conversion time */ - @Deprecated - public Villager.Profession getVillagerProfession(); -+ + void setConversionTime(int time); + // Paper start + /** + * Check if zombie is drowning @@ -25,7 +24,10 @@ index 62923379..a6894903 100644 + * Make zombie start drowning + * + * @param drownedConversionTime Amount of time until zombie converts from drowning ++ * ++ * @deprecated See {@link #setConversionTime(int)} + */ ++ @Deprecated + void startDrowning(int drownedConversionTime); + + /** diff --git a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch index 80af0ec39c..aeda380f07 100644 --- a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch @@ -10,32 +10,19 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index fd6df39f1..f03aef2fe 100644 +index e1ea8da88..f1921e151 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -0,0 +0,0 @@ public class EnchantmentManager { - return getEnchantmentLevel(Enchantments.F, itemstack) > 0; + return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0; } + public static ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { return b(enchantment, entityliving); } // Paper - OBFHELPER public static ItemStack b(Enchantment enchantment, EntityLiving entityliving) { List list = enchantment.a(entityliving);// Paper - decompile fix if (list.isEmpty()) { -diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java -index 8cfb38b82..44b2d428b 100644 ---- a/src/main/java/net/minecraft/server/Enchantments.java -+++ b/src/main/java/net/minecraft/server/Enchantments.java -@@ -0,0 +0,0 @@ public class Enchantments { - public static final Enchantment D = a("impaling"); - public static final Enchantment E = a("riptide"); - public static final Enchantment F = a("channeling"); -- public static final Enchantment G = a("mending"); -+ public static final Enchantment G = a("mending");public static final Enchantment MENDING = G; // Paper - OBFHELPER - public static final Enchantment H = a("vanishing_curse"); - - @Nullable diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 73205b2f7..69d4dc9ab 100644 +index 4bcae2c21..09d85764b 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/Activation-Range-Improvements.patch b/Spigot-Server-Patches/Activation-Range-Improvements.patch index d5f549f844..6b477640a5 100644 --- a/Spigot-Server-Patches/Activation-Range-Improvements.patch +++ b/Spigot-Server-Patches/Activation-Range-Improvements.patch @@ -10,7 +10,7 @@ Fixes and adds new Immunities to improve gameplay behavior Adds water Mobs to activation range config and nerfs fish diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index d81e2dc1c5..7bd51b3578 100644 +index c9019260b..e980e31fc 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { @@ -22,7 +22,7 @@ index d81e2dc1c5..7bd51b3578 100644 return new BlockPosition(this); } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e7f9e490bf..68ceee5f08 100644 +index 69645d517..9682b0a01 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -34,7 +34,7 @@ index e7f9e490bf..68ceee5f08 100644 if (i != this.aM) { diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index 20b7c2c6dc..d659c57dbe 100644 +index 20b7c2c6d..d659c57db 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -46,7 +46,7 @@ index 20b7c2c6dc..d659c57dbe 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index c87304d477..41a4962e94 100644 +index ac250182b..06bb8cf1f 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -68,7 +68,7 @@ index c87304d477..41a4962e94 100644 return this.moveController; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 334580a8b7..b2b575d0e8 100644 +index 95af2d529..162de836e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -77,11 +77,11 @@ index 334580a8b7..b2b575d0e8 100644 public EntityHuman killer; - protected int lastDamageByPlayerTime; + public int lastDamageByPlayerTime; // Paper - public - protected boolean aX; + protected boolean killed; protected int ticksFarFromPlayer; protected float aZ; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index c66d8b68f0..774e4d6414 100644 +index 9c48bb3c9..22cea8552 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn @@ -93,7 +93,7 @@ index c66d8b68f0..774e4d6414 100644 return this.bQ != null; } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index acc099e955..339c78eec9 100644 +index acc099e95..339c78eec 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -0,0 +0,0 @@ public abstract class PathfinderGoal { @@ -107,7 +107,7 @@ index acc099e955..339c78eec9 100644 public void e() { } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java -index 9a75cb63ba..cf10605aaa 100644 +index 9a75cb63b..cf10605aa 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java @@ -0,0 +0,0 @@ @@ -148,7 +148,7 @@ index 9a75cb63ba..cf10605aaa 100644 } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -index be3a3c82ee..1404b629d5 100644 +index ae21eb84d..8f35f71f8 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -187,7 +187,7 @@ index be3a3c82ee..1404b629d5 100644 Iterator iterator = this.b.iterator(); diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 09df00e94b..d08ef3fe10 100644 +index 09df00e94..d08ef3fe1 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -0,0 +0,0 @@ package org.spigotmc; @@ -385,7 +385,7 @@ index 09df00e94b..d08ef3fe10 100644 { isActive = false; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 87bc8e2d9c..06d84a0b66 100644 +index 87bc8e2d9..06d84a0b6 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -0,0 +0,0 @@ public class SpigotWorldConfig diff --git a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 2d7c37cd4c..da953f8fc3 100644 --- a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 173712659..a402f71a9 100644 +index 9f1610326..1581edc4a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,7 +18,7 @@ index 173712659..a402f71a9 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 980f373b1..29c3a24f2 100644 +index 7711b2eff..67ef109a5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -30,7 +30,7 @@ index 980f373b1..29c3a24f2 100644 public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a07077397..0bb903aab 100644 +index 45851cd0c..f37e85eb0 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Add-EntityZapEvent.patch b/Spigot-Server-Patches/Add-EntityZapEvent.patch index 964d864ae2..aaf39ffdaf 100644 --- a/Spigot-Server-Patches/Add-EntityZapEvent.patch +++ b/Spigot-Server-Patches/Add-EntityZapEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index d299e1efb..30306256a 100644 +index 7ef67350a..9dc2d8be2 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -0,0 +0,0 @@ public class EntityPig extends EntityAnimal { @@ -22,7 +22,7 @@ index d299e1efb..30306256a 100644 if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { return; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 36ca76bc8..928c5eb41 100644 +index d2572b3e1..ddf170180 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -39,7 +39,7 @@ index 36ca76bc8..928c5eb41 100644 entitywitch.prepare(this.world.getDamageScaler(new BlockPosition(entitywitch)), (GroupDataEntity) null, (NBTTagCompound) null); entitywitch.setNoAI(this.isNoAI()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index c2b24f99f..1b82f22f8 100644 +index 35992c4ba..075e6f04e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch index 6db47fa314..3e54eec143 100644 --- a/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch +++ b/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 3c5785733..8332d5cc8 100644 +index 60cb6f583..7a48719c9 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java @@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster { diff --git a/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch index 15e3a2e379..cdce5df4d3 100644 --- a/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch @@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 4df31c828..78ea9ad18 100644 +index 95d34fbfe..d20545bad 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -50,7 +50,7 @@ index 4df31c828..78ea9ad18 100644 private SecretKey loginKey; private EntityPlayer l; diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 2f887932b..1e5dfd3f7 100644 +index 065bede4c..21e92b921 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ import io.netty.handler.timeout.TimeoutException; @@ -64,14 +64,14 @@ index 2f887932b..1e5dfd3f7 100644 @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0])); } - this.i.clear(); // Free up packet queue. + this.packetQueue.clear(); // Free up packet queue. + // Paper start - Add PlayerConnectionCloseEvent + final PacketListener packetListener = this.i(); + if (packetListener instanceof PlayerConnection) { + /* Player was logged in */ + final PlayerConnection playerConnection = (PlayerConnection) packetListener; + new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(playerConnection.player.uniqueID, -+ playerConnection.player.getName(), ((java.net.InetSocketAddress)l).getAddress(), false).callEvent(); ++ playerConnection.player.getName(), ((java.net.InetSocketAddress)socketAddress).getAddress(), false).callEvent(); + } else if (packetListener instanceof LoginListener) { + /* Player is login stage */ + final LoginListener loginListener = (LoginListener) packetListener; @@ -81,7 +81,7 @@ index 2f887932b..1e5dfd3f7 100644 + case ACCEPTED: + final com.mojang.authlib.GameProfile profile = loginListener.getGameProfile(); /* Should be non-null at this stage */ + new com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent(profile.getId(), profile.getName(), -+ ((java.net.InetSocketAddress)l).getAddress(), false).callEvent(); ++ ((java.net.InetSocketAddress)socketAddress).getAddress(), false).callEvent(); + } + } + // Paper end diff --git a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch index c8fc269205..728698e970 100644 --- a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch @@ -46,7 +46,7 @@ index 3e3619d79..58cc4824c 100644 this.a(movingobjectposition); diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index ddd77583c..84a9375db 100644 +index cffb40efb..45a326779 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { @@ -87,7 +87,7 @@ index 11638221b..431afaf2f 100644 if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.getBlockPosition()).getBlock() == Blocks.NETHER_PORTAL) { this.e(movingobjectposition.getBlockPosition()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index af61d99bc..8d12155c3 100644 +index 2a06cbf85..464c5cfc9 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch index f4985ac1e2..7a4f5866e1 100644 --- a/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch @@ -127,7 +127,7 @@ index 000000000..fdd8708f9 + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 58a2f3d28..4df31c828 100644 +index 64d2b8aec..95d34fbfe 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -203,18 +203,18 @@ index 58a2f3d28..4df31c828 100644 } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index b2afec5e4..97a9dffe6 100644 +index e5cc77c6d..120416b30 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); public Channel channel; - // Spigot Start // PAIL -- public SocketAddress l; -+ public SocketAddress l; public void setSpoofedRemoteAddress(SocketAddress address) { this.l = address; } // Paper - OBFHELPER +- public SocketAddress socketAddress; ++ public SocketAddress socketAddress; public void setSpoofedRemoteAddress(SocketAddress address) { this.socketAddress = address; } // Paper - OBFHELPER + // Spigot Start public java.util.UUID spoofedUUID; public com.mojang.authlib.properties.Property[] spoofedProfile; - public boolean preparing = true; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java index b95836d44..621aad150 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java diff --git a/Spigot-Server-Patches/Add-World-Util-Methods.patch b/Spigot-Server-Patches/Add-World-Util-Methods.patch index f2b18b000b..51e698bae3 100644 --- a/Spigot-Server-Patches/Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/Add-World-Util-Methods.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 37bea8dbe..eca041265 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.a(blockposition, i, this.world.o().g()); } diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index f5c56de0c..9b972e65d 100644 --- a/src/main/java/net/minecraft/server/IWorldReader.java +++ b/src/main/java/net/minecraft/server/IWorldReader.java @@ -0,0 +0,0 @@ public interface IWorldReader extends IBlockAccess { @@ -54,7 +54,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 }; Stream stream = StreamSupport.stream(BlockPosition.MutableBlockPosition.b(i, k, i1, j - 1, l - 1, j1 - 1).spliterator(), false).map((blockposition$mutableblockposition) -> { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 0e70a3d68..4093d3486 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch index 81c74ba501..ba2b0a0742 100644 --- a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch @@ -24,7 +24,7 @@ index 973ea8bca..7c7d5595a 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index af6c744ad..7bea86f52 100644 +index 1100073f3..598621fbb 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { @@ -35,18 +35,18 @@ index af6c744ad..7bea86f52 100644 if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - iblockdata.get(a) - iblockdata.b(world, blockposition) && this.c(iblockdata, world, blockposition)) { try (BlockPosition.b blockposition$b = BlockPosition.b.r()) { for(EnumDirection enumdirection : EnumDirection.values()) { - blockposition$b.j(blockposition).d(enumdirection); + blockposition$b.g(blockposition).c(enumdirection); IBlockData iblockdata1 = world.getType(blockposition$b); if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) { -- world.J().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40)); -+ world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay +- world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, 20, 40)); ++ world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } } } } else { -- world.J().a(blockposition, this, MathHelper.nextInt(random, 20, 40)); -+ world.J().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay +- world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, 20, 40)); ++ world.getBlockTickList().a(blockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } } diff --git a/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch index 5196ce881c..bdf06f5f1e 100644 --- a/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch @@ -20,7 +20,7 @@ index 9f8b43d2a..3f59e060b 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5ec283f5d..ba702591a 100644 +index 84c0a14ec..457dec91a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 29e765034a..10737e2eda 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -49,7 +49,7 @@ index 000000000..f699ce18c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bc7ffbf8a..64342f54c 100644 +index c5d562dca..37bea8dbe 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ @@ -119,7 +119,7 @@ index 6a9b9fa2a..557aa5180 100644 } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 399eb231d..6a59e798d 100644 +index 95120be5d..5977d3b48 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -0,0 +0,0 @@ @@ -146,7 +146,7 @@ index 399eb231d..6a59e798d 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index f991fddf7..e888c9bdb 100644 +index 66fe6ff86..06417b9ec 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -0,0 +0,0 @@ @@ -165,7 +165,7 @@ index f991fddf7..e888c9bdb 100644 } @@ -0,0 +0,0 @@ public class RegionFile { - this.b(i, j, (int)(SystemUtils.d() / 1000L)); + this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L)); } catch (IOException ioexception) { ioexception.printStackTrace(); + ServerInternalException.reportInternalException(ioexception); // Paper @@ -173,7 +173,7 @@ index f991fddf7..e888c9bdb 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index d18921271..e5115863e 100644 +index c5ca89691..e507a996f 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ @@ -240,7 +240,7 @@ index e649d662a..560edb523 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3ecddf0fd..20ab0d420 100644 +index a9239ee7b..0e70a3d68 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -265,7 +265,7 @@ index 3ecddf0fd..20ab0d420 100644 continue; // Paper end @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.e(); + this.methodProfiler.exit(); } catch (Throwable throwable2) { // Paper start - Prevent tile entity and entity crashes - System.err.println("TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()); @@ -277,16 +277,16 @@ index 3ecddf0fd..20ab0d420 100644 this.tileEntityListTick.remove(tileTickPosition--); continue; diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java -index b21f7073f..882b8fe4f 100644 +index f0a826cd1..2dee02669 100644 --- a/src/main/java/net/minecraft/server/WorldPersistentData.java +++ b/src/main/java/net/minecraft/server/WorldPersistentData.java @@ -0,0 +0,0 @@ public class WorldPersistentData { - - nbttagcompound = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); - } catch (Throwable throwable1) { -+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable1); // Paper - throwable = throwable1; - throw throwable1; + int j = nbttagcompound.hasKeyOfType("DataVersion", 99) ? nbttagcompound.getInt("DataVersion") : 1343; + nbttagcompound1 = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound, j, i); + } catch (Throwable throwable2) { ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable2); // Paper + throwable = throwable2; + throw throwable2; } finally { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 311c4f5ca..e76882b8e 100644 diff --git a/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 7d43970849..a7a972dcac 100644 --- a/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-Server-Patches/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/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 72d841af06..6aabdc2974 100644 +index 8f2289f4e..93ca93b64 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -29,7 +29,7 @@ index 72d841af06..6aabdc2974 100644 + } + + packethandshakinginsetprotocol.hostname = event.getServerHostname(); -+ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); ++ this.b.socketAddress = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); + this.b.spoofedUUID = event.getUniqueId(); + this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class); + handledByEvent = true; // Hooray, we did it! diff --git a/Spigot-Server-Patches/Add-more-Witch-API.patch b/Spigot-Server-Patches/Add-more-Witch-API.patch index d6f4646b36..3cae0ee355 100644 --- a/Spigot-Server-Patches/Add-more-Witch-API.patch +++ b/Spigot-Server-Patches/Add-more-Witch-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 896388c41..7361d4c05 100644 +index f334ad88d..e3c77839b 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ @@ -75,7 +75,7 @@ index 896388c41..7361d4c05 100644 } @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { - super.k(); + super.movementTick(); } + // Paper start diff --git a/Spigot-Server-Patches/Add-more-Zombie-API.patch b/Spigot-Server-Patches/Add-more-Zombie-API.patch index da1787a97e..440f26a593 100644 --- a/Spigot-Server-Patches/Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/Add-more-Zombie-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 2d87dca68..4c0ef6e28 100644 +index f25bcfd8f..72ea3ba76 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -13,9 +13,9 @@ index 2d87dca68..4c0ef6e28 100644 private static final DataWatcherObject bC = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject bD = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); - private static final DataWatcherObject bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); -- private static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); +- public static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); // PAIL + private static final DataWatcherObject bE = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject armsRaised = bE; // Paper - OBFHELPER -+ private static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject drowning = bF; // Paper - OBFHELPER ++ public static final DataWatcherObject bF = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); private static final DataWatcherObject drowning = bF; // Paper - OBFHELPER private final PathfinderGoalBreakDoor bG; private boolean bH; private int bI; @@ -51,11 +51,11 @@ index 2d87dca68..4c0ef6e28 100644 return this.bH; } @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { - super.k(); + super.movementTick(); } + public void startDrowning(int drownedConversionTime) { a(drownedConversionTime); } // Paper - OBFHELPER - private void a(int i) { + public void a(int i) { // PAIL this.drownedConversionTime = i; this.getDataWatcher().set(EntityZombie.bF, true); } @@ -111,12 +111,12 @@ index 2d87dca68..4c0ef6e28 100644 public void b(EntityLiving entityliving) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index d2c3dbe48..43d4470d9 100644 +index 7af4ea9f8..4d4c50212 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java @@ -0,0 +0,0 @@ public class CraftZombie extends CraftMonster implements Zombie { - public Villager.Profession getVillagerProfession() { - return null; + getHandle().a(time); + } } + + // Paper start diff --git a/Spigot-Server-Patches/Add-player-view-distance-API.patch b/Spigot-Server-Patches/Add-player-view-distance-API.patch index 2a8aa8bdc0..8cd10b2695 100644 --- a/Spigot-Server-Patches/Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/Add-player-view-distance-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 6b58f632bd..d245502286 100644 +index 1aec6d7c3..1185769ca 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -25,7 +25,7 @@ index 6b58f632bd..d245502286 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index 70c9b1f50c..0ea6392284 100644 +index d7f33bd53..63e22bd9a 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java @@ -0,0 +0,0 @@ public class EntityTracker { @@ -37,7 +37,7 @@ index 70c9b1f50c..0ea6392284 100644 Iterator iterator = this.c.iterator(); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 8478a81f5c..5dbd493f41 100644 +index 6a622f72e..4272d2036 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -0,0 +0,0 @@ public class EntityTrackerEntry { @@ -50,7 +50,7 @@ index 8478a81f5c..5dbd493f41 100644 return d0 >= (double) (-i) && d0 <= (double) i && d1 >= (double) (-i) && d1 <= (double) i && this.tracker.a(entityplayer); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 12a8fec29a..7ca85a56ca 100644 +index 29e24940f..653031af4 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { @@ -221,7 +221,7 @@ index 12a8fec29a..7ca85a56ca 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 601d4c62d4..b919226bbf 100644 +index ff564508f..4233b94a1 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { @@ -234,7 +234,7 @@ index 601d4c62d4..b919226bbf 100644 for (int i1 = -b0; i1 <= b0; ++i1) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6635f1a4a3..d2ff18cf77 100644 +index 6635f1a4a..d2ff18cf7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -255,7 +255,7 @@ index 6635f1a4a3..d2ff18cf77 100644 @Override diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index a95f93eb76..09df00e94b 100644 +index a95f93eb7..09df00e94 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -0,0 +0,0 @@ public class ActivationRange diff --git a/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch index f9a144608b..375b7ee0ee 100644 --- a/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add setting for proxy online mode status diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index c4d12c315..1c1ef2dc2 100644 +index e10055b7d..2ae623e7d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import org.bukkit.configuration.InvalidConfigurationException; @@ -31,7 +31,7 @@ index c4d12c315..1c1ef2dc2 100644 + } } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 58d971cf2..658f7be0d 100644 +index 5977d3b48..c3f3ae03a 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -0,0 +0,0 @@ public class NameReferencingFileConverter { @@ -45,7 +45,7 @@ index 58d971cf2..658f7be0d 100644 } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b79f75bb0..b9eaaae29 100644 +index c655d51ac..f90b708e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch index bbcbaecb28..5511de0ec8 100644 --- a/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch @@ -9,13 +9,13 @@ This should hopefully avoid duplicate entities ever being created if the entity was to end up in 2 different chunk slices diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 382e46adb..a62d7196b 100644 +index f7990fbdb..4f01140e7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - entity.ae = this.locX; - entity.af = k; - entity.ag = this.locZ; + entity.chunkX = this.locX; + entity.chunkY = k; + entity.chunkZ = this.locZ; - this.entitySlices[k].add(entity); + // Paper start @@ -73,7 +73,7 @@ index 382e46adb..a62d7196b 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f13fa7fff..715ab15e3 100644 +index fe0590dea..469dce5df 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch index 337d70c4f3..36787bb55a 100644 --- a/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index e0a38b32a..2f6fd88ca 100644 +index 808d1a120..3030dd9c3 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @@ -18,7 +18,7 @@ index e0a38b32a..2f6fd88ca 100644 this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 1b82f22f8..af61d99bc 100644 +index 075e6f04e..2a06cbf85 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ import org.bukkit.entity.Player; diff --git a/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch index c2dea8eb39..b538f49b3c 100644 --- a/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b9eaaae29..67dd3b908 100644 +index f90b708e4..84c0a14ec 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch index 5cbc5e51d2..2b6592afa4 100644 --- a/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bbd8969db..90177b72c 100644 +index bcd8ba4ad..70c3cde24 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch index 28a0104c7b..d7be4b2c64 100644 --- a/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch +++ b/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch @@ -8,7 +8,7 @@ which can keep them in the chunk when they shouldnt be if done during entity ticking. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 811311e9e..1d7188b2e 100644 +index 78e85aacf..f5f1452b7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -17,8 +17,8 @@ index 811311e9e..1d7188b2e 100644 - if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking + // if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - move down - int i = entity.ae; - int j = entity.ag; + int i = entity.chunkX; + int j = entity.chunkZ; @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index 2b4d407da3..061b72179c 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1049,7 +1049,7 @@ index 000000000..37093419c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 836aea6c3..44d59d253 100644 +index 57e35564a..890715ff8 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -1071,7 +1071,7 @@ index 836aea6c3..44d59d253 100644 this.initLighting(); } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index f734b85e0..26a3f28cb 100644 +index 41a7103ef..c12db3cfa 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -1271,7 +1271,7 @@ index 6e7454b13..71a3636be 100644 int jx = along.length * 64 / 4096; if (this.h == this.b) { diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index f8facddb4..b2afec5e4 100644 +index e75b1a76e..e5cc77c6d 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -1296,15 +1296,15 @@ index f8facddb4..b2afec5e4 100644 + private boolean o() { // void -> boolean if (this.channel != null && this.channel.isOpen()) { - this.j.readLock().lock(); -+ if (this.i.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all ++ if (this.packetQueue.isEmpty()) { // return if the packet queue is empty so that the write lock by Anti-Xray doesn't affect the vanilla performance at all + return true; + } + + this.j.writeLock().lock(); // readLock -> writeLock (because of race condition between peek and poll) try { - while (!this.i.isEmpty()) { -- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.i.poll(); + while (!this.packetQueue.isEmpty()) { +- NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.packetQueue.poll(); - - this.b(networkmanager_queuedpacket.a, networkmanager_queuedpacket.b); + NetworkManager.QueuedPacket networkmanager_queuedpacket = (NetworkManager.QueuedPacket) this.getPacketQueue().peek(); // poll -> peek @@ -1418,7 +1418,7 @@ index 22a262bb6..40ec398ee 100644 if (flag) { packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes()); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 4383abccd..068d203c8 100644 +index db43a8a9a..b58683e6f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -0,0 +0,0 @@ public class PlayerChunk { @@ -1435,7 +1435,7 @@ index 4383abccd..068d203c8 100644 public void sendChunk(EntityPlayer entityplayer) { if (this.done) { + this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', true); // Paper - Anti-Xray - Load nearby chunks if necessary - entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, '\uffff')); + entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, 65535)); this.playerChunkMap.getWorld().getTracker().a(entityplayer, this.chunk); } @@ -0,0 +0,0 @@ public class PlayerChunk { @@ -1445,9 +1445,9 @@ index 4383abccd..068d203c8 100644 + // Paper - Anti-Xray - Loading chunks here could cause a ConcurrentModificationException #1104 + // Paper - Anti-Xray - TODO: Check if this is still the case for 1.13 + //this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, this.h, true); // Paper - Anti-Xray - Load nearby chunks if necessary - this.a((Packet) (new PacketPlayOutMapChunk(this.chunk, this.h))); + this.a(new PacketPlayOutMapChunk(this.chunk, this.h)); } else { - this.a((Packet) (new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk))); + this.a(new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk)); diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java index 23223e89d..23fc4d8e1 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -1462,7 +1462,7 @@ index 23223e89d..23fc4d8e1 100644 public void a(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index b88d41d67..025160679 100644 +index faaad0f41..9fd966dfb 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { @@ -1510,7 +1510,7 @@ index b88d41d67..025160679 100644 if (enumskyblock == EnumSkyBlock.SKY) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0d401bf1d..de591d912 100644 +index 780c0a7e8..67b20c056 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch b/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch index 2280ebab54..b0a917efa9 100644 --- a/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch +++ b/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch @@ -458,7 +458,7 @@ index 000000000..8f18c2869 + +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 44d59d253..0bd975b6d 100644 +index 890715ff8..654cf763b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -470,13 +470,13 @@ index 44d59d253..0bd975b6d 100644 Iterator iterator = protochunk.s().iterator(); diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index e14ae2b42..1662e4eba 100644 +index 2021c0d02..154ab09e0 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { } - public Chunk a(long i, Chunk chunk) { + public Chunk put(long i, Chunk chunk) { + org.spigotmc.AsyncCatcher.catchOp("Async Chunk put"); // Paper chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper lastChunkByPos = chunk; // Paper @@ -507,12 +507,12 @@ index e14ae2b42..1662e4eba 100644 @@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { } - public Chunk a(Long olong, Chunk chunk) { -- return this.a(olong, chunk); -+ return MCUtil.ensureMain("Chunk Put", () -> this.a(olong.longValue(), chunk)); // Paper + public Chunk put(Long olong, Chunk chunk) { +- return this.put(olong, chunk); ++ return MCUtil.ensureMain("Chunk Put", () -> this.put(olong.longValue(), chunk)); // Paper } - public Chunk a(long i) { + public Chunk remove(long i) { - Chunk chunk = (Chunk) super.remove(i); + // Paper start + org.spigotmc.AsyncCatcher.catchOp("Async Chunk remove"); @@ -555,28 +555,14 @@ index e14ae2b42..1662e4eba 100644 } // Paper end - public Chunk a(Object object) { -- return this.a((Long) object); -+ return MCUtil.ensureMain("Chunk Remove", () -> this.a(((Long) object).longValue())); // Paper + public Chunk remove(Object object) { +- return this.remove((Long) object); ++ return MCUtil.ensureMain("Chunk Remove", () -> this.remove(((Long) object).longValue())); // Paper } public void putAll(Map map) { -@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { - - // CraftBukkit start - decompile errors - public Chunk remove(long i) { -- return this.a(i); -+ return MCUtil.ensureMain("Chunk Remove", () -> this.a(i)); // Paper - } - - public Chunk put(long i, Chunk object) { -- return this.a(i, (Chunk) object); -+ return MCUtil.ensureMain("Chunk Put", () -> this.a(i, (Chunk) object)); // Paper - } - - public Chunk remove(Object object) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index dcc6e9762..87a1bddd0 100644 +index b9f8a86aa..4fe173cfb 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -726,7 +712,7 @@ index dcc6e9762..87a1bddd0 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 26a3f28cb..5ce57a6d4 100644 +index c12db3cfa..6cacacb0b 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -944,7 +930,7 @@ index 271dc41d4..bd15534c2 100644 private final MinecraftServer d; private final java.nio.file.Path e; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 522af3d53..ee878191a 100644 +index ef5a21505..93171edb4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -982,7 +968,7 @@ index 49fba0979..9ad646f8d 100644 fx = fx % 360.0F; if (fx >= 180.0F) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c73a61d94..17ae26cb8 100644 +index 63b5cdd41..32aee07d1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -998,7 +984,7 @@ index c73a61d94..17ae26cb8 100644 BlockPosition blockposition = worldserver.getSpawn(); - ArrayList arraylist = Lists.newArrayList(); -+ List arraylist = worldserver.getChunkProviderServer().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper ++ List arraylist = worldserver.getChunkProvider().getSpiralOutChunks(blockposition, worldserver.paperConfig.keepLoadedRange >> 4); // Paper Set set = Sets.newConcurrentHashSet(); - // Paper start @@ -1014,8 +1000,8 @@ index c73a61d94..17ae26cb8 100644 int expected = arraylist.size(); // Paper -- CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> { -+ CompletableFuture completablefuture = worldserver.getChunkProviderServer().loadAllChunks(arraylist, (chunk) -> { // Paper +- CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> { ++ CompletableFuture completablefuture = worldserver.getChunkProvider().loadAllChunks((Iterable) arraylist, (chunk) -> { // Paper set.add(chunk.getPos()); - if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper + if (waitForChunks && (set.size() == expected || (set.size() < expected && set.size() % (set.size() / 10) == 0))) { @@ -1061,14 +1047,14 @@ index c73a61d94..17ae26cb8 100644 + PaperAsyncChunkProvider.processMainThreadQueue(this); // Paper MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper - this.methodProfiler.c("commandFunctions"); + this.methodProfiler.exitEnter("commandFunctions"); @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // CraftBukkit - dropTickTime for (Iterator iterator = this.getWorlds().iterator(); iterator.hasNext();) { WorldServer worldserver = (WorldServer) iterator.next(); + PaperAsyncChunkProvider.processMainThreadQueue(worldserver); // Paper TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - i = SystemUtils.c(); + i = SystemUtils.getMonotonicNanos(); if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit diff --git a/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java new file mode 100644 @@ -1732,20 +1718,15 @@ index 000000000..e9a38f9d9 + +} diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 068d203c8..cbff0d946 100644 +index b58683e6f..e61538b3c 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -0,0 +0,0 @@ public class PlayerChunk { - // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse - // All may seem good at first, but there's deeper issues if you play for a bit + private long i; + private boolean done; boolean chunkExists; // Paper -- private boolean loadInProgress = false; -- private Runnable loadedRunnable = new Runnable() { -- public void run() { -- loadInProgress = false; -- PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true); -+ PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest; + // Paper start ++ PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest; + private java.util.function.Consumer chunkLoadedConsumer = chunk -> { + chunkRequest = null; + PlayerChunk pChunk = PlayerChunk.this; @@ -1766,18 +1747,17 @@ index 068d203c8..cbff0d946 100644 + } + + markedHigh = true; -+ playerChunkMap.getWorld().getChunkProviderServer().bumpPriority(location); ++ playerChunkMap.getWorld().getChunkProvider().bumpPriority(location); + if (chunkRequest == null) { + requestChunkIfNeeded(PlayerChunkMap.CAN_GEN_CHUNKS.test(player)); + } + } + private void requestChunkIfNeeded(boolean flag) { + if (chunkRequest == null) { -+ chunkRequest = this.playerChunkMap.getWorld().getChunkProviderServer().requestChunk(this.location.x, this.location.z, flag, markedHigh, chunkLoadedConsumer); ++ chunkRequest = this.playerChunkMap.getWorld().getChunkProvider().requestChunk(this.location.x, this.location.z, flag, markedHigh, chunkLoadedConsumer); + this.chunk = chunkRequest.getChunk(); // Paper) - markChunkUsed(); // Paper - delay chunk unloads - } -- }; ++ markChunkUsed(); // Paper - delay chunk unloads ++ } + } + private double getDistance(EntityPlayer player, int inFront) { + final float yaw = MathHelper.normalizeYaw(player.yaw); @@ -1791,8 +1771,20 @@ index 068d203c8..cbff0d946 100644 + final double z = location.z - ((int)Math.floor(blockZ) >> 4); + return Math.sqrt((x * x) + (z * z)); + } -+ // Paper end - // Paper start - delay chunk unloads + + public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) { + this.playerChunkMap = playerchunkmap; + this.location = new ChunkCoordIntPair(ix, j); + ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider(); + chunkproviderserver.a(ix, j); +- this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false); +- this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper ++ this.chunk = chunkproviderserver.getChunkAt(ix, j, false, false); // Paper ++ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(ix, j); // Paper + markChunkUsed(); // Paper - delay chunk unloads + } + + // Paper start private void markChunkUsed() { + if (!chunkHasPlayers && chunkRequest != null) { + chunkRequest.cancel(); @@ -1802,18 +1794,7 @@ index 068d203c8..cbff0d946 100644 return; } @@ -0,0 +0,0 @@ public class PlayerChunk { - ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProviderServer(); - - chunkproviderserver.a(i, j); -- this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); -- this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper -+ this.chunk = chunkproviderserver.getChunkAt(i, j, false, false); // Paper -+ this.chunkExists = this.chunk != null || chunkproviderserver.chunkGoingToExists(i, j); // Paper - markChunkUsed(); // Paper - delay chunk unloads - } - -@@ -0,0 +0,0 @@ public class PlayerChunk { - this.c.add(entityplayer); + this.players.add(entityplayer); if (this.done) { this.sendChunk(entityplayer); - } @@ -1825,7 +1806,7 @@ index 068d203c8..cbff0d946 100644 if (this.chunk != null) { return true; } else { -- this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag); +- this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag); - markChunkUsed(); // Paper - delay chunk unloads + // Paper start - async chunks + requestChunkIfNeeded(flag); @@ -1834,7 +1815,7 @@ index 068d203c8..cbff0d946 100644 } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 39e5b2484..a92557fd2 100644 +index 27343174d..77b36ff89 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { @@ -1894,7 +1875,7 @@ index 39e5b2484..a92557fd2 100644 private void e() { diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -index 38f3afb48..ddd7b91a9 100644 +index d0b3e43c0..eb7f03898 100644 --- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java @@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccess { @@ -1962,7 +1943,7 @@ index d868149d1..0d45d933e 100644 } } diff --git a/src/main/java/net/minecraft/server/StructurePiece.java b/src/main/java/net/minecraft/server/StructurePiece.java -index d444eb30f..d8c96b5c3 100644 +index 510543db4..ce9e5d4e0 100644 --- a/src/main/java/net/minecraft/server/StructurePiece.java +++ b/src/main/java/net/minecraft/server/StructurePiece.java @@ -0,0 +0,0 @@ public abstract class StructurePiece { @@ -2038,7 +2019,7 @@ index 1926c902a..1117e4ae2 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index eabf50e24..f8afa6f72 100644 +index 72bb3f862..d736ac63d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -2132,8 +2113,8 @@ index eabf50e24..f8afa6f72 100644 + } + // Paper end org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot - if (entity == null) return false; if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper + if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java index fa99fe014..4f49786aa 100644 --- a/src/main/java/net/minecraft/server/WorldGenStronghold.java @@ -2282,7 +2263,7 @@ index fa99fe014..4f49786aa 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index bab0c0e0f..af68074c1 100644 +index b355c3f53..27c8a97be 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -2295,7 +2276,7 @@ index bab0c0e0f..af68074c1 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 07f6580fd..c79baa922 100644 +index a0f255ff1..eb4b3c7a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -2305,7 +2286,7 @@ index 07f6580fd..c79baa922 100644 - for (int j = -short1; j <= short1; j += 16) { - for (int k = -short1; k <= short1; k += 16) { + // Paper start -+ for (ChunkCoordIntPair coords : internal.getChunkProviderServer().getSpiralOutChunks(internal.getSpawn(), short1 >> 4)) {{ ++ for (ChunkCoordIntPair coords : internal.getChunkProvider().getSpiralOutChunks(internal.getSpawn(), short1 >> 4)) {{ + int j = coords.x; + int k = coords.z; + // Paper end @@ -2317,13 +2298,13 @@ index 07f6580fd..c79baa922 100644 } BlockPosition chunkcoordinates = internal.getSpawn(); -- internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true); -+ internal.getChunkProviderServer().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true, c -> {}); // Paper +- internal.getChunkProvider().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true); ++ internal.getChunkProvider().getChunkAt(chunkcoordinates.getX() + j >> 4, chunkcoordinates.getZ() + k >> 4, true, true, c -> {}); // Paper } } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 7e6a7b0e9..ef5a7bc38 100644 +index 5552b64fb..c6d033928 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -2333,7 +2314,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 + // Paper start - Async chunk load API + @Override + public java.util.concurrent.CompletableFuture getChunkAtAsync(final int x, final int z, final boolean gen) { -+ final ChunkProviderServer cps = this.world.getChunkProviderServer(); ++ final ChunkProviderServer cps = this.world.getChunkProvider(); + java.util.concurrent.CompletableFuture future = new java.util.concurrent.CompletableFuture<>(); + cps.getChunkAt(x, z, true, gen, chunk -> future.complete(chunk != null ? chunk.bukkitChunk : null)); + return future; @@ -2341,7 +2322,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 + // Paper end + public Chunk getChunkAt(int x, int z) { - return this.world.getChunkProviderServer().getChunkAt(x, z, true, true).bukkitChunk; + return this.world.getChunkProvider().getChunkAt(x, z, true, true).bukkitChunk; } @@ -0,0 +0,0 @@ public class CraftWorld implements World { int chunkCoordZ = chunkcoordinates.getZ() >> 4; @@ -2350,7 +2331,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 - for (int x = -radius; x <= radius; x++) { // Paper - for (int z = -radius; z <= radius; z++) { // Paper + // Paper start -+ for (ChunkCoordIntPair coords : world.getChunkProviderServer().getSpiralOutChunks(world.getSpawn(), radius)) {{ ++ for (ChunkCoordIntPair coords : world.getChunkProvider().getSpiralOutChunks(world.getSpawn(), radius)) {{ + int x = coords.x; + int z = coords.z; + // Paper end @@ -2361,7 +2342,7 @@ index 7e6a7b0e9..ef5a7bc38 100644 if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) { unloadChunk(chunkCoordX + x, chunkCoordZ + z); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 4a0a456a0..4068b8072 100644 +index f87d2bed7..603f43b7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { @@ -2423,7 +2404,7 @@ index 4a0a456a0..4068b8072 100644 if (!event.isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 04e29f58c..5fae0c6ad 100644 +index 9c917370a..a299092a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - this.methodProfiler.a("save"); -- this.s.savePlayers(); + this.methodProfiler.enter("save"); +- this.playerList.savePlayers(); + + serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper + int playerSaveInterval = com.destroystokyo.paper.PaperConfig.playerAutoSaveRate; @@ -146,7 +146,7 @@ index bdf4aed1a..acdfb0e1e 100644 + playerSaveInterval = autosavePeriod; + } + if (playerSaveInterval > 0) { // CraftBukkit // Paper -+ this.s.savePlayers(playerSaveInterval); ++ this.playerList.savePlayers(playerSaveInterval); // Spigot Start + } // Paper - Incremental Auto Saving + @@ -161,14 +161,14 @@ index bdf4aed1a..acdfb0e1e 100644 server.playerCommandState = false; // this.saveChunks(true); // Spigot End - this.methodProfiler.e(); + this.methodProfiler.exit(); - } + //} // Paper - Incremental Auto Saving - this.methodProfiler.a("snooper"); - if (getSnooperEnabled() && !this.i.d() && this.ticks > 100) { // Spigot + this.methodProfiler.enter("snooper"); + if (getSnooperEnabled() && !this.snooper.d() && this.ticks > 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 143c7c1be..1259ec9d6 100644 +index 3e4ca288d..e28485f18 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -207,11 +207,11 @@ index 143c7c1be..1259ec9d6 100644 public WhiteList getWhitelist() { return this.whitelist; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b37b284a5..6a5a7d1e0 100644 +index b5983957b..7a765cb7b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); + ChunkProviderServer chunkproviderserver = this.getChunkProvider(); if (chunkproviderserver.d()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit diff --git a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index c951379096..4977fc53f7 100644 --- a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -10,7 +10,7 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index aedf31a07..8ff542c88 100644 +index 9b88a4190..6c9d7df20 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -19,10 +19,10 @@ index aedf31a07..8ff542c88 100644 + public void removeEntity(Entity entity) { b(entity); } // Paper - OBFHELPER public void b(Entity entity) { - this.a(entity, entity.af); + this.a(entity, entity.chunkY); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a14518ba6..980f373b1 100644 +index 0ca1816cb..7711b2eff 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -43,13 +43,13 @@ index a14518ba6..980f373b1 100644 for (Entity e : this.g) { @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.e(); - this.methodProfiler.a("remove"); + this.methodProfiler.exit(); + this.methodProfiler.enter("remove"); if (entity.dead) { + // Paper start + /* - j = entity.ae; - int l = entity.ag; + j = entity.chunkX; + int l = entity.chunkZ; if (entity.inChunk && this.isChunkLoaded(j, l, true)) { this.getChunkAt(j, l).b(entity); diff --git a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch index 3c88ebb1d4..0443faa2ce 100644 --- a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch @@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear Combined, this adds up a lot. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 87ec4d1a2..c5d562dca 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -29,7 +29,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public boolean areNeighborsLoaded(final int radius) { switch (radius) { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - entity.ag = this.locZ; + entity.chunkZ = this.locZ; this.entitySlices[k].add(entity); // Paper start + if (entity instanceof EntityItem) { @@ -88,7 +88,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7b7fd6b9b..eb08a1caa 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -0,0 +0,0 @@ public final class IEntitySelector { diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index d6cdff580e..f952d7e015 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -429,7 +429,7 @@ index e1af5c488..0ef5ad116 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ce1805062..34ba382a4 100644 +index 9c95661a7..906bd973d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -450,7 +450,7 @@ index ce1805062..34ba382a4 100644 return this.V; } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index a47a51a41..4c476f757 100644 +index 7d9edb9a6..355875a98 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -0,0 +0,0 @@ public class UserCache { @@ -486,7 +486,7 @@ index a47a51a41..4c476f757 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 873170864..72da1fe81 100644 +index e08da05d4..b5d0886df 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.event.server.ServerLoadEvent; diff --git a/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch b/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch index 8be4173099..c0cbf7ea1a 100644 --- a/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch +++ b/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Block player logins during server shutdown diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index bb08200e7..90d1096e5 100644 +index 9f6b73d80..af5c699fe 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { } - public void Y_() { + public void tick() { + // Paper start - Do not allow logins while the server is shutting down + if (!MinecraftServer.getServer().isRunning()) { + this.disconnect(new ChatMessage(org.spigotmc.SpigotConfig.restartMessage)); diff --git a/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch index 14913f92f1..7f6e05dc0d 100644 --- a/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch @@ -45,7 +45,7 @@ index f0b87972d..a92914576 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e204dbe21..8e436c7f4 100644 +index 16d8a56b1..f2f977fff 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -57,7 +57,7 @@ index e204dbe21..8e436c7f4 100644 private int j; private final IntHashMap k = new IntHashMap(); @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - this.minecraftServer.methodProfiler.e(); + this.minecraftServer.methodProfiler.exit(); // CraftBukkit start for (int spam; (spam = this.chatThrottle) > 0 && !chatSpamField.compareAndSet(this, spam, spam - 1); ) ; + if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable diff --git a/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch b/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch index b256003605..c317472971 100644 --- a/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch +++ b/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch @@ -133,7 +133,7 @@ index 000000000..a10a5bc13 + } +} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b284524be..80d384dfe 100644 +index e9543c06c..c083b2dd3 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -171,7 +171,7 @@ index 72cd9ba58..35205561b 100644 if (l1 <= k) { BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 72e74c59f..e8891d078 100644 +index bd6f64e52..67a903a62 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch index a105a4944d..a62ffe38a2 100644 --- a/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch +++ b/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch @@ -84,53 +84,55 @@ index 000000000..74c012fd4 + +} diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index aafca9c9c..860076fc2 100644 +index 976888b66..48e7ae2d5 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java -@@ -0,0 +0,0 @@ import java.net.InetSocketAddress; - import java.nio.charset.StandardCharsets; - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; -+import com.destroystokyo.paper.network.PaperLegacyStatusClient; // Paper +@@ -0,0 +0,0 @@ + package net.minecraft.server; - public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - private static final Logger a = LogManager.getLogger(); ++import com.destroystokyo.paper.network.PaperLegacyStatusClient; ++ + import io.netty.buffer.ByteBuf; + import io.netty.buffer.Unpooled; + import io.netty.channel.ChannelFutureListener; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - InetSocketAddress inetsocketaddress = (InetSocketAddress)channelhandlercontext.channel().remoteAddress(); - MinecraftServer minecraftserver = this.b.d(); - int i = bytebuf.readableBytes(); -+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper - switch(i) { - case 0: - a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); -- String s2 = String.format("%s\u00a7%d\u00a7%d", minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z()); -+ // Paper start - Call PaperServerListPingEvent and use results -+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); -+ if (event == null) { -+ channelhandlercontext.close(); -+ break; -+ } -+ String s2 = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers()); -+ // Paper end - this.a(channelhandlercontext, this.a(s2)); - break; - case 1: -@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - } + MinecraftServer minecraftserver = this.b.d(); + int i = bytebuf.readableBytes(); + String s; +- org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit ++ //org.bukkit.event.server.ServerListPingEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(minecraftserver.server, inetsocketaddress.getAddress(), minecraftserver.getMotd(), minecraftserver.getPlayerCount(), minecraftserver.getMaxPlayers()); // CraftBukkit // Paper ++ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper - a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); -- String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", 127, minecraftserver.getVersion(), minecraftserver.getMotd(), minecraftserver.y(), minecraftserver.z()); -+ // Paper start - Call PaperServerListPingEvent and use results -+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null); -+ if (event == null) { -+ channelhandlercontext.close(); -+ break; -+ } -+ String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); -+ // Paper end - this.a(channelhandlercontext, this.a(s)); - break; - default: + switch (i) { + case 0: + LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); +- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ // Paper start - Call PaperServerListPingEvent and use results ++ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); ++ if (event == null) { ++ channelhandlercontext.close(); ++ break; ++ } ++ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers()); + this.a(channelhandlercontext, this.a(s)); + break; + case 1: +@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + } + + LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort()); +- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { 127, minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ // Paper start - Call PaperServerListPingEvent and use results ++ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 127, null); // Paper ++ if (event == null) { ++ channelhandlercontext.close(); ++ break; ++ } ++ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { event.getProtocolVersion(), minecraftserver.getVersion(), event.getMotd(), event.getNumPlayers(), event.getMaxPlayers()}); // CraftBukkit ++ // Paper end + this.a(channelhandlercontext, this.a(s)); + break; + default: @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress()); @@ -146,7 +148,7 @@ index aafca9c9c..860076fc2 100644 + } + + String response = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), -+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); ++ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); this.a(ctx, this.a(response)); } diff --git a/Spigot-Server-Patches/Call-player-spectator-target-events.patch b/Spigot-Server-Patches/Call-player-spectator-target-events.patch index 737102e74d..e5ea87d1f1 100644 --- a/Spigot-Server-Patches/Call-player-spectator-target-events.patch +++ b/Spigot-Server-Patches/Call-player-spectator-target-events.patch @@ -5,20 +5,20 @@ Subject: [PATCH] Call player spectator target events diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index d429e552e..6105a4e14 100644 +index b5d48e7bf..2679c2358 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private EntityHuman.EnumChatVisibility cs; private boolean ct = true; - private long cu = SystemUtils.b(); -- private Entity cv; -+ private Entity cv; private void setSpectatorTargetField(Entity e) { this.cv = e; } // Paper - OBFHELPER + private long cu = SystemUtils.getMonotonicMillis(); +- private Entity spectatedEntity; ++ private Entity spectatedEntity; private void setSpectatorTargetField(Entity e) { this.spectatedEntity = e; } // Paper - OBFHELPER public boolean worldChangeInvuln; private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER - private final RecipeBookServer cy; + private final RecipeBookServer recipeBook; @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - return (Entity) (this.cv == null ? this : this.cv); + return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity); } - public void setSpectatorTarget(Entity entity) { @@ -26,10 +26,10 @@ index d429e552e..6105a4e14 100644 + // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event Entity entity1 = this.getSpecatorTarget(); -- this.cv = (Entity) (entity == null ? this : entity); -- if (entity1 != this.cv) { -- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.cv)); -- this.playerConnection.a(this.cv.locX, this.cv.locY, this.cv.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit +- this.spectatedEntity = (Entity) (entity == null ? this : entity); +- if (entity1 != this.spectatedEntity) { +- this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity)); +- this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit + if (newSpectatorTarget == null) { + newSpectatorTarget = this; } @@ -53,9 +53,8 @@ index d429e552e..6105a4e14 100644 + setSpectatorTargetField(newSpectatorTarget); + + this.playerConnection.sendPacket(new PacketPlayOutCamera(newSpectatorTarget)); ++ this.playerConnection.a(this.spectatedEntity.locX, this.spectatedEntity.locY, this.spectatedEntity.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit + // Paper end -+ -+ this.playerConnection.a(this.cv.locX, this.cv.locY, this.cv.locZ, this.yaw, this.pitch, TeleportCause.SPECTATE); // CraftBukkit } protected void E() { diff --git a/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch b/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch index 3247740ed6..b951e6dc4b 100644 --- a/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch +++ b/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Catch Async PlayerChunkMap operations diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index fb593529e1..a69d510dd1 100644 +index 653031af4..3d17ad646 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { diff --git a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch index e25f17e76a..cf754d117e 100644 --- a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch +++ b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Change implementation of (tile)entity removal list diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 352a7f25a7..65e84b666f 100644 +index 214adec9b..a9239ee7b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -33,9 +33,9 @@ index 352a7f25a7..65e84b666f 100644 - for (i = 0; i < this.g.size(); ++i) { - entity = (Entity) this.g.get(i); -- int k = entity.ae; +- int k = entity.chunkX; - -- j = entity.ag; +- j = entity.chunkZ; - if (entity.inChunk && this.isChunkLoaded(k, j, true)) { - this.getChunkAt(k, j).b(entity); + if (e.inChunk && this.isChunkLoaded(k, j, true)) { diff --git a/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch index b6d16d3362..a5a65b64e1 100644 --- a/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch +++ b/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index b4500eead..512c22df9 100644 +index 852b9e184..e34b54dc0 100644 --- a/src/main/java/net/minecraft/server/EntityDrowned.java +++ b/src/main/java/net/minecraft/server/EntityDrowned.java @@ -0,0 +0,0 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { @@ -23,12 +23,9 @@ index b4500eead..512c22df9 100644 - // $FF: synthetic method - public boolean test(@Nullable Object object) { -- return this.a((EntityHuman)object); -+ // Paper start - decompile error -+ public boolean test(@Nullable EntityHuman entityhuman) { -+ return this.a(entityhuman); -+ // Paper end - } +- return this.test((EntityHuman)object); +- } } + static class c extends PathfinderGoalGotoTarget { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch index 3def4c810c..97d0597fea 100644 --- a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Chunk Save Reattempt We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index e888c9bdba..f4405be395 100644 +index 06417b9ec..e1c0921ea 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -0,0 +0,0 @@ public class RegionFile { - this.b(i, j, (int)(SystemUtils.d() / 1000L)); + this.b(i, j, (int)(SystemUtils.getTimeMillis() / 1000L)); } catch (IOException ioexception) { - ioexception.printStackTrace(); - ServerInternalException.reportInternalException(ioexception); // Paper @@ -20,7 +20,7 @@ index e888c9bdba..f4405be395 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index e5115863ec..2217adf99c 100644 +index e507a996f..5dbd1d517 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ public class RegionFileCache { diff --git a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch index 6d490225a3..f910109a8c 100644 --- a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch +++ b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch @@ -8,7 +8,7 @@ Adds a command line flag to enable stats on how chunk saves are processing. Stats on current queue, how many was processed and how many were queued. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 917f57ced..570ddc1a8 100644 +index 9990cdbcd..b1c4eb4ae 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -25,7 +25,7 @@ index 917f57ced..570ddc1a8 100644 private final ChunkTaskScheduler chunkScheduler; @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { // Paper start - final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; + final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader; final int queueSize = chunkLoader.getQueueSize(); + + final long now = System.currentTimeMillis(); @@ -54,7 +54,7 @@ index 917f57ced..570ddc1a8 100644 return false; } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a2c3c066b..34ddf655e 100644 +index f17869d4d..8eecdbd33 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/Chunk-registration-fixes.patch b/Spigot-Server-Patches/Chunk-registration-fixes.patch index b7a5132f7a..95582979df 100644 --- a/Spigot-Server-Patches/Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/Chunk-registration-fixes.patch @@ -8,7 +8,7 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a81c7dfa2e..3740cdf95d 100644 +index 0d04b14cf..b17a8d60c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -19,5 +19,5 @@ index a81c7dfa2e..3740cdf95d 100644 + j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior int k = MathHelper.floor(entity.locZ / 16.0D); - if (!entity.inChunk || entity.ae != i || entity.af != j || entity.ag != k) { + if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch index b8974ff42e..1918d969eb 100644 --- a/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch @@ -28,7 +28,7 @@ index 03b7410f5..5c50c62e5 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 928c5eb41..ac81a8d76 100644 +index ddf170180..bd799d0c6 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { diff --git a/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Time.patch b/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Time.patch index 138e866d59..9d55c2851c 100644 --- a/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Time.patch +++ b/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Time.patch @@ -30,7 +30,7 @@ index deb4ec254..d2559f7c4 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 6a23b1ec2..d065d88f7 100644 +index 66520842d..f470eba29 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch b/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch index 41afb97b23..d8922be200 100644 --- a/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch +++ b/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch @@ -26,7 +26,7 @@ index b6764c7ec..29cb718fb 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 9d971a9c5..a696be750 100644 +index 5935bae58..b1ece38b2 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { diff --git a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch index e3ad2eb48d..f7b7b2bd1e 100644 --- a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -21,7 +21,7 @@ index 058cd8cc8..276dd98fd 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 051608e38..7793626b5 100644 +index eef8d2b5a..cc98b745b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -42,7 +42,7 @@ index 051608e38..7793626b5 100644 + int expected = arraylist.size(); // Paper + - CompletableFuture completablefuture = worldserver.getChunkProviderServer().a((Iterable) arraylist, (chunk) -> { + CompletableFuture completablefuture = worldserver.getChunkProvider().a((Iterable) arraylist, (chunk) -> { set.add(chunk.getPos()); + if (set.size() < expected && set.size() % 25 == 0) this.a(new ChatMessage("menu.preparingSpawn", new Object[0]), set.size() * 100 / expected); // Paper }); @@ -63,7 +63,7 @@ index 051608e38..7793626b5 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 481a462f8..e64a95ece 100644 +index ceb4102af..02a62d6d7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -78,7 +78,7 @@ index 481a462f8..e64a95ece 100644 public LongSet ag() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 082e86963..b89c5f4ab 100644 +index acd54067e..c655d51ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -91,7 +91,7 @@ index 082e86963..b89c5f4ab 100644 for (int j = -short1; j <= short1; j += 16) { for (int k = -short1; k <= short1; k += 16) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a784bf6f6..24e504c27 100644 +index 1676fcc85..b19eef1b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch index 266091dd91..9dc0853f1a 100644 --- a/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch +++ b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch @@ -33,27 +33,27 @@ index 29cb718fb..695bdf2e6 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 7cb1327a8..4383abccd 100644 +index 5497a458d..db43a8a9a 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -0,0 +0,0 @@ public class PlayerChunk { - // CraftBukkit start - add fields - // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse - // All may seem good at first, but there's deeper issues if you play for a bit + private int h; + private long i; + private boolean done; + boolean chunkExists; // Paper - private boolean loadInProgress = false; - private Runnable loadedRunnable = new Runnable() { - public void run() { -@@ -0,0 +0,0 @@ public class PlayerChunk { - chunkproviderserver.a(i, j); - this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); -+ this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper + public PlayerChunk(PlayerChunkMap playerchunkmap, int ix, int j) { + this.playerChunkMap = playerchunkmap; +@@ -0,0 +0,0 @@ public class PlayerChunk { + ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider(); + chunkproviderserver.a(ix, j); + this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false); ++ this.chunkExists = this.chunk != null || org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), ix, j); // Paper markChunkUsed(); // Paper - delay chunk unloads } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index a696be750..39e5b2484 100644 +index b1ece38b2..27343174d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { diff --git a/Spigot-Server-Patches/Configurable-Player-Collision.patch b/Spigot-Server-Patches/Configurable-Player-Collision.patch index b5bbf2327d..1d6cabf047 100644 --- a/Spigot-Server-Patches/Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/Configurable-Player-Collision.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Player Collision diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b4dba7247..1d32b93c8 100644 +index 0778f53e2..30fcf4a72 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -19,7 +19,7 @@ index b4dba7247..1d32b93c8 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7793626b5..bdd2c4b85 100644 +index cc98b745b..d146cc79c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -56,7 +56,7 @@ index f7a9b9d88..7befd80cf 100644 packetdataserializer.a(this.c); packetdataserializer.a(this.d); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 2cb5869ae..143c7c1be 100644 +index 7edca4284..3e4ca288d 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -74,7 +74,7 @@ index 2cb5869ae..143c7c1be 100644 + // Paper start - Add to collideRule team if needed + final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName); -+ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) { ++ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getScoreboardTeam() == null) { + scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam); + } + // Paper end @@ -89,7 +89,7 @@ index 2cb5869ae..143c7c1be 100644 + if (this.collideRuleTeamName != null) { + final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); -+ if (entityplayer.getTeam() == team && team != null) { ++ if (entityplayer.getScoreboardTeam() == team && team != null) { + scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); + } + } diff --git a/Spigot-Server-Patches/Configurable-end-credits.patch b/Spigot-Server-Patches/Configurable-end-credits.patch index dd3345e69d..9754a25377 100644 --- a/Spigot-Server-Patches/Configurable-end-credits.patch +++ b/Spigot-Server-Patches/Configurable-end-credits.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable end credits diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 8f6f0288be..5aee23dceb 100644 +index 8f6f0288b..5aee23dce 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,16 +20,16 @@ index 8f6f0288be..5aee23dceb 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e0215bcdb8..cdf89cfed3 100644 +index d0d93b1eb..2804bfc0a 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - private long cu = SystemUtils.b(); - private Entity cv; + private long cu = SystemUtils.getMonotonicMillis(); + private Entity spectatedEntity; public boolean worldChangeInvuln; - private boolean cx; + private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER - private final RecipeBookServer cy; + private final RecipeBookServer recipeBook; private Vec3D cz; private int cA; @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch index 21f3b5a8e7..d265963231 100644 --- a/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch @@ -22,15 +22,15 @@ index 2220a18d9..94c544714 100644 SAFE_REGEN, DELETE, NOTHING, WARN } diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java -index 56f26da41..ddf2fc67e 100644 +index 80a49900e..f0d5316b6 100644 --- a/src/main/java/net/minecraft/server/BlockFluids.java +++ b/src/main/java/net/minecraft/server/BlockFluids.java @@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource { public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) { if (this.a(world, blockposition, iblockdata)) { -- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } @@ -53,13 +53,13 @@ index 56f26da41..ddf2fc67e 100644 + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { if (iblockdata.s().d() || iblockdata1.s().d()) { - generatoraccess.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); + generatoraccess.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); @@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource { public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (this.a(world, blockposition, iblockdata)) { -- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.getFluidTickList().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } diff --git a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch index 888f03c326..2c14c6e3ea 100644 --- a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch @@ -20,7 +20,7 @@ index 1ed58f4bb..39d565db1 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c7db9db95..12fe12e04 100644 +index cc6ae6634..99716419e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -40,7 +40,7 @@ index c7db9db95..12fe12e04 100644 if (!this.world.isClientSide) { this.setFlag(0, this.fireTicks > 0); @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } + // Paper start @@ -63,7 +63,7 @@ index c7db9db95..12fe12e04 100644 this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 5bee194fa..b52bc659e 100644 +index a2f334968..e741c7f83 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT diff --git a/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch index e5cb174d07..c2af33adf0 100644 --- a/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -43,7 +43,7 @@ index 42d951554..d8f258105 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d065d88f7..2a9bfd7af 100644 +index f470eba29..86bdd6e7f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -55,7 +55,7 @@ index d065d88f7..2a9bfd7af 100644 public final int locZ; private boolean l; diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index 2ebb2d834..e14ae2b42 100644 +index 8b3738c8f..2021c0d02 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { @@ -67,7 +67,7 @@ index 2ebb2d834..e14ae2b42 100644 + if (chunk.world.paperConfig.delayChunkUnloadsBy > 0) { + chunk.scheduledForUnload = System.currentTimeMillis(); + } else { -+ ((WorldServer) chunk.world).getChunkProviderServer().unload(chunk); ++ ((WorldServer) chunk.world).getChunkProvider().unload(chunk); + } + } + // Paper end @@ -99,17 +99,17 @@ index 1d08ec37f..516a583a8 100644 this.chunkScheduler.a(booleansupplier); } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index c7ea17e25..7cb1327a8 100644 +index 1d672eaa1..5497a458d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -0,0 +0,0 @@ public class PlayerChunk { - public void run() { - loadInProgress = false; - PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true); -+ markChunkUsed(); // Paper - delay chunk unloads - } - }; -+ // Paper start - delay chunk unloads + ChunkProviderServer chunkproviderserver = playerchunkmap.getWorld().getChunkProvider(); + chunkproviderserver.a(ix, j); + this.chunk = chunkproviderserver.getChunkAt(ix, j, true, false); ++ markChunkUsed(); // Paper - delay chunk unloads + } + ++ // Paper start + private void markChunkUsed() { + if (chunk == null) { + return; @@ -122,30 +122,23 @@ index c7ea17e25..7cb1327a8 100644 + } + private boolean chunkHasPlayers = false; + // Paper end - // CraftBukkit end - - public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) { -@@ -0,0 +0,0 @@ public class PlayerChunk { - - chunkproviderserver.a(i, j); - this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); -+ markChunkUsed(); // Paper - delay chunk unloads - } - ++ public ChunkCoordIntPair a() { + return this.location; + } @@ -0,0 +0,0 @@ public class PlayerChunk { } else { - if (this.c.isEmpty()) { + if (this.players.isEmpty()) { this.i = this.playerChunkMap.getWorld().getTime(); + chunkHasPlayers = true; // Paper - delay chunk unloads + markChunkUsed(); // Paper - delay chunk unloads } - this.c.add(entityplayer); + this.players.add(entityplayer); @@ -0,0 +0,0 @@ public class PlayerChunk { - this.c.remove(entityplayer); - if (this.c.isEmpty()) { + this.players.remove(entityplayer); + if (this.players.isEmpty()) { + chunkHasPlayers = false; // Paper - delay chunk unloads + markChunkUsed(); // Paper - delay chunk unloads this.playerChunkMap.b(this); @@ -154,23 +147,23 @@ index c7ea17e25..7cb1327a8 100644 @@ -0,0 +0,0 @@ public class PlayerChunk { return true; } else { - this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag); + this.chunk = this.playerChunkMap.getWorld().getChunkProvider().getChunkAt(this.location.x, this.location.z, true, flag); + markChunkUsed(); // Paper - delay chunk unloads return this.chunk != null; } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index b8d8fc779..e5605c309 100644 +index 3d17ad646..c3ac66d35 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { Chunk chunk = playerchunk.f(); if (chunk != null) { -- this.getWorld().getChunkProviderServer().unload(chunk); +- this.getWorld().getChunkProvider().unload(chunk); + // Paper start - delay chunk unloads + if (world.paperConfig.delayChunkUnloadsBy <= 0) { -+ this.getWorld().getChunkProviderServer().unload(chunk); ++ this.getWorld().getChunkProvider().unload(chunk); + } else { + chunk.scheduledForUnload = System.currentTimeMillis(); + } @@ -179,7 +172,7 @@ index b8d8fc779..e5605c309 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 49432f2eb..288152775 100644 +index 5d7370029..6f672aa22 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -198,11 +191,11 @@ index 49432f2eb..288152775 100644 this.methodProfiler.a(() -> { return String.valueOf(TileEntityTypes.a(tileentity.C())); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 24e504c27..f0e974dff 100644 +index b19eef1b1..f1320f5ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { - ChunkProviderServer cps = world.getChunkProviderServer(); + ChunkProviderServer cps = world.getChunkProvider(); for (net.minecraft.server.Chunk chunk : cps.chunks.values()) { // If in use, skip it - if (isChunkInUse(chunk.locX, chunk.locZ)) { diff --git a/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch index f1401d2122..5bfc764b73 100644 --- a/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch @@ -11,7 +11,7 @@ So avoid looking up scoreboards and short circuit to the "not on a team" logic which is most likely to be true. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 50837d767f..898068a817 100644 +index 50837d767..898068a81 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -25,19 +25,19 @@ index 50837d767f..898068a817 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6b413833da..43ceb2fb18 100644 +index 99716419e..caeb5eae0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable - public ScoreboardTeamBase be() { + public ScoreboardTeamBase getScoreboardTeam() { + if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper return this.world.getScoreboard().getPlayerTeam(this.getName()); } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 961da5bf97..91baaa5062 100644 +index da105b41c..6f8ac61d8 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { diff --git a/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch index ac47d1569f..606a3e00ed 100644 --- a/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch +++ b/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Disable Vanilla Chunk GC Bukkit has its own system for this. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ca2e027cda..f9b4f314ce 100644 +index 7a765cb7b..a8675b8c6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Disable-ice-and-snow.patch b/Spigot-Server-Patches/Disable-ice-and-snow.patch index bc4895eb0f..e44e9ac1a3 100644 --- a/Spigot-Server-Patches/Disable-ice-and-snow.patch +++ b/Spigot-Server-Patches/Disable-ice-and-snow.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Disable ice and snow diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 13253f6e9c..cde9c11f4d 100644 +index 13253f6e9..cde9c11f4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -19,13 +19,13 @@ index 13253f6e9c..cde9c11f4d 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f39ce330f6..2341ce3f93 100644 +index 73e9ff1b3..2558a20f6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { } - this.methodProfiler.c("iceandsnow"); + this.methodProfiler.exitEnter("iceandsnow"); - if (this.random.nextInt(16) == 0) { + if (!this.paperConfig.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow this.m = this.m * 3 + 1013904223; diff --git a/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch index 8d87d97a93..d34971e03d 100644 --- a/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9a7da83b82..4a457e3302 100644 +index 00880d54f..214adec9b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch b/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch index 5f82749b43..12402aad11 100644 --- a/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch +++ b/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not load chunks for Pathfinding diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 546c79cd8..25caf7ef9 100644 --- a/src/main/java/net/minecraft/server/ChunkCache.java +++ b/src/main/java/net/minecraft/server/ChunkCache.java @@ -0,0 +0,0 @@ public class ChunkCache implements IIBlockAccess { @@ -18,7 +18,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 53f1c25d2..26156d6cf 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -0,0 +0,0 @@ public abstract class NavigationAbstract { @@ -47,7 +47,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 if (this.m) { this.l(); diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index a12fdceac..1881dea66 100644 --- a/src/main/java/net/minecraft/server/Pathfinder.java +++ b/src/main/java/net/minecraft/server/Pathfinder.java @@ -0,0 +0,0 @@ public class Pathfinder { @@ -60,7 +60,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public Pathfinder(PathfinderAbstract pathfinderabstract) { this.d = pathfinderabstract; diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index ba7fe359f..671628014 100644 --- a/src/main/java/net/minecraft/server/PathfinderAbstract.java +++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -80,7 +80,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.c.c(); this.d = MathHelper.d(entityinsentient.width + 1.0F); diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 2e82c7c48..34b29652b 100644 --- a/src/main/java/net/minecraft/server/PathfinderNormal.java +++ b/src/main/java/net/minecraft/server/PathfinderNormal.java @@ -0,0 +0,0 @@ public class PathfinderNormal extends PathfinderAbstract { @@ -115,9 +115,9 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 for(int l = -1; l <= 1; ++l) { for(int i1 = -1; i1 <= 1; ++i1) { if (l != 0 || i1 != 0) { -- Block block = iblockaccess.getType(blockposition$b.f(l + i, jx, i1 + k)).getBlock(); +- Block block = iblockaccess.getType(blockposition$b.c(l + i, jx, i1 + k)).getBlock(); - if (block == Blocks.CACTUS) { -+ Block block = world.getBlockIfLoaded(blockposition$b.f(l + i, jx, i1 + k)); // Paper ++ Block block = world.getBlockIfLoaded(blockposition$b.c(l + i, jx, i1 + k)); // Paper + if (block == null) pathtype = PathType.BLOCKED; // Paper + else if (block == Blocks.CACTUS) { // Paper pathtype = PathType.DANGER_CACTUS; diff --git a/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch b/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch index 203d865ff3..4f13ce1922 100644 --- a/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch +++ b/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch @@ -16,7 +16,7 @@ be having data corruption issues anyways. This provides a small boost to all setType calls. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 603ad2393..5d0ecb114 100644 +index 516656f8f..aa7f01f19 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/Don-t-sleep-after-profile-lookups-if-not-needed.patch index 83275ab228..3e96dbafbe 100644 --- a/Spigot-Server-Patches/Don-t-sleep-after-profile-lookups-if-not-needed.patch +++ b/Spigot-Server-Patches/Don-t-sleep-after-profile-lookups-if-not-needed.patch @@ -7,28 +7,28 @@ Mojang was sleeping even if we had no more requests to go after the current one finished, resulting in 100ms lost per profile lookup diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java -index 71e48e87b..23f1447cf 100644 +index 26a743722..6ed3199c3 100644 --- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java @@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { - } - - final int page = 0; + } + + final int page = 0; + boolean hasRequested = false; // Paper - - for (final List request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { - int failCount = 0; + + for (final List request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { + int failCount = 0; @@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { - LOGGER.debug("Couldn't find profile {}", name); - callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile")); - } + LOGGER.debug("Couldn't find profile {}", name); + callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile")); + } + // Paper start + if (!hasRequested) { + hasRequested = true; + continue; + } + // Paper end - - try { - Thread.sleep(DELAY_BETWEEN_PAGES); + + try { + Thread.sleep(DELAY_BETWEEN_PAGES); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch index 57e02900c5..7c3574036b 100644 --- a/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch +++ b/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't spam reload spawn chunks in nether/end diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 64482393d..1a1b40ac0 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -17,7 +17,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 BlockPosition blockposition = this.getSpawn(); int k = i * 16 + 8 - blockposition.getX(); diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index bd9c76ee8..ef5c7b1f6 100644 --- a/src/main/java/net/minecraft/server/WorldProvider.java +++ b/src/main/java/net/minecraft/server/WorldProvider.java @@ -0,0 +0,0 @@ public abstract class WorldProvider { diff --git a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch index d25de2a2c6..b8ea6a26b0 100644 --- a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch @@ -81,7 +81,7 @@ index 92acfa6fb..05509e4fd 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8ff542c88..bb76f56da 100644 +index 6c9d7df20..55cb7b88e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ @@ -112,9 +112,9 @@ index 8ff542c88..bb76f56da 100644 int k = MathHelper.floor(entity.locY / 16.0D); @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - for (int j = 0; j < i; ++j) { - List entityslice = aentityslice[j]; // Spigot + // CraftBukkit start + List entityslice = aentityslice[j]; // Spigot + // Paper start + DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode; + if (mode == DuplicateUUIDMode.WARN || mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.SAFE_REGEN) { @@ -160,10 +160,10 @@ index 8ff542c88..bb76f56da 100644 + } + // Paper end + List toRemove = new LinkedList<>(); this.world.a(entityslice.stream().filter((entity) -> { - return !(entity instanceof EntityHuman); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a402f71a9..6c427e9aa 100644 +index 1581edc4a..07cd5aa28 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -175,7 +175,7 @@ index a402f71a9..6c427e9aa 100644 this.uniqueID = uuid; this.au = this.uniqueID.toString(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 29c3a24f2..5557e9409 100644 +index 67ef109a5..66d2026d0 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -188,7 +188,7 @@ index 29c3a24f2..5557e9409 100644 public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0bb903aab..572c54c9c 100644 +index f37e85eb0..af9cdd9dc 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch index 72de910ca8..f3069224ae 100644 --- a/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch +++ b/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch @@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index bcfe4c1da..3a30349f4 100644 +index f1a162420..5d0e81731 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -15,13 +15,13 @@ index bcfe4c1da..3a30349f4 100644 private boolean unloadChunk0(int x, int z, boolean save) { + Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async - net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); + net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false); if (chunk == null) { return true; @@ -0,0 +0,0 @@ public class CraftWorld implements World { // If chunk had previously been queued to save, must do save to avoid loss of that data - return world.getChunkProviderServer().unloadChunk(chunk, chunk.mustSave || save); + return world.getChunkProvider().unloadChunk(chunk, chunk.mustSave || save); + }); return result != null ? result : false; // Paper - Ensure never async } diff --git a/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch index b62506c9cc..f285d527ef 100644 --- a/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 22f0673743..207f53a9c3 100644 +index e614ac33a..608f72f0f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Entity-Origin-API.patch b/Spigot-Server-Patches/Entity-Origin-API.patch index b6c55b0a3b..4e230857d7 100644 --- a/Spigot-Server-Patches/Entity-Origin-API.patch +++ b/Spigot-Server-Patches/Entity-Origin-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 792240f2e..65ba3fe66 100644 +index 7c2a8c5c8..cc6ae6634 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -51,7 +51,7 @@ index 792240f2e..65ba3fe66 100644 NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 25960cff2..1fb912eb0 100644 +index dc173e14f..596ac18a7 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -70,7 +70,7 @@ index 25960cff2..1fb912eb0 100644 public void a(boolean flag) { diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 5ceb3f206..87f3205f8 100644 +index 5dc52b6b8..2c28633c4 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { @@ -89,7 +89,7 @@ index 5ceb3f206..87f3205f8 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index 769d599c5..e37da10e0 100644 +index 1b72df8cd..ae8be435c 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -0,0 +0,0 @@ public class NBTTagList extends NBTList { @@ -101,7 +101,7 @@ index 769d599c5..e37da10e0 100644 if (i >= 0 && i < this.list.size()) { NBTBase nbtbase = (NBTBase)this.list.get(i); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 739e19bb1..21c9bb325 100644 +index 73c47c517..ab74b1add 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch index 588b06df6f..dc630d999e 100644 --- a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch +++ b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch @@ -14,7 +14,7 @@ Fix this by differing entity add to world for all entities at the same time the original entity is dead, overwrite it as the logic does for unloaod queued entities. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index a62d7196b..836aea6c3 100644 +index 4f01140e7..57e35564a 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -24,25 +24,31 @@ index a62d7196b..836aea6c3 100644 + List toAdd = new java.util.ArrayList<>(32); // Paper for (int j = 0; j < i; ++j) { - List entityslice = aentityslice[j]; // Spigot + // CraftBukkit start @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - thisChunk.put(entity.uniqueID, entity); } } -- // Paper end - + // Paper end +- +- List toRemove = new LinkedList<>(); - this.world.a(entityslice.stream().filter((entity) -> { +- if (!CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { +- toRemove.add(entity); +- return false; +- } - return !(entity instanceof EntityHuman); - })); -+ toAdd.addAll(entityslice); -+ // Paper end +- entityslice.removeAll(toRemove); + // CraftBukkit end } -+ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) ++ this.world.addChunkEntities(toAdd.stream() // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) ++ .filter((entity) -> CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) // Paper - Inline into stream ++ .filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) // CraftBukkit start org.bukkit.Server server = this.world.getServer(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 12379f755..72e74c59f 100644 +index 5e61826f6..bd6f64e52 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -68,7 +74,7 @@ index 12379f755..72e74c59f 100644 this.b(entity); }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 572c54c9c..0545336b4 100644 +index af9cdd9dc..10630ac96 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/EntityPathfindEvent.patch b/Spigot-Server-Patches/EntityPathfindEvent.patch index a03b7d4401..5a3d17365c 100644 --- a/Spigot-Server-Patches/EntityPathfindEvent.patch +++ b/Spigot-Server-Patches/EntityPathfindEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent Fires when an Entity decides to start moving to a location. diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 5d6f726d05..a8b070ed32 100644 +index 0600fe23a..53f1c25d2 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -25,7 +25,7 @@ index 5d6f726d05..a8b070ed32 100644 + if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper this.q = blockposition; float fx = this.j(); - this.b.methodProfiler.a("pathfind"); + this.b.methodProfiler.enter("pathfind"); @@ -0,0 +0,0 @@ public abstract class NavigationAbstract { if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { return this.c; @@ -33,5 +33,5 @@ index 5d6f726d05..a8b070ed32 100644 + if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper this.q = blockposition; float fx = this.j(); - this.b.methodProfiler.a("pathfind"); + this.b.methodProfiler.enter("pathfind"); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch index 16ce92ed51..ccce0d4496 100644 --- a/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b80315bc5..a30d92ce7 100644 +index 5f386ff04..55e45dbb1 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -34,7 +34,7 @@ index b80315bc5..a30d92ce7 100644 if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e1c09452b..84bde3ef2 100644 +index 8c4b7aee6..c844c4579 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch index 8049b29b3c..a0679dd3d8 100644 --- a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch @@ -7,16 +7,16 @@ Fired when the server is about to merge 2 experience orbs Plugins can cancel this if they want to ensure experience orbs do not lose important metadata such as spawn reason, or conditionally move data from source to target. -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2ddc3f050..a14518ba6 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 14df8e80b..9578e9d2e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -0,0 +0,0 @@ public class CraftEventFactory { if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; // Paper start - if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) { -+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { ++ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { // Paper long newTotal = (long)xp.value + (long)loopItem.value; if ((int) newTotal < 0) continue; // Overflow if (maxValue > 0 && newTotal > (long)maxValue) { diff --git a/Spigot-Server-Patches/Expose-server-CommandMap.patch b/Spigot-Server-Patches/Expose-server-CommandMap.patch index 178a2af4cb..005d244c35 100644 --- a/Spigot-Server-Patches/Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/Expose-server-CommandMap.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2bc16fb1a..cd17cdcf3 100644 +index 6700ce84c..71bd5bc71 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Fire-EntityCombustEvent-for-phantoms.patch b/Spigot-Server-Patches/Fire-EntityCombustEvent-for-phantoms.patch index 9e6985bf0b..e59e3eeba7 100644 --- a/Spigot-Server-Patches/Fire-EntityCombustEvent-for-phantoms.patch +++ b/Spigot-Server-Patches/Fire-EntityCombustEvent-for-phantoms.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Fire EntityCombustEvent for phantoms diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 8332d5cc8..dd7dcfbf1 100644 +index 7a48719c9..d7be396ee 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java @@ -0,0 +0,0 @@ public class EntityPhantom extends EntityFlying implements IMonster { - public void k() { + public void movementTick() { if (this.dq()) { - this.setOnFire(8); + // Paper start - fire EntityCombustEvent @@ -21,5 +21,5 @@ index 8332d5cc8..dd7dcfbf1 100644 + // Paper end } - super.k(); + super.movementTick(); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch index 8a50b88c34..e03cc4742f 100644 --- a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch +++ b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch @@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added. Also add debug if something else tries to, and abort before world gets bad state diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 4a0f3989e6..695044b1b1 100644 +index 3b39b5472..6093ae408 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -21,15 +21,15 @@ index 4a0f3989e6..695044b1b1 100644 Iterator iterator = entity.bP().iterator(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d31101861c..a81c7dfa2e 100644 +index 6f672aa22..0d04b14cf 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot - if (entity == null) return false; + if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper - - org.bukkit.event.Cancellable event = null; - if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) { + if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { + return false; + } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch index 070d12a27b..73073277ec 100644 --- a/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c92df00e8..44ed34174 100644 +index 65973edfc..cb62af425 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.c("blockEntities"); + this.methodProfiler.exitEnter("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { - this.tileEntityListTick.removeAll(this.tileEntityListUnload); diff --git a/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch b/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch index 8c0a0f3384..20dd7ee292 100644 --- a/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch +++ b/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch @@ -14,7 +14,7 @@ This fix always sends chunks to the client, and simply updates the client anytime post processing is triggered with the new chunk data. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 5d0ecb114..d36c79732 100644 +index aa7f01f19..e3d97757f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -41,7 +41,7 @@ index 5d0ecb114..d36c79732 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index cbff0d946..3ac09b91f 100644 +index e61538b3c..f5d971bbe 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -0,0 +0,0 @@ public class PlayerChunk { @@ -50,9 +50,9 @@ index cbff0d946..3ac09b91f 100644 private long i; - private boolean done; + boolean done; // Paper - package-private - - // CraftBukkit start - add fields - // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse + boolean chunkExists; // Paper + // Paper start + PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest; @@ -0,0 +0,0 @@ public class PlayerChunk { } } diff --git a/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch b/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch index 97c473ff28..689eeee263 100644 --- a/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch +++ b/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch @@ -6,22 +6,27 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling Only process drops when the block is actually going to be removed diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java -index afd3f32d0..2aa9b68b8 100644 +index 9c508caa9..4b762a92c 100644 --- a/src/main/java/net/minecraft/server/BlockSponge.java +++ b/src/main/java/net/minecraft/server/BlockSponge.java @@ -0,0 +0,0 @@ public class BlockSponge extends Block { - Material material = iblockdata.getMaterial(); - - if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) { -- iblockdata.a(world, blockposition2, 0); -+ // Paper start -+ if (block.getHandle().getMaterial() == Material.AIR) { -+ iblockdata.dropNaturally(world, blockposition2, 0); -+ } -+ // Paper end + } else if (iblockdata.getBlock() instanceof BlockFluids) { + // NOP + } else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) { +- iblockdata.a(world, blockposition2, 0); ++ // Paper start ++ if (block.getHandle().getMaterial() == Material.AIR) { ++ iblockdata.dropNaturally(world, blockposition2, 0); ++ } ++ // Paper end + } } - world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag()); +@@ -0,0 +0,0 @@ public class BlockSponge extends Block { + return i > 0; + } + } ++ diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java index 2d855aae6..bc345a2c3 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java diff --git a/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch b/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch index 82bb0c900d..ac4a9e471a 100644 --- a/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch +++ b/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch @@ -18,7 +18,7 @@ This change ensures the chunks are always loaded when entities are added to the world, or a valid entity moves between chunks. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3c99ae7cd..2b9da597a 100644 +index 4421be836..d084787f1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -31,7 +31,7 @@ index 3c99ae7cd..2b9da597a 100644 // Paper start - Set origin location when the entity is being added to the world if (entity.origin == null) { @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.getChunkAt(entity.ae, entity.ag).a(entity, entity.af); + this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY); } - if (!entity.bN() && !this.isChunkLoaded(i, k, true)) { diff --git a/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch index 141f347dcb..2150d13987 100644 --- a/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e5ba6eddd..c7d11cf62 100644 +index d564aaf60..92e3a49e2 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -0,0 +0,0 @@ public class Explosion { @@ -25,7 +25,7 @@ index e5ba6eddd..c7d11cf62 100644 for (int l1 = 0; l1 < list.size(); ++l1) { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 30f8ec519..b1d05220b 100644 +index 2e2fb85cf..7b7fd6b9b 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -0,0 +0,0 @@ public final class IEntitySelector { @@ -42,8 +42,8 @@ index 30f8ec519..b1d05220b 100644 - // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable Entity object) { // Paper - decompile error - return this.a((Entity)object); - } +- return this.test((Entity)object); +- } } + } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch index 87313da52a..9bce99e3af 100644 --- a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/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 8a6589d95..9df2296dd 100644 +index ffda9d793..4acb908ec 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -36,8 +36,8 @@ index 8a6589d95..9df2296dd 100644 @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } - private boolean aT() { -- return SystemUtils.b() < this.aa; + private boolean canSleepForTick() { +- return SystemUtils.getMonotonicMillis() < this.nextTick; + return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own } @@ -157,11 +157,11 @@ index 8a6589d95..9df2296dd 100644 - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time - this.a(this::aT); - this.aa += 50L; + this.a(this::canSleepForTick); + this.nextTick += 50L; // Spigot end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 29b016e17..cf1db412e 100644 +index ed0221f0d..212e3cd4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/GH-806-Respect-saving-disabled-before-unloading-all-.patch b/Spigot-Server-Patches/GH-806-Respect-saving-disabled-before-unloading-all-.patch index 3e604eea41..cf7a027ca1 100644 --- a/Spigot-Server-Patches/GH-806-Respect-saving-disabled-before-unloading-all-.patch +++ b/Spigot-Server-Patches/GH-806-Respect-saving-disabled-before-unloading-all-.patch @@ -9,7 +9,7 @@ This behavior causes a save to occur even though saving was supposed to be turne It's triggered when Hell/End worlds are empty of players. diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index e5605c309..9d971a9c5 100644 +index c3ac66d35..5935bae58 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { @@ -18,7 +18,7 @@ index e5605c309..9d971a9c5 100644 - if (!worldprovider.canRespawn()) { + if (!worldprovider.canRespawn() && !this.world.savingDisabled) { // Paper - respect saving disabled setting - this.world.getChunkProviderServer().b(); + this.world.getChunkProvider().b(); } } // Paper timing -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch b/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch index de0e909e17..203c8ead4c 100644 --- a/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch +++ b/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch @@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet, split the inventory set into multiple packets instead. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 97a9dffe6..2f887932b 100644 +index 120416b30..065bede4c 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -44,7 +44,7 @@ index 2e42c268b..0a9bfb07a 100644 return false; } diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index c20911c96..c22c3eebc 100644 +index 3448f6c53..484131e65 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -64,10 +64,12 @@ index c20911c96..c22c3eebc 100644 + // Paper start + private static int MAX_PACKET_SIZE = 2097152; ++ + public static class PacketTooLargeException extends RuntimeException { + private final Packet packet; ++ + PacketTooLargeException(Packet packet, int packetLength) { -+ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength +". Max is " + MAX_PACKET_SIZE); ++ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength + ". Max is " + MAX_PACKET_SIZE); + this.packet = packet; + } + @@ -76,10 +78,7 @@ index c20911c96..c22c3eebc 100644 + } + } + // Paper end -+ - // $FF: synthetic method - protected void encode(ChannelHandlerContext channelhandlercontext, Packet object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix - this.a(channelhandlercontext, (Packet)object, bytebuf); + } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java index 40ec398ee..ca6bcd22f 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java diff --git a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch index 127dd779da..06b63c4608 100644 --- a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch @@ -23,7 +23,7 @@ index 56700fc59..9b9c8361e 100644 MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 715ab15e3..df23b5c4f 100644 +index 469dce5df..f1abcadcc 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -35,7 +35,7 @@ index 715ab15e3..df23b5c4f 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1d7188b2e..ccdb1ba01 100644 +index f5f1452b7..762ae7366 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -71,7 +71,7 @@ index 1d7188b2e..ccdb1ba01 100644 if (entity instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a05320c90..2acd8a4b3 100644 +index a41716fd4..20fb157fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch index 77073a4da2..026983bd34 100644 --- a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch @@ -177,7 +177,7 @@ index 000000000..26e3031d2 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 34ba382a4..c3efb5e1b 100644 +index 906bd973d..9b823d4ca 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ @@ -191,25 +191,12 @@ index 34ba382a4..c3efb5e1b 100644 @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (i - this.Y >= 5000000000L) { this.Y = i; - this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.z(), this.y())); -- GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), 12)]; -+ GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), org.spigotmc.SpigotConfig.playerSample)]; // Paper - int j = MathHelper.nextInt(this.n, 0, this.y() - agameprofile.length); + this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount())); +- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)]; ++ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + int j = MathHelper.nextInt(this.n, 0, this.getPlayerCount() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { -@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - return "1.13.2"; - } - -+ public int getPlayerCount() { return y(); } // Paper - OBFHELPER - public int y() { - return this.s.getPlayerCount(); - } - -+ public int getMaxPlayers() { return z(); } // Paper - OBFHELPER - public int z() { - return this.s.getMaxPlayers(); - } diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java index c9edd289a..8aa121e2f 100644 --- a/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -234,7 +221,7 @@ index c9edd289a..8aa121e2f 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 615aa2cd0..408aad098 100644 +index c338d09bf..087f5fe0d 100644 --- a/src/main/java/net/minecraft/server/ServerPing.java +++ b/src/main/java/net/minecraft/server/ServerPing.java @@ -0,0 +0,0 @@ public class ServerPing { diff --git a/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index d8651535db..3ab1b0319a 100644 --- a/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d245502286..816854dc2f 100644 +index 1185769ca..443a089d8 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -30,7 +30,7 @@ index d245502286..816854dc2f 100644 ItemStack itemstack1 = this.a(entityitem); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index c5bfe6630d..4f2d7db378 100644 +index 08d923563..6d9c80489 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -0,0 +0,0 @@ public class EntityTrackerEntry { @@ -43,7 +43,7 @@ index c5bfe6630d..4f2d7db378 100644 ItemStack itemstack = entityitemframe.getItem(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 264dc740cb..8aa4138a2e 100644 +index 9c5f520f1..5d7370029 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -55,7 +55,7 @@ index 264dc740cb..8aa4138a2e 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index bf7963b421..338d753500 100644 +index 5c09085a6..a819d6037 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { @@ -88,7 +88,7 @@ index bf7963b421..338d753500 100644 + public void updateSeenPlayers(EntityHuman entityhuman, ItemStack itemstack) { a(entityhuman, itemstack); } // Paper - OBFHELPER public void a(EntityHuman entityhuman, ItemStack itemstack) { - if (!this.j.containsKey(entityhuman)) { + if (!this.humans.containsKey(entityhuman)) { WorldMap.WorldMapHumanTracker worldmap_worldmaphumantracker = new WorldMap.WorldMapHumanTracker(entityhuman); @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { @@ -127,7 +127,7 @@ index bf7963b421..338d753500 100644 for ( org.bukkit.map.MapCursor cursor : render.cursors) { diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java -index 256a131781..5768cd512e 100644 +index 256a13178..5768cd512 100644 --- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java +++ b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java @@ -0,0 +0,0 @@ import org.bukkit.map.MapCursor; diff --git a/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index ca4a4b6582..07ccfbf268 100644 --- a/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3f17fbd37..dfedd4c30 100644 +index 7061075b5..0dd52f859 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Improve-death-events.patch b/Spigot-Server-Patches/Improve-death-events.patch index a65a66b5be..0282f9e35c 100644 --- a/Spigot-Server-Patches/Improve-death-events.patch +++ b/Spigot-Server-Patches/Improve-death-events.patch @@ -27,7 +27,7 @@ index 9a74601b0..6e60d15cc 100644 int i = this.f ? 300 : 100; if (this.g && (!this.b.isAlive() || this.b.ticksLived - this.c > i)) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index da0e9b0a3..ab8490ff9 100644 +index 67ea54987..7fc56cadc 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -69,15 +69,15 @@ index c5bddb1da..0a9666541 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5ea5d4b78..46a4e37a2 100644 +index 3ef68fec7..716f0e67f 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { public float aU; public EntityHuman killer; public int lastDamageByPlayerTime; // Paper - public -- protected boolean aX; -+ protected boolean aX; protected void setDying(boolean dying) { this.aX = dying; } protected boolean isDying() { return this.aX; } // Paper - OBFHELPER +- protected boolean killed; ++ protected boolean killed; protected void setDying(boolean dying) { this.killed = dying; } protected boolean isDying() { return this.killed; } // Paper - OBFHELPER protected int ticksFarFromPlayer; protected float aZ; protected float ba; @@ -138,9 +138,8 @@ index 5ea5d4b78..46a4e37a2 100644 + // entity.b(this); + //} -- this.aX = true; + this.killed = true; - this.getCombatTracker().g(); -+ this.aX = true; // Paper - Always set at start, unset later if cancelled - GH-1432 + //this.getCombatTracker().g(); + + org.bukkit.event.entity.EntityDeathEvent deathEvent = null; @@ -207,7 +206,7 @@ index 5ea5d4b78..46a4e37a2 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6933d8876..d429e552e 100644 +index bf842a0a9..b5d48e7bf 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -306,7 +305,7 @@ index 8be0a47ba..f56ef6f71 100644 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 cd6ae3b8e..4a0a456a0 100644 +index c6cd2f3be..f87d2bed7 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index be00c0a25d..46cf20fe41 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 9430bccf6..aedf31a07 100644 +index 9d3234c1c..9b88a4190 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -29,7 +29,7 @@ index 9430bccf6..aedf31a07 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 2bab2ab92..20a46e2af 100644 +index 82e85a035..752848323 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,7 +56,7 @@ index 2bab2ab92..20a46e2af 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a615d7867..6933d8876 100644 +index 5bd65ddbb..bf842a0a9 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -110,7 +110,7 @@ index a615d7867..6933d8876 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 871dea68f..30d5c1734 100644 +index 159a30e0e..a66f8ab2c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -123,7 +123,7 @@ index 871dea68f..30d5c1734 100644 this.player.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 64a86b699..e6ee5042c 100644 +index 08bbd86d1..6311c9f87 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -168,7 +168,7 @@ index 8699cc72f..0f1d700c7 100644 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index dfedd4c30..b220895c2 100644 +index 0dd52f859..dcd628104 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Lighting-Queue.patch b/Spigot-Server-Patches/Lighting-Queue.patch index b2cf20b6ea..76f5ddb3ba 100644 --- a/Spigot-Server-Patches/Lighting-Queue.patch +++ b/Spigot-Server-Patches/Lighting-Queue.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Lighting Queue This provides option to queue lighting updates to ensure they do not cause the server lag diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 145cb274b..eff9dcf54 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -0,0 +0,0 @@ public class WorldTimingsHandler { @@ -28,7 +28,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index fe148495b..cc69ff3a4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -46,7 +46,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 boolean timings = getBoolean("timings.enabled", true); boolean verboseTimings = getBoolean("timings.verbose", true); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 39d565db1..8f6f0288b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -63,7 +63,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index da2548603..87ec4d1a2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -77,7 +77,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { private void g(boolean flag) { - this.world.methodProfiler.a("recheckGaps"); + this.world.methodProfiler.enter("recheckGaps"); - if (this.world.areChunksLoaded(new BlockPosition(this.locX * 16 + 8, 0, this.locZ * 16 + 8), 16)) { + if (this.areNeighborsLoaded(1)) { // Paper for (int i = 0; i < 16; ++i) { @@ -126,7 +126,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 IMMEDIATE, QUEUED, CHECK; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 60abc5f28..6a9b9fa2a 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -138,21 +138,21 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Update neighbor counts for (int x = -2; x < 3; x++) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 4acb908ec..194f8441e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati protected void a(BooleanSupplier booleansupplier) { co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot -- long i = SystemUtils.c(); -+ long i = SystemUtils.c(); long startTime = i; // Paper +- long i = SystemUtils.getMonotonicNanos(); ++ long i = SystemUtils.getMonotonicNanos(); long startTime = i; // Paper ++this.ticks; if (this.S) { @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot + PaperLightingQueue.processQueue(startTime); // Paper this.slackActivityAccountant.tickEnded(l); // Spigot @@ -160,7 +160,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java new file mode 100644 -index 7ac07ac07ac0..7ac07ac07ac0 +index 000000000..9783f3a0d --- /dev/null +++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java @@ -0,0 +0,0 @@ @@ -189,7 +189,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 + continue; + } + -+ ObjectCollection loadedChunks = ((WorldServer) world).getChunkProviderServer().chunks.values(); ++ ObjectCollection loadedChunks = ((WorldServer) world).getChunkProvider().chunks.values(); + for (Chunk chunk : loadedChunks.toArray(new Chunk[0])) { + if (chunk.lightingQueue.processQueue(startTime, maxTickTime)) { + break START; @@ -263,16 +263,16 @@ index 7ac07ac07ac0..7ac07ac07ac0 + } +} diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 5d5a9f0bb..69f55d0dd 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) { - this.methodProfiler.a("checkLight"); + this.methodProfiler.enter("checkLight"); - this.r(blockposition); + chunk.runOrQueueLightUpdate(() -> this.r(blockposition)); // Paper - Queue light update - this.methodProfiler.e(); + this.methodProfiler.exit(); } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch index 565726ae69..5a27bf7efc 100644 --- a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch @@ -69,7 +69,7 @@ index afbe43dd3..d732be52e 100644 --this.lifeTicks; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index af68074c1..899c7f5f7 100644 +index 27c8a97be..63c802d02 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch b/Spigot-Server-Patches/MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch index 111f9ef4ac..7fe5b4997b 100644 --- a/Spigot-Server-Patches/MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch +++ b/Spigot-Server-Patches/MC-2025-Save-and-load-entity-AABB-to-prevent-wobble.patch @@ -46,7 +46,7 @@ index bf538684a..19819b134 100644 public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5) { this.minX = Math.min(d0, d3); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 80d384dfe..da0e9b0a3 100644 +index c083b2dd3..67ea54987 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/MC-Dev-fixes.patch b/Spigot-Server-Patches/MC-Dev-fixes.patch index 0840420295..6d94e8052e 100644 --- a/Spigot-Server-Patches/MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/MC-Dev-fixes.patch @@ -5,31 +5,33 @@ Subject: [PATCH] MC Dev fixes diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index a553fb747..4048937c6 100644 +index 25a1edc45..f1ad18511 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { + return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); } - // $FF: synthetic method +- // $FF: synthetic method - public int compareTo(Object object) { -+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix - return this.l((BaseBlockPosition)object); - } +- return this.compareTo((BaseBlockPosition)object); +- } } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7f8802b2e..6ffc53514 100644 +index 66c38df1f..50e29464b 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + } } - // $FF: synthetic method +- // $FF: synthetic method - protected Object computeNext() { -+ protected BlockPosition computeNext() { // Paper - decompile fix - return this.a(); - } +- return this.computeNext(); +- } }; + }; + } @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { if (this.g.b < l) { ++this.g.b; @@ -43,14 +45,70 @@ index 7f8802b2e..6ffc53514 100644 } @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + } } - // $FF: synthetic method +- // $FF: synthetic method - protected Object computeNext() { -+ protected BlockPosition.MutableBlockPosition computeNext() { // Paper - decompile fix - return this.a(); - } +- return this.computeNext(); +- } }; + }; + } + +- // $FF: synthetic method +- public BaseBlockPosition d(BaseBlockPosition baseblockposition) { +- return this.d(baseblockposition); +- } + + public static class MutableBlockPosition extends BlockPosition { + protected int b; +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + return new BlockPosition(this); + } + +- // $FF: synthetic method +- public BaseBlockPosition d(BaseBlockPosition baseblockposition) { +- return super.d(baseblockposition); +- } + } + + public static final class b extends BlockPosition.MutableBlockPosition implements AutoCloseable { +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + } + } + +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition d(int i, int j, int k) { +- return this.d(i, j, k); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) { +- return this.c(enumdirection, i); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection) { +- return this.c(enumdirection); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition g(BaseBlockPosition baseblockposition) { +- return this.g(baseblockposition); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) { +- return this.c(d0, d1, d2); +- } +- +- // $FF: synthetic method +- public BlockPosition.MutableBlockPosition c(int i, int j, int k) { +- return this.c(i, j, k); +- } + } + } diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java index 3bd0c56d4..304e47bf2 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -139,7 +197,7 @@ index 8bfa218a6..e2e60d3ed 100644 arraylist.add(definedstructure$a); diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index 5c2d50f97..fd6df39f1 100644 +index 6695f8d77..e1ea8da88 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -0,0 +0,0 @@ public class EnchantmentManager { @@ -200,76 +258,101 @@ index 04cff50cb..e746a6a0d 100644 EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX, this.locY, this.locZ); entityareaeffectcloud.setSource(this.shooter); entityareaeffectcloud.setParticle(Particles.j); +diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java +index 4dee04581..9c48bb3c9 100644 +--- a/src/main/java/net/minecraft/server/EntityLlama.java ++++ b/src/main/java/net/minecraft/server/EntityLlama.java +@@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + public void s(boolean var1) { + } + +- // $FF: synthetic method +- public EntityAgeable createChild(EntityAgeable entityageable) { +- return this.createChild(entityageable); +- } +- + static class a extends PathfinderGoalNearestAttackableTarget { + public a(EntityLlama entityllama) { + super(entityllama, EntityWolf.class, 16, false, true, (Predicate)null); diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 38c85f4ab..c0853f0fc 100644 +index 23ca6fc50..44c91ba26 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { + return d0; } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return super.a((EnumDirection)object); - } +- return super.test((EnumDirection)object); +- } }, + Y("y") { + public int a(int var1, int i, int var3) { @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { + return d0; } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return super.a((EnumDirection)object); - } +- return super.test((EnumDirection)object); +- } }, + Z("z") { + public int a(int var1, int var2, int i) { @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { + return d0; } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return super.a((EnumDirection)object); - } +- return super.test((EnumDirection)object); +- } }; + + private static final Map d = (Map)Arrays.stream(values()).collect(Collectors.toMap(EnumDirection.EnumAxis::a, (enumdirection$enumaxis) -> { @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { + public abstract double a(double var1, double var3, double var5); - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return this.a((EnumDirection)object); - } +- return this.test((EnumDirection)object); +- } } + + public static enum EnumAxisDirection { @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { + return Iterators.forArray(this.c); } - // $FF: synthetic method +- // $FF: synthetic method - public boolean test(@Nullable Object object) { -+ public boolean test(@Nullable EnumDirection object) { // Paper - decompile fix - return this.a((EnumDirection)object); - } +- return this.test((EnumDirection)object); +- } } + } diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java -index 3f5d6c323..286c1b14f 100644 +index 0e0571a6c..8fc45c697 100644 --- a/src/main/java/net/minecraft/server/IChatBaseComponent.java +++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java @@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, Iterable { @@ -350,21 +433,8 @@ index 86881a22d..81ff1fd69 100644 byte[] abyte = new byte[this.data.length]; System.arraycopy(this.data, 0, abyte, 0, this.data.length); -diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java -index 40f6179cd..ebc44ec9e 100644 ---- a/src/main/java/net/minecraft/server/NBTTagIntArray.java -+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java -@@ -0,0 +0,0 @@ public class NBTTagIntArray extends NBTList { - return this.a(i); - } - -- public NBTBase clone() { -+ public NBTTagIntArray clone() { // Paper - decompile fix - return this.c(); - } - } diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index 24a66f95a..2e7c96056 100644 +index 8e6cce15f..1b72df8cd 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -377,9 +447,14 @@ index 24a66f95a..2e7c96056 100644 public NBTTagList() { @@ -0,0 +0,0 @@ public class NBTTagList extends NBTList { - return this.c(); + return this.type; } +- // $FF: synthetic method +- public NBTBase clone() { +- return this.clone(); +- } +- + /* // Paper start - Decompile fix // $FF: synthetic method public Object remove(int i) { @@ -391,17 +466,36 @@ index 24a66f95a..2e7c96056 100644 + */ // Paper end - Decompile fix } diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 113e8780a..8e312c761 100644 +index a717ad95f..ff7e20dfc 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder> { + } } - // $FF: synthetic method +- // $FF: synthetic method - protected void encode(ChannelHandlerContext channelhandlercontext, Object object, ByteBuf bytebuf) throws Exception { -+ protected void encode(ChannelHandlerContext channelhandlercontext, Packet object, ByteBuf bytebuf) throws Exception { // Paper - decompiler fix - this.a(channelhandlercontext, (Packet)object, bytebuf); +- this.encode(channelhandlercontext, (Packet)object, bytebuf); +- } + } +diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java +index 8bc7c0ccd..faaad0f41 100644 +--- a/src/main/java/net/minecraft/server/ProtoChunk.java ++++ b/src/main/java/net/minecraft/server/ProtoChunk.java +@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { + public void b(boolean flag) { + this.u = flag; } +- +- // $FF: synthetic method +- public TickList l() { +- return this.l(); +- } +- +- // $FF: synthetic method +- public TickList k() { +- return this.k(); +- } } diff --git a/src/main/java/net/minecraft/server/Registry.java b/src/main/java/net/minecraft/server/Registry.java index 5be9f0ff2..9efec49d6 100644 @@ -444,65 +538,91 @@ index 03c603362..d03ac0e70 100644 this.b = (K[])(new Object[i]); this.c = new int[i]; diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 7b8a8064b..615aa2cd0 100644 +index 364dadfbd..c338d09bf 100644 --- a/src/main/java/net/minecraft/server/ServerPing.java +++ b/src/main/java/net/minecraft/server/ServerPing.java @@ -0,0 +0,0 @@ public class ServerPing { + return jsonobject; } - // $FF: synthetic method +- // $FF: synthetic method - public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix - return this.a((ServerPing)object, type, jsonserializationcontext); - } - - // $FF: synthetic method +- return this.serialize((ServerPing)object, type, jsonserializationcontext); +- } +- +- // $FF: synthetic method - public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); +- return this.deserialize(jsonelement, type, jsondeserializationcontext); +- } + } + + public static class ServerData { +@@ -0,0 +0,0 @@ public class ServerPing { + return jsonobject; + } + +- // $FF: synthetic method +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { +- return this.serialize((ServerPing.ServerData)object, type, jsonserializationcontext); +- } +- +- // $FF: synthetic method +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { +- return this.deserialize(jsonelement, type, jsondeserializationcontext); +- } } } + @@ -0,0 +0,0 @@ public class ServerPing { + return jsonobject; } - // $FF: synthetic method +- // $FF: synthetic method - public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix - return this.a((ServerPing.ServerData)object, type, jsonserializationcontext); - } - - // $FF: synthetic method +- return this.serialize((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext); +- } +- +- // $FF: synthetic method - public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } - } -@@ -0,0 +0,0 @@ public class ServerPing { - } - - // $FF: synthetic method -- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { -+ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) {// Paper - Decompile fix - return this.a((ServerPing.ServerPingPlayerSample)object, type, jsonserializationcontext); - } - - // $FF: synthetic method -- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { -+ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {// Paper - Decompile fix - return this.a(jsonelement, type, jsondeserializationcontext); - } +- return this.deserialize(jsonelement, type, jsondeserializationcontext); +- } } + } + } diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index ef9d8e06f..0c9910d9a 100644 +index 475bf35fa..78234cbdd 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java @@ -0,0 +0,0 @@ public class ShapeDetector { + return new ShapeDetectorBlock(this.a, blockposition, this.b); } - // $FF: synthetic method +- // $FF: synthetic method - public Object load(Object object) throws Exception { -+ public ShapeDetectorBlock load(BlockPosition object) throws Exception {// Paper - Decompile fix - return this.a((BlockPosition)object); - } +- return this.load((BlockPosition)object); +- } } + + public static class ShapeDetectorCollection { +diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java +index c1bbacfc1..f0a826cd1 100644 +--- a/src/main/java/net/minecraft/server/WorldPersistentData.java ++++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +@@ -0,0 +0,0 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; + import java.io.DataInputStream; ++import java.io.DataOutput; + import java.io.DataOutputStream; + import java.io.File; + import java.io.FileInputStream; +@@ -0,0 +0,0 @@ public class WorldPersistentData { + } + + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1)); +- NBTCompressedStreamTools.a(nbttagcompound, dataoutputstream); ++ NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); // Paper - decompile fix + dataoutputstream.close(); + } + } catch (Exception exception) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index c099756ff3..28be13076b 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -5,7 +5,7 @@ Subject: [PATCH] MC Utils diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 1c1a6a37a..0929e0189 100644 --- a/src/main/java/net/minecraft/server/AttributeInstance.java +++ b/src/main/java/net/minecraft/server/AttributeInstance.java @@ -0,0 +0,0 @@ public interface AttributeInstance { @@ -20,7 +20,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 void b(UUID var1); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 50e29464b..880ce16b1 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -65,10 +65,10 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 773a8c52d..5dd08018c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -0,0 +0,0 @@ import com.google.common.collect.Lists; // CraftBukkit +@@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent; public class Chunk implements IChunkAccess { private static final Logger d = LogManager.getLogger(); @@ -86,7 +86,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 744762b8b..d9608121b 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -0,0 +0,0 @@ public class ChunkCoordIntPair { @@ -99,7 +99,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return (long)i & 4294967295L | ((long)j & 4294967295L) << 32; } diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 3919c1fba..772382144 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -112,7 +112,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 private final IChunkLoader e; private final IAsyncTaskHandler f; diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 95ca5f6d8..0dc948a37 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -0,0 +0,0 @@ public class DataBits { @@ -124,7 +124,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.a; } diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7f905b1e0..fa5b9262b 100644 --- a/src/main/java/net/minecraft/server/DataPalette.java +++ b/src/main/java/net/minecraft/server/DataPalette.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -142,7 +142,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 void b(PacketDataSerializer var1); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 304e47bf2..6e7454b13 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -0,0 +0,0 @@ import java.util.function.Function; @@ -184,7 +184,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 this.b(); packetdataserializer.writeByte(this.i); diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 372afbe94..20b7c2c6d 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -196,7 +196,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 550c7a355..b039ff1b5 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -208,7 +208,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // CraftBukkit start - fire event setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 341af9c16..14c481220 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -220,7 +220,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index c9e596367..70830bbf4 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -0,0 +0,0 @@ @@ -239,7 +239,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return SoundCategory.HOSTILE; } diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index bcdc790ba..339abdc01 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -290,7 +290,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 // Paper end } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index ac081d230..faae6d09d 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -0,0 +0,0 @@ import org.bukkit.TreeType; @@ -321,7 +321,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 -index 7ac07ac07ac0..7ac07ac07ac0 +index 000000000..c97e116aa --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ @@ -642,7 +642,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 + } +} diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 447b56323..db4e4b859 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -687,18 +687,18 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 } } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index db52ffad4..d5bbc5f8e 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { return new DefaultEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build()); }); private final EnumProtocolDirection h; -- private final Queue i = Queues.newConcurrentLinkedQueue(); -+ private final Queue i = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.i; } // Paper - OBFHELPER +- private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); ++ private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); private final Queue getPacketQueue() { return this.packetQueue; } // Paper - OBFHELPER private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); public Channel channel; - // Spigot Start // PAIL + public SocketAddress socketAddress; @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } @@ -728,7 +728,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 public QueuedPacket(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { this.a = packet; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 7582151ae..d05f1e02c 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf { @@ -740,7 +740,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 for (int j = 1; j < 5; ++j) { if ((i & -1 << j * 7) == 0) { diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index ff7e20dfc..3448f6c53 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -752,7 +752,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 throw new SkipEncodeException(throwable); } else { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 12d6c99cf..af382815f 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { @@ -773,24 +773,24 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 int j = 0; ChunkSection[] achunksection = chunk.getSections(); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index bbc8c0007..2b6c797ce 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; -- private long f; -- private boolean g; +- private long lastKeepAlive; +- private boolean awaitingKeepAlive; - private long h; -+ private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER -+ private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER ++ private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER ++ private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER + private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER // CraftBukkit start - multithreaded fields private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 8fce3b022..58ac6eafc 100644 --- a/src/main/java/net/minecraft/server/PotionUtil.java +++ b/src/main/java/net/minecraft/server/PotionUtil.java @@ -0,0 +0,0 @@ public class PotionUtil { @@ -802,7 +802,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry); if (potionregistry == Potions.EMPTY) { diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index a21006290..6c6f006f3 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java @@ -0,0 +0,0 @@ public class RegistryBlockID implements Registry { @@ -814,7 +814,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 return this.b.size(); } diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 25d4907b3..1f6de76a7 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java @@ -0,0 +0,0 @@ public class SystemUtils { @@ -831,17 +831,12 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 @@ -0,0 +0,0 @@ public class SystemUtils { } - public static long b() { -- return c() / 1000000L; -+ return System.nanoTime() / 1000000L; // Paper - } - - public static long c() { + public static long getMonotonicNanos() { - return a.getAsLong(); + return System.nanoTime(); // Paper } - public static long d() { + public static long getTimeMillis() { @@ -0,0 +0,0 @@ public class SystemUtils { futuretask.run(); return (V)futuretask.get(); diff --git a/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch index c735c939b3..bc2808b8f5 100644 --- a/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ b/Spigot-Server-Patches/Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -6,15 +6,15 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4b8b66352..7e6a7b0e9 100644 +index 91404cc5a..5552b64fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp( "chunk load"); // Spigot chunkLoadCount++; -- return world.getChunkProviderServer().getChunkAt(x, z, true, generate) != null; -+ return world.getChunkProviderServer().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper +- return world.getChunkProvider().getChunkAt(x, z, true, generate) != null; ++ return world.getChunkProvider().getChunkAt(x, z, true, generate || isChunkGenerated(x, z)) != null; // Paper } public boolean isChunkLoaded(Chunk chunk) { diff --git a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch index eb50a705a3..05e36067df 100644 --- a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch @@ -28,11 +28,11 @@ respond to the request. [2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13 diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 5691d0aea..aafca9c9c 100644 +index cb2b9c368..976888b66 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java -@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; - public class LegacyPingHandler extends ChannelInboundHandlerAdapter { +@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + private static final Logger a = LogManager.getLogger(); private final ServerConnection b; + private ByteBuf buf; // Paper @@ -40,9 +40,9 @@ index 5691d0aea..aafca9c9c 100644 public LegacyPingHandler(ServerConnection serverconnection) { this.b = serverconnection; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - public void channelRead(ChannelHandlerContext channelhandlercontext, Object object) throws Exception { - ByteBuf bytebuf = (ByteBuf)object; + ByteBuf bytebuf = (ByteBuf) object; + + // Paper start - Make legacy ping handler more reliable + if (this.buf != null) { + try { @@ -57,24 +57,24 @@ index 5691d0aea..aafca9c9c 100644 boolean flag = true; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - this.a(channelhandlercontext, this.a(s)); - break; - default: -+ // Paper start - Replace with improved version below -+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return; -+ readLegacy1_6(channelhandlercontext, bytebuf); -+ /* - boolean flag1 = bytebuf.readUnsignedByte() == 1; - flag1 = flag1 & bytebuf.readUnsignedByte() == 250; - flag1 = flag1 & "MC|PingHost".equals(new String(bytebuf.readBytes(bytebuf.readShort() * 2).array(), StandardCharsets.UTF_16BE)); -@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - } finally { - bytebuf1.release(); - } -+ */ // Paper end- end commenting out - } + this.a(channelhandlercontext, this.a(s)); + break; + default: ++ // Paper start - Replace with improved version below ++ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return; ++ readLegacy1_6(channelhandlercontext, bytebuf); ++ /* + boolean flag1 = bytebuf.readUnsignedByte() == 1; - bytebuf.release(); + flag1 &= bytebuf.readUnsignedByte() == 250; +@@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { + } finally { + bytebuf1.release(); + } ++ */ // Paper end - Replace with improved version below + } + + bytebuf.release(); @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { } diff --git a/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch b/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch index 082beb8c05..7c3f60161e 100644 --- a/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch +++ b/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make portal teleportation adjustment math more accurate diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index c0853f0fc..7aa940672 100644 +index 44c91ba26..c6933c1a3 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { @@ -45,7 +45,7 @@ index d53d0c242..49fba0979 100644 if (d0 < d1) { return d1; diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 7e858bab4..eba6eaf37 100644 +index a24bd02d5..d30a8a6bd 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -0,0 +0,0 @@ public class PortalTravelAgent { @@ -79,7 +79,7 @@ index 7e858bab4..eba6eaf37 100644 float f1 = 0.0F; float f2 = 0.0F; diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index 0c9910d9a..446cdb86d 100644 +index 78234cbdd..daeb3f83e 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java @@ -0,0 +0,0 @@ public class ShapeDetector { diff --git a/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch index f9dff155df..0829466155 100644 --- a/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch @@ -29,7 +29,7 @@ index 468aff713..241992f59 100644 private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c79baa922..352f86967 100644 +index eb4b3c7a2..7c344ffa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch index 261d699fcd..4ded7116d2 100644 --- a/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch +++ b/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bb76f56da..382e46adb 100644 +index 55cb7b88e..f7990fbdb 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - entity.ag = this.locZ; + entity.chunkZ = this.locZ; this.entitySlices[k].add(entity); // Paper start + this.markDirty(); diff --git a/Spigot-Server-Patches/Optimise-removeQueue.patch b/Spigot-Server-Patches/Optimise-removeQueue.patch index 7f8281b3dc..3ea05fae57 100644 --- a/Spigot-Server-Patches/Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/Optimise-removeQueue.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9929e2a73..c2957ad2e 100644 +index 13c538043..c07332e1b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ import com.mojang.authlib.GameProfile; @@ -53,8 +53,8 @@ index 9929e2a73..c2957ad2e 100644 } @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; - this.co = -1; - // this.cy.a((RecipeBook) entityplayer.cy); // CraftBukkit + this.lastFoodSent = -1; + // this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit - this.removeQueue.addAll(entityplayer.removeQueue); + // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only + // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting" diff --git a/Spigot-Server-Patches/Optimize-Chunk-Access.patch b/Spigot-Server-Patches/Optimize-Chunk-Access.patch index 03b46952c1..02c47ef238 100644 --- a/Spigot-Server-Patches/Optimize-Chunk-Access.patch +++ b/Spigot-Server-Patches/Optimize-Chunk-Access.patch @@ -9,12 +9,12 @@ getChunkAt is called for the same chunk multiple times in a row, often from getT Optimize this look up by using a Last Access cache. diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index ca18901df..2ebb2d834 100644 +index 732c8793e..8b3738c8f 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { - public Chunk a(long i, Chunk chunk) { + public Chunk put(long i, Chunk chunk) { chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper + lastChunkByPos = chunk; // Paper Chunk chunk1 = (Chunk) super.put(i, chunk); @@ -68,8 +68,8 @@ index ca18901df..2ebb2d834 100644 + } + // Paper end - public Chunk a(Object object) { - return this.a((Long) object); + public Chunk remove(Object object) { + return this.remove((Long) object); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 557aa5180..1d08ec37f 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java diff --git a/Spigot-Server-Patches/Optimize-Hoppers.patch b/Spigot-Server-Patches/Optimize-Hoppers.patch index addfba753c..822a3ede93 100644 --- a/Spigot-Server-Patches/Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/Optimize-Hoppers.patch @@ -31,7 +31,7 @@ index 10efe6b3d..6feea98b6 100644 private void disableSprintInterruptionOnAttack() { disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 36c8644e2..eea6d9419 100644 +index 7afcac499..cf1ca505f 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -0,0 +0,0 @@ public final class ItemStack { @@ -47,7 +47,7 @@ index 36c8644e2..eea6d9419 100644 itemstack.d(this.B()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ca72e6ad1..49a06f395 100644 +index 928dbf032..aaefb98c0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -57,7 +57,7 @@ index ca72e6ad1..49a06f395 100644 - WorldServer worldserver = (WorldServer) iterator.next(); + WorldServer worldserver = (WorldServer) iterator.next(); + TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - i = SystemUtils.c(); + i = SystemUtils.getMonotonicNanos(); if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit this.methodProfiler.a(() -> { diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java @@ -81,7 +81,7 @@ index 29fe031d8..d67fd92d9 100644 this.world.b(this.position, this); if (!this.f.isAir()) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 4bb650fa3..cdc576058 100644 +index 15e4a37fb..5291c1836 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi diff --git a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch index cabe03af6f..be60dd63bc 100644 --- a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch +++ b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch @@ -14,7 +14,7 @@ Also optimizes to not repeatedly look up the same chunk for light lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0bd975b6d..603ad2393 100644 +index 654cf763b..516656f8f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -36,7 +36,7 @@ index 0bd975b6d..603ad2393 100644 int i1 = iblockdata.b(this.world, blockposition); int j1 = iblockdata1.b(this.world, blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f8afa6f72..3c99ae7cd 100644 +index d736ac63d..4421be836 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Optimize-Server-World-Map.patch b/Spigot-Server-Patches/Optimize-Server-World-Map.patch index afaa8a8bc0..1a91350e6b 100644 --- a/Spigot-Server-Patches/Optimize-Server-World-Map.patch +++ b/Spigot-Server-Patches/Optimize-Server-World-Map.patch @@ -217,7 +217,7 @@ index 000000000..af9e4455c + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ef49fc258..c73a61d94 100644 +index 175198818..63b5cdd41 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -226,7 +226,7 @@ index ef49fc258..c73a61d94 100644 private int q = -1; - public final Map worldServer = Maps.newIdentityHashMap(); + public final Map worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper - private PlayerList s; + private PlayerList playerList; private boolean isRunning = true; private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati diff --git a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch index 9f07b71d9e..07743d1518 100644 --- a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch @@ -10,7 +10,7 @@ Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index eb6ada935f..04d8c108b4 100644 +index 1c09dded9..edf72fbec 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -23,7 +23,7 @@ index eb6ada935f..04d8c108b4 100644 // Spigot end } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 0e168ad349..f8b7d695c6 100644 +index d1197b959..51c2c5dd7 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java @@ -0,0 +0,0 @@ public class UserCache { @@ -37,7 +37,7 @@ index 0e168ad349..f8b7d695c6 100644 if (date == null) { @@ -0,0 +0,0 @@ public class UserCache { - UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date, null); + UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date); // CraftBukkit - decompile error - if (this.e.containsKey(uuid)) { + //if (this.e.containsKey(uuid)) { // Paper diff --git a/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch b/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch index b484b02d21..7221bc5024 100644 --- a/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch +++ b/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch @@ -14,7 +14,7 @@ manipulation, and instead to run clean once per tick per active expiring map. diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index c8c1444e8..6723343b8 100644 +index 39a548881..37ea37de5 100644 --- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java @@ -0,0 +0,0 @@ public abstract class ChunkGeneratorAbstract implem @@ -34,7 +34,7 @@ index c8c1444e8..6723343b8 100644 } diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java -index ae5a2077e..795e73542 100644 +index 9c0518d67..84a6dcb40 100644 --- a/src/main/java/net/minecraft/server/ExpiringMap.java +++ b/src/main/java/net/minecraft/server/ExpiringMap.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -44,7 +44,7 @@ index ae5a2077e..795e73542 100644 +import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.longs.Long2LongMap.Entry; --import it.unimi.dsi.fastutil.objects.ObjectCollection; + import it.unimi.dsi.fastutil.objects.ObjectCollection; import it.unimi.dsi.fastutil.objects.ObjectIterator; import java.util.Map; +import java.util.function.BiFunction; @@ -68,7 +68,7 @@ index ae5a2077e..795e73542 100644 + // Paper start + private void setAccess(long i) { a(i); } // Paper - OBFHELPER private void a(long i) { -- long j = SystemUtils.b(); +- long j = SystemUtils.getMonotonicMillis(); + synchronized (this.sync) { + long j = System.currentTimeMillis(); // Paper + this.ttl.put(i, j); @@ -89,7 +89,7 @@ index ae5a2077e..795e73542 100644 } - public void cleanup() { -- long j = SystemUtils.b(); +- long j = SystemUtils.getMonotonicMillis(); - ObjectIterator objectiterator = this.b.long2LongEntrySet().iterator(); // CraftBukkit - decompile error + @Override + public T putIfAbsent(long l, T t) { @@ -275,7 +275,7 @@ index ae5a2077e..795e73542 100644 - // CraftBukkit start - @Override - public T computeIfAbsent(long l, LongFunction lf) { -- this.b.put(l, SystemUtils.b()); +- this.b.put(l, SystemUtils.getMonotonicMillis()); - return super.computeIfAbsent(l, lf); - } - @@ -287,7 +287,7 @@ index ae5a2077e..795e73542 100644 - // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 49a06f395..9b2703fd2 100644 +index aaefb98c0..0bc1c887a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -299,7 +299,7 @@ index 49a06f395..9b2703fd2 100644 // Spigot start public static final int TPS = 20; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); + this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot PaperLightingQueue.processQueue(startTime); // Paper + expiringMaps.removeIf(ExpiringMap::clean); // Paper @@ -307,7 +307,7 @@ index 49a06f395..9b2703fd2 100644 co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 9c2adb235..04e29f58c 100644 +index 4cca65666..9c917370a 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator { // Paper - Ensure never async -- net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); +- net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false); + net.minecraft.server.Chunk chunk = world.getChunkIfLoaded(x, z); // Paper - optimize ifLoaded if (chunk == null) { return true; diff --git a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch index 297319f012..d9af5aa4bb 100644 --- a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -12,7 +12,7 @@ Replace all calls to the new place to the unnecessary forward. Optimize getType and getBlockData to manually inline and optimize the calls diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 4048937c6..680764b34 100644 +index f1ad18511..339e2da6b 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { @@ -31,7 +31,7 @@ index 4048937c6..680764b34 100644 public BaseBlockPosition(int i, int j, int k) { this.a = i; diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 5c5f19b4b..d81e2dc1c 100644 +index 880ce16b1..c9019260b 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { @@ -52,7 +52,7 @@ index 5c5f19b4b..d81e2dc1c 100644 public MutableBlockPosition() { this(0, 0, 0); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 101d5bb01..6a23b1ec2 100644 +index eca041265..66520842d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -97,7 +97,7 @@ index 274c44948..7e4c79a1c 100644 private NibbleArray skyLight; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index befb3e23f..3bfb9397d 100644 +index 4093d3486..e109016b7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/Optimize-redstone-algorithm.patch index 7519658586..f051cab190 100644 --- a/Spigot-Server-Patches/Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/Optimize-redstone-algorithm.patch @@ -954,7 +954,7 @@ index 000000000..21d9d6d7e + } +} diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java -index 570715ea6..f95464f64 100644 +index 0adea6a17..174e84760 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java @@ -0,0 +0,0 @@ @@ -1140,7 +1140,7 @@ index 570715ea6..f95464f64 100644 iblockdata.a(world, blockposition, 0); world.setAir(blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d202360bd..05256ad3c 100644 +index a877d4a6b..d14ee6b9b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch b/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch index e13dcdbfd7..b9a2475c3d 100644 --- a/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch @@ -19,20 +19,20 @@ index af31030dc..b6764c7ec 100644 + log("Experience Merge Max Value: " + expMergeMaxValue); + } } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c1ede0651..15e07ce84 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +index 464c5cfc9..14df8e80b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -0,0 +0,0 @@ public class CraftEventFactory { EntityExperienceOrb xp = (EntityExperienceOrb) entity; - double radius = spigotConfig.expMerge; + double radius = world.spigotConfig.expMerge; if (radius > 0) { + // Paper start - Maximum exp value when merging - Whole section has been tweaked, see comments for specifics -+ final int maxValue = paperConfig.expMergeMaxValue; -+ final boolean mergeUnconditionally = paperConfig.expMergeMaxValue <= 0; ++ final int maxValue = world.paperConfig.expMergeMaxValue; ++ final boolean mergeUnconditionally = world.paperConfig.expMergeMaxValue <= 0; + if (mergeUnconditionally || xp.value < maxValue) { // Paper - Skip iteration if unnecessary + - List entities = this.getEntities(entity, entity.getBoundingBox().grow(radius, radius, radius)); + List entities = world.getEntities(entity, entity.getBoundingBox().grow(radius, radius, radius)); for (Entity e : entities) { if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; diff --git a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch index 53422bc397..191abba4df 100644 --- a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -11,7 +11,7 @@ Defaulting this to false will provide substantial performance improvement by saving millions of event calls on redstone heavy servers. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0faef7cf28..deb4ec2543 100644 +index 0faef7cf2..deb4ec254 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -25,7 +25,7 @@ index 0faef7cf28..deb4ec2543 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cad60e4f8b..22f0673743 100644 +index e109016b7..e614ac33a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -38,7 +38,7 @@ index cad60e4f8b..22f0673743 100644 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a7cc053dc8..c5201697d5 100644 +index e98ba11dc..b5983957b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ import org.bukkit.event.weather.LightningStrikeEvent; diff --git a/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 72b3a59bfa..008f2e2217 100644 --- a/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -21,7 +21,7 @@ index 05509e4fd..4059c7a72 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5557e9409..7f23a8e2e 100644 +index 66d2026d0..858cc1b97 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch index 0289a02801..c17616d443 100644 --- a/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch +++ b/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch @@ -19,7 +19,7 @@ index 47bfb5b62..e8417cb2e 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 2af8a582b..9430bccf6 100644 +index 1a8317256..9d3234c1c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index 8632d5ebb4..53ff8bf718 100644 --- a/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -25,20 +25,8 @@ index 276dd98fd..973ea8bca 100644 + useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false); + } } -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 734ee9d8e..e60e8e8fe 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return this.getFlag(5); - } - -+ @Nullable public ScoreboardTeamBase getTeam() { return this.be(); } // Paper - OBFHELPER - @Nullable - public ScoreboardTeamBase be() { - if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index dc2c143c8..5c7a88ec8 100644 +index 8a65072fe..d162bd3d8 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -49,7 +37,7 @@ index dc2c143c8..5c7a88ec8 100644 + // Paper Start - (Meh) Support for vanilla world scoreboard name coloring + String displayName = event.getPlayer().getDisplayName(); + if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) { -+ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getTeam(),((CraftPlayer) player).getHandle().getDisplayName()); ++ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getScoreboardTeam(),((CraftPlayer) player).getHandle().getDisplayName()); + // Explicitly add a RESET here, vanilla uses components for this now... + displayName = CraftChatMessage.fromComponent(nameFromTeam, EnumChatFormat.WHITE) + org.bukkit.ChatColor.RESET; + } @@ -60,7 +48,7 @@ index dc2c143c8..5c7a88ec8 100644 if (((LazyPlayerSet) event.getRecipients()).isLazy()) { for (Object recipient : minecraftServer.getPlayerList().players) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 8c10a0da1..2cb5869ae 100644 +index 80f595fea..7edca4284 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch index b2fc3442b5..e8dcf329a1 100644 --- a/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch @@ -32,7 +32,7 @@ index 00f0451ef..42d951554 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index be1c800c9..c065b2728 100644 +index 9682b0a01..876ae1639 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/Paper-config-files.patch b/Spigot-Server-Patches/Paper-config-files.patch index 00db080347..38a73be560 100644 --- a/Spigot-Server-Patches/Paper-config-files.patch +++ b/Spigot-Server-Patches/Paper-config-files.patch @@ -511,7 +511,7 @@ index 000000000..a73865739 + } +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 1f44d8119..73a326684 100644 +index cdfd9a8fb..b5e5c385d 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -531,19 +531,19 @@ index 1f44d8119..73a326684 100644 DedicatedServer.LOGGER.info("Generating keypair"); this.a(MinecraftEncryption.b()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 27a24b00b..08c17d134 100644 +index f04e87c57..c93cab858 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { private static final DataWatcherObject aG = DataWatcher.a(Entity.class, DataWatcherRegistry.i); private static final DataWatcherObject aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i); public boolean inChunk; -- public int ae; -- public int af; -- public int ag; -+ public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER -+ public int af; public int getChunkY() { return af; } // Paper - OBFHELPER -+ public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER +- public int chunkX; +- public int chunkY; +- public int chunkZ; ++ public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER ++ public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER ++ public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER public boolean ak; public boolean impulse; public int portalCooldown; @@ -572,7 +572,7 @@ index 207bad41e..bcdc790ba 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2252fa991..44b381120 100644 +index 673764369..0920ef2d1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -593,7 +593,7 @@ index 2252fa991..44b381120 100644 this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8ade4244e..b524adc7d 100644 +index aa0dfa4cc..a3c07fbac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Player-affects-spawning-API.patch b/Spigot-Server-Patches/Player-affects-spawning-API.patch index 19b5a20b5b..7502d6b7f8 100644 --- a/Spigot-Server-Patches/Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/Player-affects-spawning-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 7e151439c..0aae80a7f 100644 +index 05360531c..1aec6d7c3 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -19,7 +19,7 @@ index 7e151439c..0aae80a7f 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 8f4319c80..cf73a6d1f 100644 +index ef3c94221..ac250182b 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -58,7 +58,7 @@ index afe039905..ff564508f 100644 j = MathHelper.floor(entityhuman.locZ / 16.0D); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e1e931406..c378df796 100644 +index b116239f2..73c47c517 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData; diff --git a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch index e1e0bea675..574e254fa8 100644 --- a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index dfd6230b2..73205b2f7 100644 +index 404a222b4..4bcae2c21 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @@ -17,5 +17,5 @@ index dfd6230b2..73205b2f7 100644 + if (this.c == 0 && entityhuman.bJ == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper entityhuman.bJ = 2; entityhuman.receive(this, 1); - ItemStack itemstack = EnchantmentManager.b(Enchantments.G, (EntityLiving) entityhuman); + ItemStack itemstack = EnchantmentManager.b(Enchantments.MENDING, (EntityLiving) entityhuman); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch b/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch index 417242d4a5..7915513241 100644 --- a/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch +++ b/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch @@ -23,7 +23,7 @@ index e8417cb2e..de59f4ce0 100644 private void removeCorruptTEs() { removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 27bed54d2..917f57ced 100644 +index 27bed54d2..9990cdbcd 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -31,7 +31,7 @@ index 27bed54d2..917f57ced 100644 ObjectIterator objectiterator = this.chunks.values().iterator(); + // Paper start -+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; ++ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProvider().chunkLoader; + final int queueSize = chunkLoader.getQueueSize(); + if (!flag && queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ + return false; @@ -41,7 +41,7 @@ index 27bed54d2..917f57ced 100644 Chunk chunk = (Chunk) objectiterator.next(); diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 8fe4c6fec..a2c3c066b 100644 +index 6093ae408..f17869d4d 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch b/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch index 439a06e2b7..cbf6dfabbc 100644 --- a/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch +++ b/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 7bea86f52..ea3a6f2fb 100644 +index 598621fbb..5c5b3a531 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { try (BlockPosition.b blockposition$b = BlockPosition.b.r()) { for(EnumDirection enumdirection : EnumDirection.values()) { - blockposition$b.j(blockposition).d(enumdirection); + blockposition$b.g(blockposition).c(enumdirection); - IBlockData iblockdata1 = world.getType(blockposition$b); + IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition$b); // Paper - don't load chunks + if (iblockdata1 == null) continue; // Paper if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition$b)) { - world.J().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay + world.getBlockTickList().a(blockposition$b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { try (BlockPosition.b blockposition$b = BlockPosition.b.r()) { for(EnumDirection enumdirection : EnumDirection.values()) { - blockposition$b.j(blockposition).d(enumdirection); + blockposition$b.g(blockposition).c(enumdirection); - if (iblockaccess.getType(blockposition$b).getBlock() == this) { + if (((World) iblockaccess).getBlockIfLoaded(blockposition$b) == this) { // Paper - don't load chunks ++j; diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch index 7862309f70..0b0d875adc 100644 --- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 68ac014aab..c5212417c6 100644 +index 68ac014aa..c5212417c 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -23,7 +23,7 @@ index 68ac014aab..c5212417c6 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8984949ff5..4afa16fb8a 100644 +index ab74b1add..5d5a9f0bb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -44,8 +44,8 @@ index 8984949ff5..4afa16fb8a 100644 } @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - ((ITickable) tileentity).Y_(); - this.methodProfiler.e(); + ((ITickable) tileentity).tick(); + this.methodProfiler.exit(); } catch (Throwable throwable2) { - crashreport1 = CrashReport.a(throwable2, "Ticking block entity"); - crashreportsystemdetails1 = crashreport1.a("Block entity being ticked"); diff --git a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch index 887431d089..d974cca290 100644 --- a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch @@ -30,23 +30,23 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index acdfb0e1e..a1a574023 100644 +index dacb372a5..fd405281b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati public final Map worldServer = Maps.newIdentityHashMap(); - private PlayerList s; + private PlayerList playerList; private boolean isRunning = true; + private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private boolean isStopped; private int ticks; protected final Proxy c; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - if (this.s != null) { + if (this.playerList != null) { MinecraftServer.LOGGER.info("Saving players"); - this.s.savePlayers(); -- this.s.u(); -+ this.s.u(isRestarting); // Paper + this.playerList.savePlayers(); +- this.playerList.u(); ++ this.playerList.u(isRestarting); // Paper try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets } @@ -65,10 +65,10 @@ index acdfb0e1e..a1a574023 100644 } + // Paper end - private boolean aT() { + private boolean canSleepForTick() { return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index b10ac733f..3f96443eb 100644 +index 320c378e0..d8ed44fe2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch b/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch index 1cb36ab682..08a437e571 100644 --- a/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch +++ b/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch @@ -22,7 +22,7 @@ requirement, but plugins (such as my own) use this method to trigger a "reload" of the entity on the client. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 07a64966e..5600223d9 100644 +index 7c558c355..d033969cd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -32,10 +32,10 @@ index 07a64966e..5600223d9 100644 - this.world.kill(this); + this.world.removeEntity(this); // Paper - Fully remove entity, can't have dupes in the UUID map this.dead = false; - this.world.methodProfiler.a("reposition"); + this.world.methodProfiler.enter("reposition"); /* CraftBukkit start - Handled in calculateTarget diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a30d92ce7..83109177d 100644 +index 55e45dbb1..91850fded 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch index d4aae36aec..aef104dd9a 100644 --- a/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f0e974dff..bcfe4c1da 100644 +index f1320f5ac..f1a162420 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -30,7 +30,7 @@ index f0e974dff..bcfe4c1da 100644 + return world.tileEntityListTick.size(); + } + public int getChunkCount() { -+ return world.getChunkProviderServer().chunks.size(); ++ return world.getChunkProvider().chunks.size(); + } + public int getPlayerCount() { + return world.players.size(); diff --git a/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch b/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch index 2ab6c3db2b..5ee986a4f9 100644 --- a/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch +++ b/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch @@ -59,7 +59,7 @@ index 48b0a742a..f0b87972d 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 7c77d384b..f734b85e0 100644 +index a2d65c6df..41a7103ef 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -139,7 +139,7 @@ index 7c77d384b..f734b85e0 100644 if (nbttagcompound != null) { diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 15666325e..3501b87f7 100644 +index d07222239..8c8b7cbab 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ public class RegionFileCache { @@ -151,13 +151,13 @@ index 15666325e..3501b87f7 100644 + return new File(file1, "r." + (i >> 5) + "." + (j >> 5) + ".mca"); + } + public static synchronized boolean hasRegionFile(File file, int i, int j) { -+ return RegionFileCache.a.containsKey(getRegionFileName(file, i, j)); ++ return RegionFileCache.cache.containsKey(getRegionFileName(file, i, j)); + } // Paper End public static synchronized void a() { diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index ab085788a..c84e6acdb 100644 +index 577ba1b5f..31119ba69 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { diff --git a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch index 1e242528aa..552bf26a57 100644 --- a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -8,7 +8,7 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 83109177d..a07077397 100644 +index 91850fded..45851cd0c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch index c1042d4116..6b4b727c29 100644 --- a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove invalid mob spawner tile entities diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index 9970a58ed..da2548603 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch index 58498496c9..ca5b8a4fb5 100644 --- a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 796ce3103a..261ae87fb8 100644 +index 1a1b40ac0..9c5f520f1 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch index b36fa18fda..64dfbfd7bd 100644 --- a/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 23e6f45bf..e4c78c676 100644 +index 4f6e67915..9eeb73d67 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,7 +18,7 @@ index 23e6f45bf..e4c78c676 100644 } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6105a4e14..1b47d7bd4 100644 +index 2679c2358..d04570171 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch index d39447aa0f..0bc40cbd80 100644 --- a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch @@ -11,7 +11,7 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). The maximum size of the RegionFileCache is also made configurable. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index dccd00127..b4dba7247 100644 +index 492df2c8e..0778f53e2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -25,7 +25,7 @@ index dccd00127..b4dba7247 100644 + } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 2217adf99..c0ab543b9 100644 +index 5dbd1d517..964996976 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ import java.io.IOException; @@ -37,19 +37,17 @@ index 2217adf99..c0ab543b9 100644 public class RegionFileCache { -- public static final Map a = Maps.newHashMap(); // Spigot - private -> public -+ public static final Map a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap +- public static final Map cache = Maps.newHashMap(); ++ public static final Map cache = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Paper - HashMap -> LinkedHashMap public static synchronized RegionFile a(File file, int i, int j) { File file1 = new File(file, "region"); @@ -0,0 +0,0 @@ public class RegionFileCache { - file1.mkdirs(); } -- if (RegionFileCache.a.size() >= 256) { + if (RegionFileCache.cache.size() >= 256) { - a(); -+ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper -+ trimCache(); // Paper ++ trimCache(); } RegionFile regionfile1 = new RegionFile(file2); @@ -59,11 +57,11 @@ index 2217adf99..c0ab543b9 100644 + // Paper Start + private static synchronized void trimCache() { -+ Iterator> itr = RegionFileCache.a.entrySet().iterator(); -+ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize; ++ Iterator> itr = RegionFileCache.cache.entrySet().iterator(); ++ int count = RegionFileCache.cache.size() - PaperConfig.regionFileCacheSize; + while (count-- >= 0 && itr.hasNext()) { + try { -+ itr.next().getValue().c(); ++ itr.next().getValue().close(); + } catch (IOException ioexception) { + ioexception.printStackTrace(); + ServerInternalException.reportInternalException(ioexception); @@ -74,6 +72,6 @@ index 2217adf99..c0ab543b9 100644 + // Paper End + public static synchronized void a() { - Iterator iterator = RegionFileCache.a.values().iterator(); + Iterator iterator = RegionFileCache.cache.values().iterator(); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch index 2c62e1ef7a..b88390b3c7 100644 --- a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch +++ b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Send nearby packets from world player list not server list diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e6ee5042c..a3794b5c6 100644 +index 6311c9f87..50c91d12c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -46,7 +46,7 @@ index e6ee5042c..a3794b5c6 100644 double d5 = d1 - entityplayer.locY; double d6 = d2 - entityplayer.locZ; diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java -index e26405d34..23f390c22 100644 +index b4225b58e..0ba0eb661 100644 --- a/src/main/java/net/minecraft/server/WorldManager.java +++ b/src/main/java/net/minecraft/server/WorldManager.java @@ -0,0 +0,0 @@ public class WorldManager implements IWorldAccess { @@ -95,7 +95,7 @@ index e26405d34..23f390c22 100644 if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) { double d0 = (double) blockposition.getX() - entityplayer.locX; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0545336b4..bab0c0e0f 100644 +index 10630ac96..b355c3f53 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -119,7 +119,7 @@ index 0545336b4..bab0c0e0f 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2acd8a4b3..4237e5e3c 100644 +index 20fb157fa..e61dc2c26 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch b/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch index a22a40baed..63ce651eed 100644 --- a/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch +++ b/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch @@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 680764b34..25334377a 100644 +index 339e2da6b..8dbb4864e 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -0,0 +0,0 @@ import javax.annotation.concurrent.Immutable; @@ -80,7 +80,7 @@ index 680764b34..25334377a 100644 public BaseBlockPosition d(BaseBlockPosition baseblockposition1) { return new BaseBlockPosition(this.getY() * baseblockposition1.getZ() - this.getZ() * baseblockposition1.getY(), this.getZ() * baseblockposition1.getX() - this.getX() * baseblockposition1.getZ(), this.getX() * baseblockposition1.getY() - this.getY() * baseblockposition1.getX()); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7bd51b357..9ce3cd9c9 100644 +index e980e31fc..ae162f615 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { @@ -115,7 +115,7 @@ index 7bd51b357..9ce3cd9c9 100644 return this.g; @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { - } + public static class MutableBlockPosition extends BlockPosition { + // Paper start - comment out diff --git a/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch index 7883a4bf04..3efd3041ab 100644 --- a/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch +++ b/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type Opens door for future patches to optimize performance diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7ac07ac07ac0..7ac07ac07ac0 100644 +index d1d8c3be6..4d04fdda7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 7eb22c0108..f6e6a66a05 100644 --- a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 4870a4bb5..085d3d3e8 100644 +index 5dd08018c..d1d8c3be6 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -61,8 +61,8 @@ index 4870a4bb5..085d3d3e8 100644 this.q = Maps.newHashMap(); this.r = new ShortList[16]; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - entity.af = k; - entity.ag = this.locZ; + entity.chunkY = k; + entity.chunkZ = this.locZ; this.entitySlices[k].add(entity); + // Paper start + entity.setCurrentChunk(this); @@ -94,7 +94,7 @@ index 4870a4bb5..085d3d3e8 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3e5c2d8e7..fde9d4d51 100644 +index a6eb8ab6c..50176b97b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -103,9 +103,9 @@ index 3e5c2d8e7..fde9d4d51 100644 private static final DataWatcherObject aH = DataWatcher.a(Entity.class, DataWatcherRegistry.i); - public boolean inChunk; + public boolean inChunk; public boolean isAddedToChunk() { return inChunk; } // Paper - OBFHELPER - public int ae; public int getChunkX() { return ae; } // Paper - OBFHELPER - public int af; public int getChunkY() { return af; } // Paper - OBFHELPER - public int ag; public int getChunkZ() { return ag; } // Paper - OBFHELPER + public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER + public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER + public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 780c302c08..311e0e5f8d 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -253,7 +253,7 @@ index 000000000..145cb274b + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 87a7b6980..2f17e5219 100644 +index 255b8bed0..fe148495b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.util.concurrent.TimeUnit; @@ -297,7 +297,7 @@ index 87a7b6980..2f17e5219 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index b9645c669..fb7688e9e 100644 +index a30b21ad2..83b1ef0fc 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -0,0 +0,0 @@ public class Block implements IMaterial { @@ -317,7 +317,7 @@ index b9645c669..fb7688e9e 100644 private final float frictionFactor; protected final BlockStateList blockStateList; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 6675bc5cc..f929ce02e 100644 +index 4d04fdda7..9970a58ed 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -337,13 +337,13 @@ index 6675bc5cc..f929ce02e 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index f0d926256..ca18901df 100644 +index df2711a5f..732c8793e 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { } - public Chunk a(long i, Chunk chunk) { + public Chunk put(long i, Chunk chunk) { + chunk.world.timings.syncChunkLoadPostTimer.startTiming(); // Paper Chunk chunk1 = (Chunk) super.put(i, chunk); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i); @@ -398,7 +398,7 @@ index b859a5b9e..60abc5f28 100644 this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 3bf55a054..179769323 100644 +index 1b8c28096..62a63dfa8 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ @@ -433,11 +433,11 @@ index 3bf55a054..179769323 100644 - world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot - if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.J() instanceof TickListServer) { - ((TickListServer) world.J()).a(nbttagcompound.getList("TileTicks", 10)); + if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.getBlockTickList() instanceof TickListServer) { + ((TickListServer) world.getBlockTickList()).a(nbttagcompound.getList("TileTicks", 10)); @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.I() instanceof TickListServer) { - ((TickListServer) world.I()).a(nbttagcompound.getList("LiquidTicks", 10)); + if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.getFluidTickList() instanceof TickListServer) { + ((TickListServer) world.getFluidTickList()).a(nbttagcompound.getList("LiquidTicks", 10)); } - world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot + world.timings.chunkLoadLevelTimer.stopTiming(); // Spigot @@ -472,7 +472,7 @@ index cc9e8465c..1bd3a0f77 100644 return this.b; } diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java -index 15ab4f0e4..1004e084c 100644 +index b8a626dd4..323b2e6dc 100644 --- a/src/main/java/net/minecraft/server/CustomFunctionData.java +++ b/src/main/java/net/minecraft/server/CustomFunctionData.java @@ -0,0 +0,0 @@ public class CustomFunctionData implements ITickable, IResourcePackListener { @@ -485,7 +485,7 @@ index 15ab4f0e4..1004e084c 100644 int j = 0; CustomFunction.c[] acustomfunction_c = customfunction.b(); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 73a326684..a575ff529 100644 +index b5e5c385d..7f4c76669 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Level; @@ -500,7 +500,7 @@ index 73a326684..a575ff529 100644 @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - public void aU() { + public void handleCommandQueue() { - SpigotTimings.serverCommandTimer.startTiming(); // Spigot + MinecraftTimings.serverCommandTimer.startTiming(); // Spigot while (!this.serverCommandQueue.isEmpty()) { @@ -538,7 +538,7 @@ index 73a326684..a575ff529 100644 return waitable.get(); } catch (java.util.concurrent.ExecutionException e) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f05a9ebab..8b1e0448b 100644 +index 50176b97b..f960db23d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ import org.bukkit.command.CommandSender; @@ -570,14 +570,14 @@ index f05a9ebab..8b1e0448b 100644 this.recalcPosition(); @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot } protected float ab() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2a1e3c801..7f95652bd 100644 +index 14c481220..92a55bdf6 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -602,7 +602,7 @@ index 2a1e3c801..7f95652bd 100644 } - SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot - this.k(); + this.movementTick(); - SpigotTimings.timerEntityTickRest.startTiming(); // Spigot double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; @@ -619,19 +619,19 @@ index 2a1e3c801..7f95652bd 100644 @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { } - this.world.methodProfiler.a("ai"); + this.world.methodProfiler.enter("ai"); - SpigotTimings.timerEntityAI.startTiming(); // Spigot if (this.isFrozen()) { this.bg = false; this.bh = 0.0F; @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { this.doTick(); - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } - SpigotTimings.timerEntityAI.stopTiming(); // Spigot - this.world.methodProfiler.e(); - this.world.methodProfiler.a("jump"); + this.world.methodProfiler.exit(); + this.world.methodProfiler.enter("jump"); @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { this.n(); AxisAlignedBB axisalignedbb = this.getBoundingBox(); @@ -639,8 +639,8 @@ index 2a1e3c801..7f95652bd 100644 - SpigotTimings.timerEntityAIMove.startTiming(); // Spigot this.a(this.bh, this.bi, this.bj); - SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot - this.world.methodProfiler.e(); - this.world.methodProfiler.a("push"); + this.world.methodProfiler.exit(); + this.world.methodProfiler.enter("push"); if (this.bw > 0) { @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { this.a(axisalignedbb, this.getBoundingBox()); @@ -649,11 +649,11 @@ index 2a1e3c801..7f95652bd 100644 - SpigotTimings.timerEntityAICollision.startTiming(); // Spigot this.cN(); - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - this.world.methodProfiler.e(); + this.world.methodProfiler.exit(); } diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index ae31935c4..70c9b1f50 100644 +index 22db1fad1..d7f33bd53 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java @@ -0,0 +0,0 @@ public class EntityTracker { @@ -684,7 +684,7 @@ index ae31935c4..70c9b1f50 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 04c5c1796..b99ed185f 100644 +index 37211c33a..97690499f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ @@ -719,26 +719,26 @@ index 04c5c1796..b99ed185f 100644 - SpigotTimings.serverTickTimer.startTiming(); // Spigot + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot - long i = SystemUtils.c(); + long i = SystemUtils.getMonotonicNanos(); @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - SpigotTimings.worldSaveTimer.startTiming(); // Spigot - this.methodProfiler.a("save"); - this.s.savePlayers(); + this.methodProfiler.enter("save"); + this.playerList.savePlayers(); // Spigot Start @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // this.saveChunks(true); // Spigot End - this.methodProfiler.e(); + this.methodProfiler.exit(); - SpigotTimings.worldSaveTimer.stopTiming(); // Spigot } - this.methodProfiler.a("snooper"); + this.methodProfiler.enter("snooper"); @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); + this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot this.slackActivityAccountant.tickEnded(l); // Spigot - SpigotTimings.serverTickTimer.stopTiming(); // Spigot @@ -753,7 +753,7 @@ index 04c5c1796..b99ed185f 100644 - SpigotTimings.schedulerTimer.stopTiming(); // Spigot + MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Paper + MinecraftTimings.minecraftSchedulerTimer.startTiming(); // Paper - this.methodProfiler.a("jobs"); + this.methodProfiler.enter("jobs"); FutureTask futuretask; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -762,13 +762,13 @@ index 04c5c1796..b99ed185f 100644 } + MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper - this.methodProfiler.c("commandFunctions"); + this.methodProfiler.exitEnter("commandFunctions"); - SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot + MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot - this.getFunctionData().Y_(); + this.getFunctionData().tick(); - SpigotTimings.commandFunctionsTimer.stopTiming(); // Spigot + MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot - this.methodProfiler.c("levels"); + this.methodProfiler.exitEnter("levels"); // CraftBukkit start // Run tasks that are waiting on processing @@ -802,42 +802,42 @@ index 04c5c1796..b99ed185f 100644 long i; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.methodProfiler.e(); - this.methodProfiler.a("tracker"); + this.methodProfiler.exit(); + this.methodProfiler.enter("tracker"); - worldserver.timings.tracker.startTiming(); // Spigot worldserver.getTracker().updatePlayers(); - worldserver.timings.tracker.stopTiming(); // Spigot - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); } } - this.methodProfiler.c("connection"); + this.methodProfiler.exitEnter("connection"); - SpigotTimings.connectionTimer.startTiming(); // Spigot + MinecraftTimings.connectionTimer.startTiming(); // Spigot this.getServerConnection().c(); - SpigotTimings.connectionTimer.stopTiming(); // Spigot + MinecraftTimings.connectionTimer.stopTiming(); // Spigot - this.methodProfiler.c("players"); + this.methodProfiler.exitEnter("players"); - SpigotTimings.playerListTimer.startTiming(); // Spigot + MinecraftTimings.playerListTimer.startTiming(); // Spigot - this.s.tick(); + this.playerList.tick(); - SpigotTimings.playerListTimer.stopTiming(); // Spigot + MinecraftTimings.playerListTimer.stopTiming(); // Spigot - this.methodProfiler.c("tickables"); + this.methodProfiler.exitEnter("tickables"); - SpigotTimings.tickablesTimer.startTiming(); // Spigot + MinecraftTimings.tickablesTimer.startTiming(); // Spigot for (int j = 0; j < this.k.size(); ++j) { - ((ITickable) this.k.get(j)).Y_(); + ((ITickable) this.k.get(j)).tick(); } - SpigotTimings.tickablesTimer.stopTiming(); // Spigot + MinecraftTimings.tickablesTimer.stopTiming(); // Spigot - this.methodProfiler.e(); + this.methodProfiler.exit(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 384f4f45b..1dfdc5d70 100644 +index ceac52fe5..29e24940f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ @@ -924,14 +924,14 @@ index 384f4f45b..1dfdc5d70 100644 WorldProvider worldprovider = this.world.worldProvider; if (!worldprovider.canRespawn()) { - this.world.getChunkProviderServer().b(); + this.world.getChunkProvider().b(); } + } // Paper timing } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 539e6d3c9..67c993795 100644 +index 2b6c797ce..0a887789a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory; @@ -945,7 +945,7 @@ index 539e6d3c9..67c993795 100644 @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end - public void Y_() { + public void tick() { - org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot this.syncPosition(); this.player.playerTick(); @@ -1007,7 +1007,7 @@ index 616797dc6..3a5daf670 100644 throw CancelledPacketHandleException.INSTANCE; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 39f149a81..597ad7d40 100644 +index 9db7d7e30..aef650774 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ @@ -1031,7 +1031,7 @@ index 39f149a81..597ad7d40 100644 public WhiteList getWhitelist() { diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java -index a07895935..ee5c2421b 100644 +index 0d0b4d873..774134103 100644 --- a/src/main/java/net/minecraft/server/TickListServer.java +++ b/src/main/java/net/minecraft/server/TickListServer.java @@ -0,0 +0,0 @@ public class TickListServer implements TickList { @@ -1058,7 +1058,7 @@ index a07895935..ee5c2421b 100644 @@ -0,0 +0,0 @@ public class TickListServer implements TickList { } - this.f.methodProfiler.a("cleaning"); + this.f.methodProfiler.enter("cleaning"); - + timingCleanup.startTiming(); // Paper NextTickListEntry nextticklistentry; // CraftBukkit - decompile error @@ -1070,15 +1070,15 @@ index a07895935..ee5c2421b 100644 } + timingCleanup.stopTiming(); // Paper - this.f.methodProfiler.e(); - this.f.methodProfiler.a("ticking"); + this.f.methodProfiler.exit(); + this.f.methodProfiler.enter("ticking"); + timingTicking.startTiming(); // Paper Iterator iterator = this.g.iterator(); while (iterator.hasNext()) { @@ -0,0 +0,0 @@ public class TickListServer implements TickList { - this.f.methodProfiler.e(); + this.f.methodProfiler.exit(); this.g.clear(); + timingTicking.stopTiming(); // Paper } @@ -1105,7 +1105,7 @@ index c69209497..68ac014aa 100644 private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER protected World world; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 44b381120..119e1facc 100644 +index 0920ef2d1..230517907 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -1151,7 +1151,7 @@ index 44b381120..119e1facc 100644 @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } - this.methodProfiler.c("remove"); + this.methodProfiler.exitEnter("remove"); + timings.entityRemoval.startTiming(); // Paper this.entityList.removeAll(this.g); @@ -1161,7 +1161,7 @@ index 44b381120..119e1facc 100644 this.g.clear(); this.p_(); + timings.entityRemoval.stopTiming(); // Paper - this.methodProfiler.c("regular"); + this.methodProfiler.exitEnter("regular"); CrashReport crashreport1; @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -1173,7 +1173,7 @@ index 44b381120..119e1facc 100644 if (tickPosition < 0) tickPosition = 0; for (entityLimiter.initTick(); @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - this.methodProfiler.a("tick"); + this.methodProfiler.enter("tick"); if (!entity.dead && !(entity instanceof EntityPlayer)) { try { - SpigotTimings.tickEntityTimer.startTiming(); // Spigot @@ -1191,8 +1191,8 @@ index 44b381120..119e1facc 100644 timings.tileEntityPending.stopTiming(); // Spigot + co.aikar.timings.TimingHistory.tileEntityTicks += this.tileEntityListTick.size(); // Paper - this.methodProfiler.e(); - this.methodProfiler.e(); + this.methodProfiler.exit(); + this.methodProfiler.exit(); } @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } @@ -1220,7 +1220,7 @@ index 44b381120..119e1facc 100644 public boolean a(@Nullable Entity entity, VoxelShape voxelshape) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ee68983f6..435c54da1 100644 +index 23c80f80a..2450421d4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ @@ -1251,26 +1251,25 @@ index ee68983f6..435c54da1 100644 @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { timings.doChunkUnload.stopTiming(); // Spigot - this.methodProfiler.c("tickPending"); + this.methodProfiler.exitEnter("tickPending"); - timings.doTickPending.startTiming(); // Spigot + timings.scheduledBlocks.startTiming(); // Paper this.q(); - timings.doTickPending.stopTiming(); // Spigot + timings.scheduledBlocks.stopTiming(); // Paper - this.methodProfiler.c("tickBlocks"); + this.methodProfiler.exitEnter("tickBlocks"); - timings.doTickTiles.startTiming(); // Spigot + timings.chunkTicks.startTiming(); // Paper this.n_(); - timings.doTickTiles.stopTiming(); // Spigot + timings.chunkTicks.stopTiming(); // Paper - this.methodProfiler.c("chunkMap"); + this.methodProfiler.exitEnter("chunkMap"); timings.doChunkMap.startTiming(); // Spigot this.manager.flush(); @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - } } -- this.methodProfiler.c("tickBlocks"); + this.methodProfiler.exitEnter("tickBlocks"); + timings.chunkTicksBlocks.startTiming(); // Paper if (i > 0) { ChunkSection[] achunksection = chunk.getSections(); @@ -1282,7 +1281,7 @@ index ee68983f6..435c54da1 100644 + timings.chunkTicksBlocks.stopTiming(); // Paper } - this.methodProfiler.e(); + this.methodProfiler.exit(); @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (chunkproviderserver.d()) { @@ -1327,7 +1326,7 @@ index ee68983f6..435c54da1 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b524adc7d..9efd620f2 100644 +index a3c07fbac..da57751f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Turtle-API.patch b/Spigot-Server-Patches/Turtle-API.patch index 0091e91520..ea6141f343 100644 --- a/Spigot-Server-Patches/Turtle-API.patch +++ b/Spigot-Server-Patches/Turtle-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Turtle API diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index db221a6b5..37fc10fba 100644 +index 6c4ffbf8f..2484bd272 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { diff --git a/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch index cd45de726c..a1424aa9c0 100644 --- a/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch +++ b/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event Otherwise the creeper infinite explodes diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 64a5fefad..569248abb 100644 +index fb76dc18b..73d9d3b2c 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { @@ -19,7 +19,7 @@ index 64a5fefad..569248abb 100644 private int fuseTicks; public int maxFuseTicks = 30; @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { - this.dF(); + this.createEffectCloud(); } else { fuseTicks = 0; + this.datawatcher.set(isIgnitedDW, Boolean.valueOf(false)); // Paper diff --git a/Spigot-Server-Patches/Use-EntityTypes-for-living-entities.patch b/Spigot-Server-Patches/Use-EntityTypes-for-living-entities.patch index 1311da7281..c9c14d0402 100644 --- a/Spigot-Server-Patches/Use-EntityTypes-for-living-entities.patch +++ b/Spigot-Server-Patches/Use-EntityTypes-for-living-entities.patch @@ -66,7 +66,7 @@ index 93bf32dc1..e6063bb46 100644 entitywither.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.55D, (double) blockposition2.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().k() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index e6da1c30f..efb3c057d 100644 +index 09ad5a3ca..41e599b26 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -0,0 +0,0 @@ public class EnderDragonBattle { @@ -75,37 +75,37 @@ index e6da1c30f..efb3c057d 100644 this.d.getChunkAtWorldCoords(new BlockPosition(0, 128, 0)); - EntityEnderDragon entityenderdragon = new EntityEnderDragon(this.d); + EntityEnderDragon entityenderdragon = EntityTypes.ENDER_DRAGON.create(this.d); // Paper - entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.a); + entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN); entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.d.random.nextFloat() * 360.0F, 0.0F); this.d.addEntity(entityenderdragon); diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index afbcfab55..b1af04726 100644 +index ee159e0a8..070a9e7b1 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -0,0 +0,0 @@ public class EntityChicken extends EntityAnimal { } - public EntityChicken b(EntityAgeable entityageable) { + public EntityChicken createChild(EntityAgeable entityageable) { - return new EntityChicken(this.world); + return EntityTypes.CHICKEN.create(world); // Paper } public boolean f(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 6bb80975e..180de2144 100644 +index 5874d2993..cc53e915d 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -0,0 +0,0 @@ public class EntityCow extends EntityAnimal { } - public EntityCow b(EntityAgeable entityageable) { + public EntityCow createChild(EntityAgeable entityageable) { - return new EntityCow(this.world); + return EntityTypes.COW.create(world); // Paper } public float getHeadHeight() { diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java -index 46f29272e..1d3b7edb3 100644 +index 961afa5c4..a372f6508 100644 --- a/src/main/java/net/minecraft/server/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java @@ -0,0 +0,0 @@ public class EntityEnderPearl extends EntityProjectile { @@ -115,10 +115,10 @@ index 46f29272e..1d3b7edb3 100644 - EntityEndermite entityendermite = new EntityEndermite(this.world); + EntityEndermite entityendermite = EntityTypes.ENDERMITE.create(world); // Paper - entityendermite.a(true); + entityendermite.setPlayerSpawned(true); entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch); diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java -index 2d9631c5d..16d94fe3f 100644 +index c2c4f97e2..f510696e1 100644 --- a/src/main/java/net/minecraft/server/EntityEvoker.java +++ b/src/main/java/net/minecraft/server/EntityEvoker.java @@ -0,0 +0,0 @@ public class EntityEvoker extends EntityIllagerWizard { @@ -161,7 +161,7 @@ index 50c0a8277..627ba1038 100644 return (EntityAgeable)object; } diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index ba6c0e96a..17850e857 100644 +index 2c0cac674..e2af18326 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -0,0 +0,0 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { @@ -187,20 +187,20 @@ index 560eac4af..4b928d2c7 100644 public boolean a(EntityHuman entityhuman, EnumHand enumhand) { diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 774e4d641..0cf53b69f 100644 +index 22cea8552..ac7f37e4b 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn } - public EntityLlama b(EntityAgeable entityageable) { + public EntityLlama createChild(EntityAgeable entityageable) { - EntityLlama entityllama1 = new EntityLlama(this.world); + EntityLlama entityllama1 = EntityTypes.LLAMA.create(world); // Paper this.a(entityageable, entityllama1); EntityLlama entityllama2 = (EntityLlama)entityageable; int i = this.random.nextInt(Math.max(this.getStrength(), entityllama2.getStrength())) + 1; diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index dab644930..737289588 100644 +index dde9f1e61..638dbe978 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -0,0 +0,0 @@ public class EntityMushroomCow extends EntityCow { @@ -215,20 +215,20 @@ index dab644930..737289588 100644 @@ -0,0 +0,0 @@ public class EntityMushroomCow extends EntityCow { } - public EntityMushroomCow c(EntityAgeable entityageable) { + public EntityMushroomCow createChild(EntityAgeable entityageable) { - return new EntityMushroomCow(this.world); + return EntityTypes.MOOSHROOM.create(world); // Paper } @Nullable diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 2a5a5516a..58518a509 100644 +index c83f71401..34e860b4c 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -0,0 +0,0 @@ public class EntityOcelot extends EntityTameableAnimal { } - public EntityOcelot b(EntityAgeable entityageable) { + public EntityOcelot createChild(EntityAgeable entityageable) { - EntityOcelot entityocelot = new EntityOcelot(this.world); + EntityOcelot entityocelot = EntityTypes.OCELOT.create(world); // Paper @@ -244,7 +244,7 @@ index 2a5a5516a..58518a509 100644 entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityocelot.setAgeRaw(-24000); diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 30306256a..4d9e8c378 100644 +index 9dc2d8be2..d1689dc33 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -0,0 +0,0 @@ public class EntityPig extends EntityAnimal { @@ -259,7 +259,7 @@ index 30306256a..4d9e8c378 100644 @@ -0,0 +0,0 @@ public class EntityPig extends EntityAnimal { } - public EntityPig b(EntityAgeable entityageable) { + public EntityPig createChild(EntityAgeable entityageable) { - return new EntityPig(this.world); + return EntityTypes.PIG.create(world); // Paper } @@ -279,25 +279,25 @@ index b9124a5b0..cb3e45f14 100644 public boolean f(ItemStack var1) { diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index a10de4e88..ea101bee9 100644 +index 7ee1b88f6..9605a50ae 100644 --- a/src/main/java/net/minecraft/server/EntityRabbit.java +++ b/src/main/java/net/minecraft/server/EntityRabbit.java @@ -0,0 +0,0 @@ public class EntityRabbit extends EntityAnimal { } - public EntityRabbit b(EntityAgeable entityageable) { + public EntityRabbit createChild(EntityAgeable entityageable) { - EntityRabbit entityrabbit = new EntityRabbit(this.world); + EntityRabbit entityrabbit = EntityTypes.RABBIT.create(world); // Paper int i = this.dJ(); if (this.random.nextInt(20) != 0) { diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index caf442610..2b50bc2ea 100644 +index b3586cd41..c0950116b 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java @@ -0,0 +0,0 @@ public class EntitySheep extends EntityAnimal { - public EntitySheep b(EntityAgeable entityageable) { + public EntitySheep createChild(EntityAgeable entityageable) { EntitySheep entitysheep = (EntitySheep) entityageable; - EntitySheep entitysheep1 = new EntitySheep(this.world); + EntitySheep entitysheep1 = EntityTypes.SHEEP.create(world); // Paper @@ -318,7 +318,7 @@ index 361c7831e..e46340e66 100644 entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 37fc10fba..98268145e 100644 +index 2484bd272..fbe504737 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { @@ -343,13 +343,13 @@ index 6b6fbfd79..29d5ef4c1 100644 public T a(World world) { return this.aT.apply(world); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index e4a570e01..0de37ceb3 100644 +index 2b2a6afb0..b2fb4af05 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { } - public EntityVillager b(EntityAgeable entityageable) { + public EntityVillager createChild(EntityAgeable entityageable) { - EntityVillager entityvillager = new EntityVillager(this.world); + EntityVillager entityvillager = EntityTypes.VILLAGER.create(world); // Paper @@ -365,20 +365,20 @@ index e4a570e01..0de37ceb3 100644 // Paper start if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 9a52d33d6..878eac112 100644 +index 9599d6fa0..5f3d3e472 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -0,0 +0,0 @@ public class EntityWolf extends EntityTameableAnimal { } - public EntityWolf b(EntityAgeable entityageable) { + public EntityWolf createChild(EntityAgeable entityageable) { - EntityWolf entitywolf = new EntityWolf(this.world); + EntityWolf entitywolf = EntityTypes.WOLF.create(world); // Paper UUID uuid = this.getOwnerUUID(); if (uuid != null) { diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 823d4be7f..2d87dca68 100644 +index 40abea29c..f25bcfd8f 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -431,7 +431,7 @@ index 85d402965..0cca7b6d5 100644 } diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index ab1b3ab5e..dbb833e49 100644 +index 17b9fd6dd..070c9c4c1 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java @@ -0,0 +0,0 @@ public class EntityZombieVillager extends EntityZombie { @@ -686,7 +686,7 @@ index ee401980f..9ca9306d0 100644 entityvindicator.setPositionRotation(blockposition, 0.0F, 0.0F); entityvindicator.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityvindicator)), (GroupDataEntity)null, (NBTTagCompound)null); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 899c7f5f7..aff5a62e5 100644 +index 63c802d02..4d93a22d8 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -699,7 +699,7 @@ index 899c7f5f7..aff5a62e5 100644 entityhorseskeleton.s(true); entityhorseskeleton.setAgeRaw(0); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 10fa12253..bd118f7f0 100644 +index 2d6d4307b..ee1079f80 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index c15be184af..0c65138326 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -143,7 +143,7 @@ index 000000000..685deaa0e + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index a575ff529..908127630 100644 +index 7f4c76669..1007641d5 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -185,7 +185,7 @@ index a575ff529..908127630 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a1a574023..ce1805062 100644 +index fd405281b..9c95661a7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.apache.commons.lang3.Validate; @@ -243,7 +243,7 @@ index a1a574023..ce1805062 100644 public KeyPair E() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 3f96443eb..fb9b0835b 100644 +index d8ed44fe2..e7bae58fa 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -257,7 +257,7 @@ index 3f96443eb..fb9b0835b 100644 this.k = new GameProfileBanList(PlayerList.a); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ba702591a..97fa98d2c 100644 +index 457dec91a..4a9af9ac1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import java.nio.ByteBuffer; diff --git a/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch index ac5ca11082..755f30f137 100644 --- a/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch @@ -6,21 +6,21 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 3dc7e2a89..5fb914f54 100644 +index 1b3ca24d9..2c79c5333 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer private static final Logger LOGGER = LogManager.getLogger(); private static final Pattern h = Pattern.compile("^[a-fA-F0-9]{40}$"); -- private final List serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); // CraftBukkit - fix decompile error -+ private final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queue +- private final List serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); ++ private final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue(); // Paper - use a proper queue private RemoteStatusListener j; public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this); private RemoteControlListener l; @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - public void aU() { + public void handleCommandQueue() { MinecraftTimings.serverCommandTimer.startTiming(); // Spigot - while (!this.serverCommandQueue.isEmpty()) { - ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); diff --git a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch index 99e6314b59..117ae10e3c 100644 --- a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6c427e9aa..f13fa7fff 100644 +index 07cd5aa28..fe0590dea 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -44,7 +44,7 @@ index c6ec1a782..6c61718b2 100644 if (this.isEmpty()) { throw new UnsupportedOperationException("No bounds for empty shape."); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7f23a8e2e..811311e9e 100644 +index 858cc1b97..78e85aacf 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -86,7 +86,7 @@ index 7f23a8e2e..811311e9e 100644 if (voxelshape.isEmpty()) { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index b220895c2..672c32858 100644 +index dcd628104..41b05f231 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch b/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch index 65416d4f84..5cc7f25adb 100644 --- a/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch +++ b/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch @@ -5,7 +5,7 @@ Subject: [PATCH] World EntityHuman Lookup Optimizations diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ccdb1ba01..12379f755 100644 +index 762ae7366..5e61826f6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -31,7 +31,7 @@ index ccdb1ba01..12379f755 100644 this.players.remove(entity); + this.playersByName.remove(entity.getName()); // Paper - World EntityHuman Lookup Optimizations // Spigot start - for ( WorldPersistentData worldData : worldMaps.a.values() ) + for ( WorldPersistentData worldData : worldMaps.worldMap.values() ) { @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); diff --git a/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch index 9224e1541a..c181436281 100644 --- a/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch @@ -6,7 +6,7 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 5600223d9..173712659 100644 +index d033969cd..9f1610326 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/getPlayerUniqueId-API.patch b/Spigot-Server-Patches/getPlayerUniqueId-API.patch index 52061e6f1e..4e365845a7 100644 --- a/Spigot-Server-Patches/getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/getPlayerUniqueId-API.patch @@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 07364554a..71d1929c1 100644 +index 054d3f3dc..ec197ef51 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch index f2a965cb5c..980e8d6454 100644 --- a/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch +++ b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch @@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 00751a9d9..587f00286 100644 +index 5076b9627..fb63496a0 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -24,11 +24,11 @@ index 00751a9d9..587f00286 100644 public void a(PacketPlayInKeepAlive packetplayinkeepalive) { - PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit + //PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit // Paper - This shouldn't be on the main thread - if (this.g && packetplayinkeepalive.b() == this.h) { - int i = (int) (SystemUtils.b() - this.f); + if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) { + int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive); this.player.ping = (this.player.ping * 3 + i) / 4; - this.g = false; + this.awaitingKeepAlive = false; } else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.G())) { - this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); + // Paper start - This needs to be handled on the main thread for plugins diff --git a/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch b/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch index c7c4e8e865..2ca49d627b 100644 --- a/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch +++ b/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch @@ -12,7 +12,7 @@ decrease when set, allowing us to skip further checks earlier on when looking for an attackable entity diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 05256ad3c..747fda044 100644 +index d14ee6b9b..9bf3f8343 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch index 6de57fd03d..7c00aa3a55 100644 --- a/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch @@ -21,11 +21,11 @@ index aefb0ce97..af31030dc 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index d03c2f4ae..64a5fefad 100644 +index b080fc792..fb76dc18b 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { - private void dF() { + private void createEffectCloud() { Collection collection = this.getEffects(); - if (!collection.isEmpty()) { diff --git a/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch index e4e7640521..63c528892e 100644 --- a/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch +++ b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch @@ -17,16 +17,16 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 587f00286..870b59ce1 100644 +index fb63496a0..921e1ec9e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private final MinecraftServer minecraftServer; public EntityPlayer player; private int e; -- private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER -+ private long f = SystemUtils.b(); private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER - set ping to delay initial - private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER +- private long lastKeepAlive; private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER ++ private long lastKeepAlive = SystemUtils.getMonotonicMillis(); private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER + private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER // CraftBukkit start - multithreaded fields @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -40,14 +40,14 @@ index 587f00286..870b59ce1 100644 @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } - this.minecraftServer.methodProfiler.a("keepAlive"); -- long i = SystemUtils.b(); + this.minecraftServer.methodProfiler.enter("keepAlive"); +- long i = SystemUtils.getMonotonicMillis(); - -- if (i - this.f >= 25000L) { // CraftBukkit -- if (this.g) { +- if (i - this.lastKeepAlive >= 25000L) { // CraftBukkit +- if (this.awaitingKeepAlive) { + // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings + // This should effectively place the keepalive handling back to "as it was" before 1.12.2 -+ long currentTime = SystemUtils.b(); ++ long currentTime = SystemUtils.getMonotonicMillis(); + long elapsedTime = currentTime - this.getLastPing(); + + if (this.isPendingPing()) { @@ -55,8 +55,8 @@ index 587f00286..870b59ce1 100644 + PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); - } else { -- this.g = true; -- this.f = i; +- this.awaitingKeepAlive = true; +- this.lastKeepAlive = i; - this.h = i; - this.sendPacket(new PacketPlayOutKeepAlive(this.h)); + } @@ -71,6 +71,6 @@ index 587f00286..870b59ce1 100644 } + // Paper end - this.minecraftServer.methodProfiler.e(); + this.minecraftServer.methodProfiler.exit(); // CraftBukkit start -- \ No newline at end of file diff --git a/scripts/decompile.sh b/scripts/decompile.sh index 54dbf7b11d..2771e260b7 100755 --- a/scripts/decompile.sh +++ b/scripts/decompile.sh @@ -124,7 +124,7 @@ if [ ! -d "$spigotdecompiledir/net" ]; then echo "Decompiling classes (stage 2)..." cd "$basedir" set +e - java -jar "$workdir/BuildData/bin/fernflower.jar" -dgs=1 -hdc=0 -asc=1 -udv=0 "$classdir" "$spigotdecompiledir" + java -jar "$workdir/BuildData/bin/fernflower.jar" -dgs=1 -hdc=0 -asc=1 -udv=0 -rsy=1 "$classdir" "$spigotdecompiledir" if [ "$?" != "0" ]; then rm -rf "$spigotdecompiledir/net" echo "Failed to decompile classes." diff --git a/scripts/remap.sh b/scripts/remap.sh index 3d736e77ce..8c3afcd13d 100755 --- a/scripts/remap.sh +++ b/scripts/remap.sh @@ -45,7 +45,7 @@ fi echo "Applying class mappings..." if [ ! -f "$jarpath-cl.jar" ]; then - java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null + java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --auto-synth -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null if [ "$?" != "0" ]; then echo "Failed to apply class mappings." exit 1 @@ -54,7 +54,7 @@ fi echo "Applying member mappings..." if [ ! -f "$jarpath-m.jar" ]; then - java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null + java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null if [ "$?" != "0" ]; then echo "Failed to apply member mappings." exit 1 @@ -63,7 +63,7 @@ fi echo "Creating remapped jar..." if [ ! -f "$jarpath-mapped.jar" ]; then - java -jar "$workdir/BuildData/bin/SpecialSource.jar" --kill-lvt -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null + java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/mojang/brigadier --kill-lvt -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null if [ "$?" != "0" ]; then echo "Failed to create remapped jar." exit 1 diff --git a/work/BuildData b/work/BuildData index d56672db7d..370a4d9802 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit d56672db7d59c99f62c4e78532aeca0d143bef42 +Subproject commit 370a4d9802d37f4228aa33720bdd5e9675222784 diff --git a/work/Bukkit b/work/Bukkit index 72520b78bb..b850a822c1 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 72520b78bb45ad6e931843c128baaf2cd4017109 +Subproject commit b850a822c1cd79cc5b8e9181b4b9e6b61977e0ec diff --git a/work/CraftBukkit b/work/CraftBukkit index 7fa173e6d1..38cf676e32 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 7fa173e6d18e848f04534fe87d22a05be016fda1 +Subproject commit 38cf676e328d869f8d5cded4d9e9ad3d75afb760 diff --git a/work/Spigot b/work/Spigot index 078a7f524d..1dc156ce48 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 078a7f524de58bbb5febe73f1f31db69bfbd8eff +Subproject commit 1dc156ce484f25ce6cfc7526f1de88aac5ac7a95