From 8199a18b2b3bcf20194bdf8067dcddf6df05bad4 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Thu, 12 Dec 2019 19:45:00 +0100 Subject: [PATCH] Compile fixes (#2732) --- .../Ability-to-apply-mending-to-XP-API.patch | 6 ++---- ...-replace-OfflinePlayer-getLastPlayed.patch | 4 ++-- ...-ray-tracing-methods-to-LivingEntity.patch | 4 ++-- Spigot-Server-Patches/Anti-Xray.patch | 18 ++++++++-------- ...uto-fix-bad-Y-levels-on-player-login.patch | 4 ++-- ...-remove-from-being-called-on-Players.patch | 2 +- .../Cache-user-authenticator-threads.patch | 2 +- .../Call-player-spectator-target-events.patch | 2 +- .../Chunk-debug-command.patch | 8 +++---- ...ctus-and-reed-natural-growth-heights.patch | 8 +++---- ...ck-and-tnt-entities-at-the-specified.patch | 21 +++++++++++++++---- ...e-attack-cooldown-methods-for-Player.patch | 2 +- ...ro-tick-instant-grow-farms-MC-113809.patch | 10 ++++----- .../Flag-to-disable-the-channel-limit.patch | 2 +- .../Improve-death-events.patch | 6 +++--- .../InventoryCloseEvent-Reason-API.patch | 4 ++-- ...mit-lightning-strike-effect-distance.patch | 4 ++-- Spigot-Server-Patches/MC-Utils.patch | 6 +++--- .../Optional-TNT-doesn-t-move-in-water.patch | 4 ++-- ...layer-View-Distance-API-placeholders.patch | 2 +- .../Player.setPlayerProfile-API.patch | 2 +- .../PreCreatureSpawnEvent.patch | 4 ++-- .../Prevent-Fire-from-loading-chunks.patch | 4 ++-- .../Properly-fix-item-duplication-bug.patch | 2 +- ...ers-that-dismount-from-other-players.patch | 16 ++++++++++---- .../Reset-players-airTicks-on-respawn.patch | 2 +- ...vehicle-tracking-issue-on-disconnect.patch | 2 +- ...ement-optional-per-player-mob-spawns.patch | 10 ++++----- 28 files changed, 90 insertions(+), 71 deletions(-) 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 6bfc57068a..8380b1d314 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 @@ -43,7 +43,7 @@ index b3edb69a9..87c6b77ce 100644 return i * 2; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cade504af..c82de14eb 100644 +index d47b982e7..6bdee24f8 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 { @@ -62,9 +62,7 @@ index cade504af..c82de14eb 100644 + net.minecraft.server.EntityExperienceOrb orb = net.minecraft.server.EntityTypes.EXPERIENCE_ORB.create(handle.world); + orb.value = amount; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; -+ orb.locX = handle.locX; -+ orb.locY = handle.locY; -+ orb.locZ = handle.locZ; ++ orb.setPositionRaw(handle.locX(), handle.locY(), handle.locZ()); + + int i = Math.min(orb.xpToDur(amount), itemstack.getDamage()); + org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i); diff --git a/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 902f4f1635..e52b325210 100644 --- a/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f41fd576d..1665a302a 100644 +index 64992e139..ad600c318 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 { @@ -106,7 +106,7 @@ index c1ef1c950..3824180ee 100644 public Location getBedSpawnLocation() { NBTTagCompound data = getData(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ad70bd5ba..04fc8e233 100644 +index 05f380023..67a960616 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 { diff --git a/Spigot-Server-Patches/Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/Add-ray-tracing-methods-to-LivingEntity.patch index 20317d794e..2b3a66a5ab 100644 --- a/Spigot-Server-Patches/Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/Add-ray-tracing-methods-to-LivingEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 91b6d6878..ac85a5d23 100644 +index 91b6d6878..1592a705f 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 { @@ -21,7 +21,7 @@ index 91b6d6878..ac85a5d23 100644 + throw new IllegalArgumentException("maxDistance must be between 1-120"); + } + -+ Vec3D start = new Vec3D(locX, locY + getHeadHeight(), locZ); ++ Vec3D start = new Vec3D(locX(), locY() + getHeadHeight(), locZ()); + org.bukkit.util.Vector dir = getBukkitEntity().getLocation().getDirection().multiply(maxDistance); + Vec3D end = new Vec3D(start.x + dir.getX(), start.y + dir.getY(), start.z + dir.getZ()); + RayTrace raytrace = new RayTrace(start, end, RayTrace.BlockCollisionOption.OUTLINE, fluidCollisionOption, this); diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index 5c634fb6ae..f7e9ba91cb 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1440,7 +1440,7 @@ index e156804f7..96a785af2 100644 public void a() { this.o(); diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 47710067a..654474341 100644 +index 47710067a..ef7ade797 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ @@ -1491,21 +1491,25 @@ index 47710067a..654474341 100644 iterator = chunk.getTileEntities().entrySet().iterator(); int totalSigns = 0; // Paper @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { + this.g.add(nbttagcompound); } } ++ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks ++ } + // Paper start - Async-Anti-Xray - Getter and Setter for the ready flag + public boolean isReady() { + return this.ready; -+ } -+ + } + + public void setReady(boolean ready) { + this.ready = ready; - } ++ } + // Paper end - ++ @Override public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.a = packetdataserializer.readInt(); @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { public int writeChunk(PacketDataSerializer packetDataSerializer, Chunk chunk, int chunkSectionSelector) { return this.a(packetDataSerializer, chunk, chunkSectionSelector); } // Paper - OBFHELPER @@ -1527,11 +1531,7 @@ index 47710067a..654474341 100644 + chunksection.getBlocks().writeDataPaletteBlock(packetdataserializer, chunkPacketInfo, k); // Paper - Anti-Xray - Add chunk packet info } } -+ chunk.world.chunkPacketBlockController.modifyBlocks(this, chunkPacketInfo, forceLoad, null); // Paper - Anti-Xray - Modify blocks -+ } - return j; - } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java index 43d9a5634..615d27863 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java diff --git a/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch index c2f75efcf1..d86992ba8f 100644 --- a/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch +++ b/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch @@ -6,14 +6,14 @@ Subject: [PATCH] Auto fix bad Y levels on player login Bring down to a saner Y level if super high, as this can cause the server to crash diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a9827322c..3e958eaf8 100644 +index a9827322c..2582f76d3 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 { @Override public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); -+ if (this.locY > 300) this.locY = 257; // Paper - bring down to a saner Y level if out of world ++ if (this.locY() > 300) this.setPositionRaw(locX(), 257, locZ()); // Paper - bring down to a saner Y level if out of world if (nbttagcompound.hasKeyOfType("playerGameType", 99)) { if (this.getMinecraftServer().getForceGamemode()) { this.playerInteractManager.setGameMode(this.getMinecraftServer().getGamemode()); diff --git a/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch index 5bb7511947..6c1f1931c6 100644 --- a/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch @@ -12,7 +12,7 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 04fc8e233..4b847ddd8 100644 +index 67a960616..b176b2346 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 { diff --git a/Spigot-Server-Patches/Cache-user-authenticator-threads.patch b/Spigot-Server-Patches/Cache-user-authenticator-threads.patch index 73a88de264..706066aa89 100644 --- a/Spigot-Server-Patches/Cache-user-authenticator-threads.patch +++ b/Spigot-Server-Patches/Cache-user-authenticator-threads.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache user authenticator threads diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3e958eaf8..bf74db31e 100644 +index 2943918e4..caca40a0c 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.google.common.collect.Lists; diff --git a/Spigot-Server-Patches/Call-player-spectator-target-events.patch b/Spigot-Server-Patches/Call-player-spectator-target-events.patch index 3f5e9772d5..e6106746a8 100644 --- a/Spigot-Server-Patches/Call-player-spectator-target-events.patch +++ b/Spigot-Server-Patches/Call-player-spectator-target-events.patch @@ -5,7 +5,7 @@ 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 26096afbe..bdb73b68a 100644 +index 51b3acadb..9b1758303 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/Chunk-debug-command.patch b/Spigot-Server-Patches/Chunk-debug-command.patch index 205d260acf..c864fdb02a 100644 --- a/Spigot-Server-Patches/Chunk-debug-command.patch +++ b/Spigot-Server-Patches/Chunk-debug-command.patch @@ -198,7 +198,7 @@ index 038b7b68d..9b2bafdbd 100644 public final ChunkGenerator chunkGenerator; private final WorldServer world; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index ec3732193..23d1935dd 100644 +index d49e210a3..25a87c2d3 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ import com.destroystokyo.paper.block.TargetBlockInfo; @@ -334,9 +334,9 @@ index ec3732193..23d1935dd 100644 + JsonObject playerData = new JsonObject(); + + playerData.addProperty("name", player.getName()); -+ playerData.addProperty("x", player.locX); -+ playerData.addProperty("y", player.locY); -+ playerData.addProperty("z", player.locZ); ++ playerData.addProperty("x", player.locX()); ++ playerData.addProperty("y", player.locY()); ++ playerData.addProperty("z", player.locZ()); + + playersData.add(playerData); + diff --git a/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch b/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch index a8ac9f7028..d8b0dbf381 100644 --- a/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch +++ b/Spigot-Server-Patches/Configurable-cactus-and-reed-natural-growth-heights.patch @@ -23,7 +23,7 @@ index a73865739..098bd3fba 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java -index 1e1d02dc7..4c82fe335 100644 +index 1e1d02dc7..e0974e256 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -0,0 +0,0 @@ public class BlockCactus extends Block { @@ -31,12 +31,12 @@ index 1e1d02dc7..4c82fe335 100644 } - if (i < 3) { -+ if (i < world.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height ++ if (i < worldserver.paperConfig.cactusMaxHeight) { // Paper - Configurable growth height int j = (Integer) iblockdata.get(BlockCactus.AGE); if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java -index 2106b0b49..baa2ed2b6 100644 +index 2106b0b49..55b07444e 100644 --- a/src/main/java/net/minecraft/server/BlockReed.java +++ b/src/main/java/net/minecraft/server/BlockReed.java @@ -0,0 +0,0 @@ public class BlockReed extends Block { @@ -44,7 +44,7 @@ index 2106b0b49..baa2ed2b6 100644 } - if (i < 3) { -+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height ++ if (i < worldserver.paperConfig.reedMaxHeight) { // Paper - Configurable growth height int j = (Integer) iblockdata.get(BlockReed.AGE); if (j >= (byte) range(3, ((100.0F / worldserver.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot diff --git a/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch index 61eaeeb605..4dcc3cca80 100644 --- a/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -36,7 +36,7 @@ index bf059dc86..2c36fc71c 100644 public EntityItem a(ItemStack itemstack, float f) { if (itemstack.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 20cb7dbaf..d835b9f85 100644 +index 20cb7dbaf..0342c873a 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 { @@ -45,7 +45,7 @@ index 20cb7dbaf..d835b9f85 100644 this.move(EnumMoveType.SELF, this.getMot()); + + // Paper start - Configurable EntityFallingBlock height nerf -+ if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperConfig.fallingBlockHeightNerf) { ++ if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY() > this.world.paperConfig.fallingBlockHeightNerf) { + if (this.dropItem && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { + this.a(block); + } @@ -57,7 +57,7 @@ index 20cb7dbaf..d835b9f85 100644 blockposition = new BlockPosition(this); boolean flag = this.block.getBlock() instanceof BlockConcretePowder; diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index d04212436..b92c8c47f 100644 +index d04212436..33c51dced 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 { @@ -65,11 +65,24 @@ index d04212436..b92c8c47f 100644 this.move(EnumMoveType.SELF, this.getMot()); + // Paper start - Configurable TNT entity height nerf -+ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY > this.world.paperConfig.entityTNTHeightNerf) { ++ if (this.world.paperConfig.entityTNTHeightNerf != 0 && this.locY() > this.world.paperConfig.entityTNTHeightNerf) { + this.die(); + } + // Paper end this.setMot(this.getMot().a(0.98D)); if (this.onGround) { this.setMot(this.getMot().d(0.7D, -0.5D, 0.7D)); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index b26dff0a7..8d803dc68 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 { + + @Override + public void setStatistic(Statistic statistic, EntityType entityType, int newValue) { +- Validate.notNull(statistic, "Statistic cannot be null"); ++ Validate.notNull(statistic, "TNStatistic cannot be null"); + Validate.notNull(entityType, "EntityType cannot be null"); + Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0"); + Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch index 2ba15cbc19..8115e72d1c 100644 --- a/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch @@ -27,7 +27,7 @@ index 007934d8c..78e48f478 100644 this.aB = 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e45dd6cd4..9e0be10d7 100644 +index 61dbb31e7..c6c392676 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 { diff --git a/Spigot-Server-Patches/Fix-zero-tick-instant-grow-farms-MC-113809.patch b/Spigot-Server-Patches/Fix-zero-tick-instant-grow-farms-MC-113809.patch index 6ad366138b..07e62b3ca6 100644 --- a/Spigot-Server-Patches/Fix-zero-tick-instant-grow-farms-MC-113809.patch +++ b/Spigot-Server-Patches/Fix-zero-tick-instant-grow-farms-MC-113809.patch @@ -45,31 +45,31 @@ index c482aad3e..02c548dd9 100644 int i = this.b(worldserver, blockposition) + 1; diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java -index 4c82fe335..728491dd9 100644 +index 4c82fe335..44ce67eb8 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -0,0 +0,0 @@ public class BlockCactus extends Block { if (!iblockdata.canPlace(worldserver, blockposition)) { worldserver.b(blockposition, true); } else { -+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809 ++ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809 BlockPosition blockposition1 = blockposition.up(); if (worldserver.isEmpty(blockposition1)) { diff --git a/src/main/java/net/minecraft/server/BlockChorusFlower.java b/src/main/java/net/minecraft/server/BlockChorusFlower.java -index d70b52cad..ff0ba15f8 100644 +index d70b52cad..b624cf380 100644 --- a/src/main/java/net/minecraft/server/BlockChorusFlower.java +++ b/src/main/java/net/minecraft/server/BlockChorusFlower.java @@ -0,0 +0,0 @@ public class BlockChorusFlower extends Block { if (!iblockdata.canPlace(worldserver, blockposition)) { worldserver.b(blockposition, true); } else { -+ if (world.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809 ++ if (worldserver.paperConfig.fixZeroTickInstantGrowFarms && !randomTick) return; // Paper - fix MC-113809 BlockPosition blockposition1 = blockposition.up(); if (worldserver.isEmpty(blockposition1) && blockposition1.getY() < 256) { diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java -index baa2ed2b6..083b7ee59 100644 +index 55b07444e..3bc3c5aa2 100644 --- a/src/main/java/net/minecraft/server/BlockReed.java +++ b/src/main/java/net/minecraft/server/BlockReed.java @@ -0,0 +0,0 @@ public class BlockReed extends Block { diff --git a/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch index d83c74461a..6b6ed004f1 100644 --- a/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 87b715d69..4dc79ca4e 100644 +index e786641cc..b3a2b7fea 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 { diff --git a/Spigot-Server-Patches/Improve-death-events.patch b/Spigot-Server-Patches/Improve-death-events.patch index 94db654b38..7c3d88f7e6 100644 --- a/Spigot-Server-Patches/Improve-death-events.patch +++ b/Spigot-Server-Patches/Improve-death-events.patch @@ -119,7 +119,7 @@ index 80717ad9a..53aac5bcc 100644 public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ac85a5d23..c6bd68919 100644 +index 1592a705f..78e4fe67d 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 { @@ -279,7 +279,7 @@ index ac85a5d23..c6bd68919 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 bb2a0b7e6..26096afbe 100644 +index ca69f9038..139d19cde 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 { @@ -357,7 +357,7 @@ index 90fdf89c8..b761a41dc 100644 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9e0be10d7..ad70bd5ba 100644 +index c6c392676..05f380023 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 { diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index 6a6ab4ee61..856544e337 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -34,7 +34,7 @@ index 3917980b7..007934d8c 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 4e6601617..bb2a0b7e6 100644 +index 6443e68f4..850c7cc1b 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 { @@ -155,7 +155,7 @@ index cd8ad2704..e169679c8 100644 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4dc79ca4e..e45dd6cd4 100644 +index b3a2b7fea..61dbb31e7 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 { diff --git a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch index f7ec498d69..96ba936353 100644 --- a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch @@ -38,7 +38,7 @@ index e49318a19..fe3e78f36 100644 private void fixedInhabitedTime() { if (PaperConfig.version < 16) { diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index 7c518983a..0bd67395e 100644 +index 7c518983a..bdb534deb 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -0,0 +0,0 @@ public class EntityLightning extends Entity { @@ -48,7 +48,7 @@ index 7c518983a..0bd67395e 100644 + // Paper start - Limit lightning strike effect distance + if (distanceSquared <= this.world.paperConfig.sqrMaxLightningImpactSoundDistance) { + player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, -+ SoundCategory.WEATHER, this.locX, this.locY, this.locZ, 2.0f, 0.5F + this.random.nextFloat() * 0.2F)); ++ SoundCategory.WEATHER, this.locX(), this.locY(), this.locZ(), 2.0f, 0.5F + this.random.nextFloat() * 0.2F)); + } + + if (world.paperConfig.sqrMaxThunderDistance != -1 && distanceSquared >= world.paperConfig.sqrMaxThunderDistance) { diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index 4906b8e2b6..de8655fb30 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -473,7 +473,7 @@ index 06360cf7c..8e8fab497 100644 // CraftBukkit end 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 000000000..c96f3ed17 +index 000000000..628b73a12 --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ @@ -660,7 +660,7 @@ index 000000000..c96f3ed17 + * @return + */ + public static double distanceSq(Entity e1, Entity e2) { -+ return distanceSq(e1.locX,e1.locY,e1.locZ, e2.locX,e2.locY,e2.locZ); ++ return distanceSq(e1.locX(),e1.locY(),e1.locZ(), e2.locX(),e2.locY(),e2.locZ()); + } + + /** @@ -715,7 +715,7 @@ index 000000000..c96f3ed17 + * @return + */ + public static Location toLocation(Entity entity) { -+ return new Location(entity.getWorld().getWorld(), entity.locX, entity.locY, entity.locZ); ++ return new Location(entity.getWorld().getWorld(), entity.locX(), entity.locY(), entity.locZ()); + } + + public static org.bukkit.block.Block toBukkitBlock(World world, BlockPosition pos) { 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 ac997601b8..3572cee50a 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 @@ -49,7 +49,7 @@ index 2e56c7f57..e04b3f4e2 100644 } diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 7625dca00..75193e87d 100644 +index 346315acb..d3b2075f2 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 { @@ -70,7 +70,7 @@ index 7625dca00..75193e87d 100644 + PacketPlayOutEntityTeleport positionPacket = new PacketPlayOutEntityTeleport(this); + + ete.trackedPlayers.stream() -+ .filter(viewer -> (viewer.locX - this.locX) * (viewer.locY - this.locY) * (viewer.locZ - this.locZ) < 16 * 16) ++ .filter(viewer -> (viewer.locX() - this.locX()) * (viewer.locY() - this.locY()) * (viewer.locZ() - this.locZ()) < 16 * 16) + .forEach(viewer -> { + viewer.playerConnection.sendPacket(velocityPacket); + viewer.playerConnection.sendPacket(positionPacket); diff --git a/Spigot-Server-Patches/Per-Player-View-Distance-API-placeholders.patch b/Spigot-Server-Patches/Per-Player-View-Distance-API-placeholders.patch index ce975c59a1..345d0a1b38 100644 --- a/Spigot-Server-Patches/Per-Player-View-Distance-API-placeholders.patch +++ b/Spigot-Server-Patches/Per-Player-View-Distance-API-placeholders.patch @@ -39,7 +39,7 @@ index 2e95069c1..8977c3516 100644 double deltaX = this.locX() - player.locX(); double deltaZ = this.locZ() - player.locZ(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4b847ddd8..049ebf4c4 100644 +index b176b2346..5603ed126 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 { diff --git a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index d8d492a34c..9dccc54275 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -48,7 +48,7 @@ index 0614976b8..a985ae7ba 100644 uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c82de14eb..87b715d69 100644 +index 6bdee24f8..e786641cc 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 @@ diff --git a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch index ca0e9336a4..09f277f933 100644 --- a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch @@ -47,7 +47,7 @@ index 258e96ba5..fe8bc7f75 100644 entity1.setPositionRotation(d3, d4, d5, entity1.yaw, entity1.pitch); return entity1; diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 02157d051..487114367 100644 +index 02157d051..224443e03 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 { @@ -69,7 +69,7 @@ index 02157d051..487114367 100644 + org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityTypes.getName(cls).getKey()); + if (type != null) { + event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( -+ MCUtil.toLocation(world, blockposition_mutableblockposition), ++ MCUtil.toLocation(worldserver, blockposition_mutableblockposition), + type, SpawnReason.NATURAL + ); + if (!event.callEvent()) { diff --git a/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch b/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch index b4586dd549..d8e327ed69 100644 --- a/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch +++ b/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch @@ -7,14 +7,14 @@ This causes the nether to spam unload/reload chunks, plus overall bad behavior. diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index 2909f78f8..9cf7d0b9e 100644 +index 2909f78f8..0ece78d4d 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -0,0 +0,0 @@ public class BlockFire extends Block { } blockposition_mutableblockposition.g(blockposition).e(l, j1, i1); -+ if (!world.isLoaded(blockposition_mutableblockposition)) continue; // Paper ++ if (!worldserver.isLoaded(blockposition_mutableblockposition)) continue; // Paper int l1 = this.a((IWorldReader) worldserver, (BlockPosition) blockposition_mutableblockposition); if (l1 > 0) { diff --git a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch index 50fbd29200..4dd008ca90 100644 --- a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bf74db31e..4e6601617 100644 +index caca40a0c..6443e68f4 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/Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/Re-track-players-that-dismount-from-other-players.patch index 0a67ee73a6..9429e01568 100644 --- a/Spigot-Server-Patches/Re-track-players-that-dismount-from-other-players.patch +++ b/Spigot-Server-Patches/Re-track-players-that-dismount-from-other-players.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Re-track players that dismount from other players diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6595dca86..a9827322c 100644 +index 6595dca86..ab8af05e7 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 { - if (!this.isSpectator()) { - super.b(blockposition); + this.playerConnection.a(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); } + + // Paper start - "Fixes" an issue in which the vehicle player would not be notified that the passenger dismounted + if (entity instanceof EntityPlayer) { + // TODO verify this solution @@ -20,7 +20,15 @@ index 6595dca86..a9827322c 100644 + worldServer.getChunkProvider().playerChunkMap.addEntity(this); + } + // Paper end - } + @Override +@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + if (!this.isSpectator()) { + super.b(blockposition); + } +- + } + + public void a(double d0, boolean flag) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch index b4f21826e3..d5b15eaae8 100644 --- a/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch @@ -17,7 +17,7 @@ index 5d31068d7..365984bb8 100644 return 300; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bdb73b68a..c15543a5c 100644 +index 9b1758303..c467ca356 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/Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 49730da800..3b9b85b9c7 100644 --- a/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 1665a302a..cc9e69651 100644 +index 0f8e0e81e..ac032c0ed 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/implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch index 243ffd58e0..0ca8d97246 100644 --- a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch +++ b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch @@ -601,7 +601,7 @@ index f138b112f..109c6ada8 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ca2398386..19ba79c65 100644 +index fc3cb17e6..c9492ed37 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 { @@ -645,7 +645,7 @@ index d49ad0308..2fb04e3e9 100644 return this.bb; } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index fc6436c4f..67a909859 100644 +index fc6436c4f..9915c2443 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 extends IChunkLoader implements PlayerChunk.d { @@ -669,8 +669,8 @@ index fc6436c4f..67a909859 100644 + if (!this.world.paperConfig.perPlayerMobSpawns) { + return; + } -+ int chunkX = (int)Math.floor(entity.locX) >> 4; -+ int chunkZ = (int)Math.floor(entity.locZ) >> 4; ++ int chunkX = (int)Math.floor(entity.locX()) >> 4; ++ int chunkZ = (int)Math.floor(entity.locZ()) >> 4; + int index = entity.getEntityType().getEnumCreatureType().ordinal(); + + for (EntityPlayer player : this.playerMobDistanceMap.getPlayersInRange(chunkX, chunkZ)) { @@ -684,7 +684,7 @@ index fc6436c4f..67a909859 100644 private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index bcca7faed..57ce02a97 100644 +index e168c528c..56dabbc15 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ package net.minecraft.server;