aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0891-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
diff options
context:
space:
mode:
authormaxcom1 <[email protected]>2024-03-23 22:26:17 +0100
committerGitHub <[email protected]>2024-03-23 17:26:17 -0400
commitb6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch)
treea8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0891-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
parent9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff)
downloadPaper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz
Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0891-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch')
-rw-r--r--patches/server/0891-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/server/0891-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/0891-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
new file mode 100644
index 0000000000..54c442e544
--- /dev/null
+++ b/patches/server/0891-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 9b0f54af3160c5756784e31cf1347eb97ca77e47..8d1cc1a644415be251f469ab1cb2ebc09fe5c3eb 100644
+--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
++++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+@@ -68,7 +68,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 a089f72695b5fb49c7918e89fd5015e8c3a3dd0e..d7bddedb19c10f62fd1f7d3128453ad706ed16be 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) {