From 5aa1f5b5e8d9a0ce2385780f6ef852a8e01fcc69 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 4 Dec 2019 06:58:22 +0100 Subject: [PATCH] SPIGOT-5412: Use SpawnReason.NATURAL for wandering traders and trader llamas By: Brokkonaut --- .../nms-patches/MobSpawnerTrader.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 paper-server/nms-patches/MobSpawnerTrader.patch diff --git a/paper-server/nms-patches/MobSpawnerTrader.patch b/paper-server/nms-patches/MobSpawnerTrader.patch new file mode 100644 index 0000000000..1cd3336232 --- /dev/null +++ b/paper-server/nms-patches/MobSpawnerTrader.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/server/MobSpawnerTrader.java ++++ b/net/minecraft/server/MobSpawnerTrader.java +@@ -75,7 +75,7 @@ + return false; + } + +- EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawnCreature(this.b, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition2, EnumMobSpawn.EVENT, false, false); ++ EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawnCreature(this.b, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition2, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit + + if (entityvillagertrader != null) { + for (int i = 0; i < 2; ++i) { +@@ -98,7 +98,7 @@ + BlockPosition blockposition = this.a(new BlockPosition(entityvillagertrader), i); + + if (blockposition != null) { +- EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawnCreature(this.b, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false); ++ EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawnCreature(this.b, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit + + if (entityllamatrader != null) { + entityllamatrader.setLeashHolder(entityvillagertrader, true);