2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/entity/npc/MobSpawnerTrader.java
+++ b/net/minecraft/world/entity/npc/MobSpawnerTrader.java
2022-12-07 17:00:00 +01:00
@@ -110,7 +110,7 @@
2019-12-04 06:58:22 +01:00
return false;
}
2022-12-07 17:00:00 +01:00
- EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawn(worldserver, blockposition2, EnumMobSpawn.EVENT);
+ EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawn(worldserver, blockposition2, EnumMobSpawn.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
2019-12-04 06:58:22 +01:00
if (entityvillagertrader != null) {
for (int i = 0; i < 2; ++i) {
2022-12-07 17:00:00 +01:00
@@ -118,7 +118,7 @@
2021-02-15 09:30:15 +01:00
}
2021-11-21 23:00:00 +01:00
this.serverLevelData.setWanderingTraderId(entityvillagertrader.getUUID());
2021-03-15 23:00:00 +01:00
- entityvillagertrader.setDespawnDelay(48000);
2021-03-19 22:55:48 +01:00
+ // entityvillagertrader.setDespawnDelay(48000); // CraftBukkit - moved to EntityVillagerTrader constructor. This lets the value be modified by plugins on CreatureSpawnEvent
2021-11-21 23:00:00 +01:00
entityvillagertrader.setWanderTarget(blockposition1);
entityvillagertrader.restrictTo(blockposition1, 16);
2021-02-15 09:30:15 +01:00
return true;
2022-12-07 17:00:00 +01:00
@@ -133,7 +133,7 @@
2021-11-21 23:00:00 +01:00
BlockPosition blockposition = this.findSpawnPositionNear(worldserver, entityvillagertrader.blockPosition(), i);
2019-12-04 06:58:22 +01:00
if (blockposition != null) {
2022-12-07 17:00:00 +01:00
- EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawn(worldserver, blockposition, EnumMobSpawn.EVENT);
+ EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawn(worldserver, blockposition, EnumMobSpawn.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
2019-12-04 06:58:22 +01:00
if (entityllamatrader != null) {
2021-11-21 23:00:00 +01:00
entityllamatrader.setLeashedTo(entityvillagertrader, true);