aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason <[email protected]>2023-07-14 16:23:33 -0700
committerGitHub <[email protected]>2023-07-14 16:23:33 -0700
commitfe780d041ea2542c5e2c7ccbdfe7be38a84a85c7 (patch)
treebd2ba31784206a7137fa6bfccb15e0e2aa2159dc
parentde3f149185a3b654eaf9af1144f4c85b8ef2f9bc (diff)
downloadPaper-fe780d041ea2542c5e2c7ccbdfe7be38a84a85c7.tar.gz
Paper-fe780d041ea2542c5e2c7ccbdfe7be38a84a85c7.zip
Add back accidentally dropped Wandering Trader patch (#9492)
-rw-r--r--patches/server/0988-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/server/0988-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/0988-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
new file mode 100644
index 0000000000..ef39fd0130
--- /dev/null
+++ b/patches/server/0988-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <[email protected]>
+Date: Fri, 19 Mar 2021 16:07:21 -0700
+Subject: [PATCH] Only set despawnTimer for Wandering Traders spawned by
+ WanderingTraderSpawner
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+index 2e7de2378e01aed514e237029d6d64e78871c9b4..0002f3a2f2e096d4b2015baf707707f6cc1a9582 100644
+--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
++++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+@@ -63,7 +63,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
+
+ public WanderingTrader(EntityType<? extends WanderingTrader> type, Level world) {
+ super(type, world);
+- this.setDespawnDelay(48000); // CraftBukkit - set default from MobSpawnerTrader
++ //this.setDespawnDelay(48000); // CraftBukkit - set default from MobSpawnerTrader // Paper - move back to MobSpawnerTrader - Vanilla behavior is that only traders spawned by it have this value set.
+ }
+
+ @Override
+diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+index 5d199fe497bd852827d3d18fb7566a09e70331a3..8385eb1d60f377da94e3178ab506feefb43563fd 100644
+--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
++++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+@@ -120,7 +120,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
+ return false;
+ }
+
+- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, MobSpawnType.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
++ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, null, trader -> trader.setDespawnDelay(48000), blockposition2, MobSpawnType.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit // Paper - set despawnTimer before spawn events called
+
+ if (entityvillagertrader != null) {
+ for (int i = 0; i < 2; ++i) {