aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0824-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-05 11:18:29 +0100
committerNassim Jahnke <[email protected]>2024-12-05 12:20:56 +0100
commite4e24f3335609b38f460ced71d18babcf11bf9cb (patch)
tree51880d664b3444ce26d6f8cdeb3b8219e5616fca /patches/server/0824-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
parentc54c062e6ff742445bf7749c84106ca67090172d (diff)
downloadPaper-e4e24f3335609b38f460ced71d18babcf11bf9cb.tar.gz
Paper-e4e24f3335609b38f460ced71d18babcf11bf9cb.zip
Move around patches again
Diffstat (limited to 'patches/server/0824-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch')
-rw-r--r--patches/server/0824-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/server/0824-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/0824-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
new file mode 100644
index 0000000000..c481798890
--- /dev/null
+++ b/patches/server/0824-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 a65fba5621c067c453858efb7fee64cbee1e7916..1e77cce428d9e53142aaa2cf780b7f862d536eca 100644
+--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
++++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+@@ -69,7 +69,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 08a3c7140867f339dd99a95094ed0fd8ff344fca..a728dcbf956f108f01c966c7531449a506a14a87 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, EntitySpawnReason.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
++ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, trader -> trader.setDespawnDelay(48000), blockposition2, EntitySpawnReason.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) {