From 567bd0fcac48c6cbbcba19c91720e5734e4948e4 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 28 Apr 2019 10:59:47 -0700 Subject: [PATCH] More 1.14 patches --- ...e-PlayerProfile-in-AsyncPreLoginEven.patch | 4 +- .../Add-ArmorStand-Item-Meta.patch | 18 +-- .../Add-setPlayerProfile-API-for-Skulls.patch | 15 ++- ...l-PortalCreateEvent-for-exit-portals.patch | 44 +------- ...le-Explicit-Network-Manager-Flushing.patch | 2 +- .../Extend-Player-Interact-cancellation.patch | 2 +- .../Fill-Profile-Property-Events.patch | 2 +- .../Fix-Dragon-Server-Crashes.patch | 8 +- ...ting-location-from-InventoryEnderChe.patch | 2 +- ...nt-extended-PaperServerListPingEvent.patch | 26 ++--- .../Improved-Async-Task-Scheduler.patch | 12 +- ...ke-legacy-ping-handler-more-reliable.patch | 4 +- ...Make-player-data-saving-configurable.patch | 10 +- .../Player.setPlayerProfile-API.patch | 41 ++++--- ...PlayerAdvancementCriterionGrantEvent.patch | 2 +- .../PlayerNaturallySpawnCreaturesEvent.patch | 41 +++---- .../PreCreatureSpawnEvent.patch | 106 +++++++++--------- ...sted-Ice-from-loading-holding-chunks.patch | 4 +- .../Tameable-getOwnerUniqueId-API.patch | 4 +- ...r-crits-helps-mitigate-hacked-client.patch | 6 +- .../getPlayerUniqueId-API.patch | 2 +- 21 files changed, 160 insertions(+), 195 deletions(-) diff --git a/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index 484cf35e5..25bde5e20 100644 --- a/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 15c01333e7..da5a7b3e92 100644 +index fe912e0eb..7c3b9c0b9 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ @@ -25,7 +25,7 @@ index 15c01333e7..da5a7b3e92 100644 import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.PlayerPreLoginEvent; -@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { +@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { java.util.UUID uniqueId = i.getId(); final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server; diff --git a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch index 4a47685a0..5002b9fe2 100644 --- a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch +++ b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch @@ -13,7 +13,7 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 3a6e6f687d..6a86cb7eb4 100644 +index dd02fb95a..7c2c4ecc5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { @@ -26,7 +26,7 @@ index 3a6e6f687d..6a86cb7eb4 100644 case CHEST: case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index eeb2c5689e..69faeb9c09 100644 +index 6c00ca737..4d8013685 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack { @@ -40,7 +40,7 @@ index eeb2c5689e..69faeb9c09 100644 case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java new file mode 100644 -index 0000000000..c00b89c8d4 +index 000000000..c00b89c8d --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java @@ -0,0 +0,0 @@ @@ -356,10 +356,10 @@ index 0000000000..c00b89c8d4 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 2508cfcfa2..570f695d82 100644 +index b3f8249b0..9435136cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { +@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { .put(CraftMetaCharge.class, "FIREWORK_EFFECT") .put(CraftMetaKnowledgeBook.class, "KNOWLEDGE_BOOK") .put(CraftMetaTropicalFishBucket.class, "TROPICAL_FISH_BUCKET") @@ -367,7 +367,7 @@ index 2508cfcfa2..570f695d82 100644 .put(CraftMetaItem.class, "UNSPECIFIC") .build(); -@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { +@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaCharge.EXPLOSION.NBT, CraftMetaBlockState.BLOCK_ENTITY_TAG.NBT, CraftMetaKnowledgeBook.BOOK_RECIPES.NBT, @@ -385,13 +385,13 @@ index 2508cfcfa2..570f695d82 100644 } return HANDLED_TAGS; diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index 5a2de14fa5..d4f4508cce 100644 +index 176b8f528..93c4e1239 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -0,0 +0,0 @@ import java.util.Arrays; +@@ -0,0 +0,0 @@ import java.util.ArrayList; + import java.util.Arrays; import java.util.List; import java.util.UUID; - +import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper import net.minecraft.server.Block; import net.minecraft.server.IRegistry; diff --git a/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch b/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch index 52d27c44b..d326aaec7 100644 --- a/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch +++ b/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch @@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java -index 110e04597b..c260af11cd 100644 +index a4bc7f970..2dd2f476f 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -0,0 +0,0 @@ @@ -48,24 +48,23 @@ index 110e04597b..c260af11cd 100644 public BlockFace getRotation() { BlockData blockData = getBlockData(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 2ad3acf43b..87e51cf8ad 100644 +index f27053276..5c8e16c00 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.inventory; - + import com.google.common.collect.ImmutableMap.Builder; + import com.mojang.authlib.GameProfile; import java.util.Map; - +import com.destroystokyo.paper.profile.CraftPlayerProfile; +import com.destroystokyo.paper.profile.PlayerProfile; import net.minecraft.server.GameProfileSerializer; import net.minecraft.server.NBTBase; import net.minecraft.server.NBTTagCompound; -@@ -0,0 +0,0 @@ import org.bukkit.inventory.meta.SkullMeta; - import com.google.common.collect.ImmutableMap.Builder; - import com.mojang.authlib.GameProfile; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; + import org.bukkit.craftbukkit.util.CraftMagicNumbers; + import org.bukkit.inventory.meta.SkullMeta; +import javax.annotation.Nullable; -+ @DelegateDeserialization(SerializableMeta.class) class CraftMetaSkull extends CraftMetaItem implements SkullMeta { diff --git a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch index ba3ae90b1..8ea21a0dd 100644 --- a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch +++ b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch @@ -5,43 +5,9 @@ Subject: [PATCH] Call PortalCreateEvent for exit portals diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index aca4071420..a24bd02d5b 100644 +index e7ca777c1..7807f7c41 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 { - byte b0 = 1; - byte b1 = 0; - -+ java.util.Collection bukkitBlocks = new java.util.HashSet<>(); // Paper -+ java.util.Map nmsBlocks = new java.util.LinkedHashMap<>(); // Paper -+ - for (int l = -2; l <= 2; ++l) { - for (int i1 = -2; i1 <= 2; ++i1) { - for (int j1 = -1; j1 < 3; ++j1) { -@@ -0,0 +0,0 @@ public class PortalTravelAgent { - int i2 = k + i1 * 0 - l * 1; - boolean flag2 = j1 < 0; - -- this.world.setTypeUpdate(new BlockPosition(k1, l1, i2), flag2 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData()); -+ // Paper start -+ BlockPosition pos = new BlockPosition(k1, l1, i2); -+ nmsBlocks.put(pos, flag2 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData()); -+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ())); -+ // Paper end - } - } - } - -+ // Paper start -+ org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent(bukkitBlocks, this.world.getWorld(), org.bukkit.event.world.PortalCreateEvent.CreateReason.OBC_DESTINATION); -+ if (event.callEvent()) { -+ nmsBlocks.forEach(this.world::setTypeUpdate); -+ } -+ // Paper end -+ - // CraftBukkit start - return new BlockPosition(i, k, k); - } @@ -0,0 +0,0 @@ public class PortalTravelAgent { l5 = -l5; } @@ -50,13 +16,13 @@ index aca4071420..a24bd02d5b 100644 + java.util.Map nmsBlocks = new java.util.LinkedHashMap<>(); // Paper + if (d0 < 0.0D) { - i1 = MathHelper.clamp(i1, 70, this.world.ab() - 10); + i1 = MathHelper.clamp(i1, 70, this.world.getHeight() - 10); j5 = i1; @@ -0,0 +0,0 @@ public class PortalTravelAgent { i4 = j2 + (i3 - 1) * l5 - k2 * k5; boolean flag1 = l2 < 0; -- blockposition_mutableblockposition.c(j3, l3, i4); +- blockposition_mutableblockposition.d(j3, l3, i4); - this.world.setTypeUpdate(blockposition_mutableblockposition, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData()); + // Paper start + BlockPosition pos = new BlockPosition(j3, l3, i4); @@ -69,7 +35,7 @@ index aca4071420..a24bd02d5b 100644 @@ -0,0 +0,0 @@ public class PortalTravelAgent { for (i3 = -1; i3 < 4; ++i3) { if (k2 == -1 || k2 == 2 || i3 == -1 || i3 == 3) { - blockposition_mutableblockposition.c(i5 + k2 * k5, j5 + i3, j2 + k2 * l5); + blockposition_mutableblockposition.d(i5 + k2 * k5, j5 + i3, j2 + k2 * l5); - this.world.setTypeAndData(blockposition_mutableblockposition, Blocks.OBSIDIAN.getBlockData(), 3); + // Paper start + BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ()); @@ -82,7 +48,7 @@ index aca4071420..a24bd02d5b 100644 @@ -0,0 +0,0 @@ public class PortalTravelAgent { for (i3 = 0; i3 < 2; ++i3) { for (l2 = 0; l2 < 3; ++l2) { - blockposition_mutableblockposition.c(i5 + i3 * k5, j5 + l2, j2 + i3 * l5); + blockposition_mutableblockposition.d(i5 + i3 * k5, j5 + l2, j2 + i3 * l5); - this.world.setTypeAndData(blockposition_mutableblockposition, iblockdata, 18); + + // Paper start diff --git a/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch b/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch index 9266d4a9a..8698bd8d4 100644 --- a/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch +++ b/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch @@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread. Renable flushing by passing -Dpaper.explicit-flush=true diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 2ff2549d0e..4a50aab512 100644 +index 5d5e23c18..6c5544807 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> { diff --git a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index 63de3d769..9c02e41ec 100644 --- a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch @@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds when cancelling interaction. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 6ae6afa339..07f9b8d2f7 100644 +index a7411c75a..f692da609 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -0,0 +0,0 @@ public class PlayerInteractManager { diff --git a/Spigot-Server-Patches/Fill-Profile-Property-Events.patch b/Spigot-Server-Patches/Fill-Profile-Property-Events.patch index e00c8bd90..b88b83919 100644 --- a/Spigot-Server-Patches/Fill-Profile-Property-Events.patch +++ b/Spigot-Server-Patches/Fill-Profile-Property-Events.patch @@ -11,7 +11,7 @@ If Mojang API does need to be hit, event fire so you can get the results. This is useful for implementing a ProfileCache for Player Skulls diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java -index 4b2a67423f..61cfdf73c8 100644 +index 4b2a67423..61cfdf73c 100644 --- a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java +++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch b/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch index 7b7a336bf..c47910c92 100644 --- a/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch +++ b/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch @@ -7,16 +7,16 @@ If the dragon tries to find "ground" and hits a hole, or off edge, it will infinitely keep looking for non air and eventually crash. diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index 1180e7bc11..1906bcfc96 100644 +index cfe84f4d4..4ab310cd6 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -0,0 +0,0 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded - double d2 = this.a.bD.locY + (double) (this.a.bD.length / 2.0F); - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(MathHelper.floor(d0), MathHelper.floor(d2), MathHelper.floor(d1)); + double d2 = this.a.bA.locY + (double) (this.a.bA.getHeight() / 2.0F); + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(d0, d2, d1); - while (this.a.world.isEmpty(blockposition_mutableblockposition)) { + while (this.a.world.isEmpty(blockposition_mutableblockposition ) && d2 > 0) { // Paper --d2; - blockposition_mutableblockposition.c(MathHelper.floor(d0), MathHelper.floor(d2), MathHelper.floor(d1)); + blockposition_mutableblockposition.c(d0, d2, d1); } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch b/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch index 27fd7bb9f..460a2cf15 100644 --- a/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch +++ b/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java -index ac81d3f86b..f50bae0123 100644 +index 343670b20..6960ad433 100644 --- a/src/main/java/net/minecraft/server/InventoryEnderChest.java +++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder; diff --git a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch index d8ddfec73..05b7e1e56 100644 --- a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement extended PaperServerListPingEvent diff --git a/src/main/java/com/destroystokyo/paper/network/PaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/PaperServerListPingEventImpl.java new file mode 100644 -index 0000000000..c1a8e295b6 +index 000000000..c1a8e295b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/PaperServerListPingEventImpl.java @@ -0,0 +0,0 @@ @@ -43,7 +43,7 @@ index 0000000000..c1a8e295b6 +} diff --git a/src/main/java/com/destroystokyo/paper/network/PaperStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperStatusClient.java new file mode 100644 -index 0000000000..a2a409e635 +index 000000000..a2a409e63 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/PaperStatusClient.java @@ -0,0 +0,0 @@ @@ -60,7 +60,7 @@ index 0000000000..a2a409e635 +} diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java new file mode 100644 -index 0000000000..a85466bc7e +index 000000000..a85466bc7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java @@ -0,0 +0,0 @@ @@ -177,7 +177,7 @@ index 0000000000..a85466bc7e + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5517c5fe81..476a729ddf 100644 +index 27d0d818b..359ce72fc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ @@ -188,17 +188,17 @@ index 5517c5fe81..476a729ddf 100644 import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -@@ -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.getMaxPlayers(), this.getPlayerCount())); +@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) { + this.Z = i; + this.serverPing.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); + int j = MathHelper.nextInt(this.q, 0, this.getPlayerCount() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java -index c9edd289ac..8aa121e2f7 100644 +index b247a18b9..ba1c76c1a 100644 --- a/src/main/java/net/minecraft/server/PacketStatusListener.java +++ b/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -0,0 +0,0 @@ public class PacketStatusListener implements PacketStatusInListener { @@ -221,7 +221,7 @@ index c9edd289ac..8aa121e2f7 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index aa125a52dc..ea52e89bd9 100644 +index aa125a52d..ea52e89bd 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 { @@ -246,7 +246,7 @@ index aa125a52dc..ea52e89bd9 100644 this.c = agameprofile; } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 56f135f244..9c442dee24 100644 +index 0d827815c..062a24c3c 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -0,0 +0,0 @@ public class SpigotConfig @@ -254,7 +254,7 @@ index 56f135f244..9c442dee24 100644 private static void playerSample() { - playerSample = getInt( "settings.sample-count", 12 ); -+ playerSample = Math.max(getInt( "settings.sample-count", 12 ), 0); // Paper - Avoid negative counts ++ playerSample = Math.max( getInt( "settings.sample-count", 12 ), 0 ); // Paper - Avoid negative counts Bukkit.getLogger().log( Level.INFO, "Server Ping Player Sample Count: {0}", playerSample ); // Paper - Use logger } diff --git a/Spigot-Server-Patches/Improved-Async-Task-Scheduler.patch b/Spigot-Server-Patches/Improved-Async-Task-Scheduler.patch index 0bfea3c61..98432d2a6 100644 --- a/Spigot-Server-Patches/Improved-Async-Task-Scheduler.patch +++ b/Spigot-Server-Patches/Improved-Async-Task-Scheduler.patch @@ -32,7 +32,7 @@ operations are decoupled from the sync tasks queue. diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java new file mode 100644 -index 0000000000..3c1992e212 +index 000000000..3c1992e21 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftAsyncScheduler.java @@ -0,0 +0,0 @@ @@ -159,17 +159,9 @@ index 0000000000..3c1992e212 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 3ef79e3e94..3acfc07666 100644 +index 36eecb670..15f165d9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -@@ -0,0 +0,0 @@ import java.util.function.Consumer; - import java.util.logging.Level; - - import co.aikar.timings.MinecraftTimings; // Paper --import com.destroystokyo.paper.ServerSchedulerReportingWrapper; - import com.destroystokyo.paper.event.server.ServerExceptionEvent; - import com.destroystokyo.paper.exception.ServerSchedulerException; - import org.apache.commons.lang.Validate; @@ -0,0 +0,0 @@ public class CraftScheduler implements BukkitScheduler { /** * Main thread logic only 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 986784e8e..7b44169ce 100644 --- a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch @@ -28,12 +28,12 @@ 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 204aa82298..2a99f34df6 100644 +index c8c5df7f9..9bc1cce3f 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - private static final Logger a = LogManager.getLogger(); + private static final Logger LOGGER = LogManager.getLogger(); private final ServerConnection b; + private ByteBuf buf; // Paper diff --git a/Spigot-Server-Patches/Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/Make-player-data-saving-configurable.patch index 2e6ecf37f..6bd195b1a 100644 --- a/Spigot-Server-Patches/Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/Make-player-data-saving-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make player data saving configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 2b5dde6d99..b85cd10437 100644 +index a9cf1b8e8..7fba61a6d 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 { @@ -23,15 +23,15 @@ index 2b5dde6d99..b85cd10437 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index c4173c0aad..d5e21cc33c 100644 +index a0254d8e5..e60e10c57 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 { - } +@@ -0,0 +0,0 @@ public class WorldNBTStorage implements IPlayerFileData { + @Override public void save(EntityHuman entityhuman) { + if(!com.destroystokyo.paper.PaperConfig.savePlayerData) return; // Paper - Make player data saving configurable try { NBTTagCompound nbttagcompound = entityhuman.save(new NBTTagCompound()); - File file = new File(this.playerDir, entityhuman.bu() + ".dat.tmp"); + File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat.tmp"); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index 052c5f27f..fa3162674 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -6,32 +6,32 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 1640098c35..7f29d12771 100644 +index 58e2601ef..1df83d13a 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 { - protected int bZ; - protected float ca = 0.02F; - private int g; -- private final GameProfile h; -+ private GameProfile h; public void setProfile(GameProfile profile) { this.h = profile; } // Paper - OBFHELPER - private ItemStack cd; - private final ItemCooldown ce; + protected int bR; + protected final float bS = 0.02F; + private int bU; +- private final GameProfile bV; ++ private GameProfile bV; public final void setProfile(final GameProfile profile) { this.bV = profile; } // Paper - OBFHELPER + private ItemStack bX; + private final ItemCooldown bY; @Nullable diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index da5a7b3e92..c5801122dd 100644 +index 7c3b9c0b9..d4d752ddb 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 { +@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { public final NetworkManager networkManager; private LoginListener.EnumProtocolState g; private int h; - private GameProfile i; -+ private GameProfile i; private void setGameProfile(GameProfile profile) { i = profile; } private GameProfile getGameProfile() { return i; } // Paper - OBFHELPER ++ private GameProfile i; private void setGameProfile(final GameProfile profile) { this.i = profile; } private GameProfile getGameProfile() { return this.i; } // Paper - OBFHELPER private final String j; private SecretKey loginKey; private EntityPlayer l; -@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { +@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener { final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server; // Paper start @@ -48,7 +48,7 @@ index da5a7b3e92..c5801122dd 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 e6dadde80f..66873e98fe 100644 +index bea3ddf31..1aff6cab9 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 @@ @@ -64,29 +64,28 @@ index e6dadde80f..66873e98fe 100644 hiddenPlayers.put(player.getUniqueId(), hidingPlugins); // Remove this player from the hidden player's EntityTrackerEntry -- EntityTracker tracker = ((WorldServer) entity.world).tracker; - EntityPlayer other = ((CraftPlayer) player).getHandle(); +- PlayerChunkMap tracker = ((WorldServer) entity.world).getChunkProvider().playerChunkMap; + // Paper start + EntityPlayer other = ((CraftPlayer) player).getHandle(); + unregisterPlayer(other); + } + private void unregisterPlayer(EntityPlayer other) { -+ EntityTracker tracker = ((WorldServer) entity.world).tracker; ++ PlayerChunkMap tracker = ((WorldServer) entity.world).getChunkProvider().playerChunkMap; + // Paper end -+ - EntityTrackerEntry entry = tracker.trackedEntities.get(other.getId()); + PlayerChunkMap.EntityTracker entry = tracker.trackedEntities.get(other.getId()); if (entry != null) { entry.clear(getHandle()); @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } hiddenPlayers.remove(player.getUniqueId()); -- EntityTracker tracker = ((WorldServer) entity.world).tracker; +- PlayerChunkMap tracker = ((WorldServer) entity.world).getChunkProvider().playerChunkMap; + // Paper start EntityPlayer other = ((CraftPlayer) player).getHandle(); + registerPlayer(other); + } + private void registerPlayer(EntityPlayer other) { -+ EntityTracker tracker = ((WorldServer) entity.world).tracker; ++ PlayerChunkMap tracker = ((WorldServer) entity.world).getChunkProvider().playerChunkMap; + // Paper end getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other)); @@ -124,7 +123,7 @@ index e6dadde80f..66873e98fe 100644 + reregisterPlayer(handle); + + //Respawn the player then update their position and selected slot -+ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(handle.dimension, handle.world.getDifficulty(), handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode())); ++ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(handle.dimension, handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode())); + handle.updateAbilities(); + connection.sendPacket(new net.minecraft.server.PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0)); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().updateClient(handle); diff --git a/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch b/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch index 061ef1ee7..b3f46a55f 100644 --- a/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index 519bccdad0..c7ad71c5f3 100644 +index 71158ea8b..ddee2c030 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java @@ -0,0 +0,0 @@ public class AdvancementDataPlayer { diff --git a/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch index 128d1b2a3..c2c0627c0 100644 --- a/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch @@ -8,24 +8,27 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index b57616960e..e626165520 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 { - byte b0 = worldserver.spigotConfig.mobSpawnRange; - b0 = ( b0 > entityhuman.getViewDistance() ) ? (byte) entityhuman.getViewDistance() : b0; // Paper - Use player view distance API - b0 = ( b0 > 8 ) ? 8 : b0; -+ // Paper start -+ com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event; -+ event = new com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent( -+ (org.bukkit.entity.Player) entityhuman.getBukkitEntity(), b0); -+ if (!event.callEvent()) { -+ continue; -+ } -+ b0 = event.getSpawnRadius(); -+ // Paperr end +diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java +index 89a00ff8d..3fab45aa9 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 { + int chunkRange = world.spigotConfig.mobSpawnRange; + chunkRange = (chunkRange > world.spigotConfig.viewDistance) ? (byte) world.spigotConfig.viewDistance : chunkRange; + chunkRange = (chunkRange > 8) ? 8 : chunkRange; +- +- double blockRange = Math.pow(chunkRange << 4, 2); ++ final int finalChunkRange = chunkRange; // Paper for lambda below ++ //double blockRange = Math.pow(chunkRange << 4, 2); // Paper - use the range from the event + // Spigot end - for (int i1 = -b0; i1 <= b0; ++i1) { - for (k = -b0; k <= b0; ++k) { + return this.y.a(chunkcoordintpair.pair()).noneMatch((entityplayer) -> { ++ // Paper start - ++ com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event // TODO deal with int->byte on review (as well as the mess that this code is) ++ = new com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent(entityplayer.getBukkitEntity(), (byte)finalChunkRange); ++ final double blockRange = (double)((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4)); ++ // Paper end + return !entityplayer.isSpectator() && a(chunkcoordintpair, (Entity) entityplayer) < blockRange; // Spigot + }); + } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch index d7c643475..54e01956e 100644 --- a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch @@ -14,34 +14,36 @@ instead and save a lot of server resources. See: https://github.com/PaperMC/Paper/issues/917 +diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java +index 9aed0d6b8..dce9e2fc1 100644 +--- a/src/main/java/net/minecraft/server/EntityTypes.java ++++ b/src/main/java/net/minecraft/server/EntityTypes.java +@@ -0,0 +0,0 @@ public class EntityTypes { + return this.bf; + } + ++ public final MinecraftKey getKey() { return this.g(); } // Paper - OBFHELPER + public MinecraftKey g() { + if (this.bg == null) { + MinecraftKey minecraftkey = IRegistry.ENTITY_TYPE.getKey(this); diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 027ba71918..eca3f85ad2 100644 +index d8ae336e9..bca0e3a2e 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; - - import com.google.common.collect.Lists; -+ - import java.util.Iterator; - import java.util.List; - import javax.annotation.Nullable; @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { - double d3 = j >= 1 ? nbttaglist.k(0) : (double) blockposition.getX() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; - double d4 = j >= 2 ? nbttaglist.k(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1); - double d5 = j >= 3 ? nbttaglist.k(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; + double d4 = j >= 2 ? nbttaglist.h(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1); + double d5 = j >= 3 ? nbttaglist.h(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; + + // Paper start -+ if (this.getMobName() == null) { -+ return; -+ } -+ String key = this.getMobName().getKey(); ++ EntityTypes entityType = optional.get(); ++ String key = entityType.getKey().getKey(); + org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key); + if (type != null) { + com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; + event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( -+ MCUtil.toLocation(world, d3, d4, d5), -+ type, -+ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER ++ MCUtil.toLocation(world, d3, d4, d5), ++ type, ++ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER + ); + if (!event.callEvent()) { + flag = true; @@ -52,43 +54,47 @@ index 027ba71918..eca3f85ad2 100644 + } + } + // Paper end - Entity entity = ChunkRegionLoader.a(nbttagcompound, world, d3, d4, d5, false); - - if (entity == null) { ++ + if (world.c(((EntityTypes) optional.get()).a(d3, d4, d5))) { + Entity entity = EntityTypes.a(nbttagcompound, world, (entity1) -> { + entity1.setPositionRotation(d3, d4, d5, entity1.yaw, entity1.pitch); diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 2aa0db5c22..b57616960e 100644 +index 7e58e4714..e5695c760 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 { + BiomeBase.BiomeMeta biomebase_biomemeta = null; + GroupDataEntity groupdataentity = null; + int l1 = MathHelper.f(Math.random() * 4.0D); +- int i2 = 0; ++ int i2 = 0; // Paper - force diff on name change + int j2 = 0; - if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) { - EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(biomebase_biomemeta.b); -- - if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, biomebase_biomemeta.b)) { - EntityInsentient entityinsentient; + while (true) { +@@ -0,0 +0,0 @@ public final class SpawnerCreature { + if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, (IWorldReader) world, (BlockPosition) blockposition_mutableblockposition, entitytypes) && world.c(entitytypes.a((double) f, (double) k, (double) f1))) { + EntityInsentient entityinsentient; -+ // Paper start -+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; -+ EntityTypes cls = biomebase_biomemeta.b; -+ org.bukkit.entity.EntityType type = EntityTypes.clsToTypeMap.get(cls); -+ if (type != null) { -+ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( -+ MCUtil.toLocation(worldserver, blockposition_mutableblockposition), -+ type, SpawnReason.NATURAL -+ ); -+ if (!event.callEvent()) { -+ if (event.shouldAbortSpawn()) { -+ continue label137; // right above the iterator for c (Chunk Pos Set) -+ } -+ j1 += l2; -+ ++j4; -+ continue; -+ } ++ // Paper start ++ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; ++ EntityTypes cls = biomebase_biomemeta.b; ++ org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(cls.getKey().getKey()); ++ if (type != null) { ++ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( ++ MCUtil.toLocation(world, blockposition_mutableblockposition), ++ type, SpawnReason.NATURAL ++ ); ++ if (!event.callEvent()) { ++ if (event.shouldAbortSpawn()) { ++ return; + } -+ // Paper end ++ ++i2; ++ continue; ++ } ++ } ++ // Paper end + -+ - try { - entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a((World) worldserver); - } catch (Exception exception) { + try { + Entity entity = entitytypes.a(world); + -- \ No newline at end of file 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 da92f4f35..79e4d6548 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,7 +5,7 @@ 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 2c881be1ed..2c4bbc7890 100644 +index 39c3bbc9c..881dfb123 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 { @@ -16,7 +16,7 @@ index 2c881be1ed..2c4bbc7890 100644 + IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition_pooledblockposition); // Paper - don't load chunks + if (iblockdata1 == null) continue; // Paper - if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_pooledblockposition)) { + if (iblockdata1.getBlock() == this && !this.e(iblockdata1, world, blockposition_pooledblockposition)) { world.getBlockTickList().a(blockposition_pooledblockposition, 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 { EnumDirection enumdirection = aenumdirection[l]; diff --git a/Spigot-Server-Patches/Tameable-getOwnerUniqueId-API.patch b/Spigot-Server-Patches/Tameable-getOwnerUniqueId-API.patch index 8f85decc1..35e97a1e9 100644 --- a/Spigot-Server-Patches/Tameable-getOwnerUniqueId-API.patch +++ b/Spigot-Server-Patches/Tameable-getOwnerUniqueId-API.patch @@ -7,7 +7,7 @@ This is faster if all you need is the UUID, as .getOwner() will cause an OfflinePlayer to be loaded from disk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java -index e56bef3340..cc9d432e7f 100644 +index e56bef334..cc9d432e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java @@ -0,0 +0,0 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac @@ -21,7 +21,7 @@ index e56bef3340..cc9d432e7f 100644 return getHandle().getOwnerUUID(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java -index eaaebeab83..2e959321b5 100644 +index 2498fba31..0869cb091 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java @@ -0,0 +0,0 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat diff --git a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch index e7c14de8c..51433faf8 100644 --- a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 07a8ef697f..f68b8a4b05 100644 +index c3e61bdfe..32bfe0e46 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 { @@ -21,12 +21,12 @@ index 07a8ef697f..f68b8a4b05 100644 private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 259f73f66e..1640098c35 100644 +index a30d88af8..58e2601ef 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 { - boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.z_() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving; + boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.isClimbing() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving; + flag2 = flag2 && !world.paperConfig.disablePlayerCrits; // Paper flag2 = flag2 && !this.isSprinting(); diff --git a/Spigot-Server-Patches/getPlayerUniqueId-API.patch b/Spigot-Server-Patches/getPlayerUniqueId-API.patch index 21e5cf759..4899a9d05 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 8315f63775..268653acd1 100644 +index 2173f34fe..01ed56a2a 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 {