mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
25f3b50f6b
By: md_5 <git@md-5.net>
29 lines
2.3 KiB
Diff
29 lines
2.3 KiB
Diff
--- a/net/minecraft/world/entity/npc/MobSpawnerTrader.java
|
|
+++ b/net/minecraft/world/entity/npc/MobSpawnerTrader.java
|
|
@@ -113,7 +113,7 @@
|
|
return false;
|
|
}
|
|
|
|
- EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawn(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition2, EnumMobSpawn.EVENT, false, false);
|
|
+ EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawn(worldserver, (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) {
|
|
@@ -121,7 +121,7 @@
|
|
}
|
|
|
|
this.serverLevelData.setWanderingTraderId(entityvillagertrader.getUUID());
|
|
- entityvillagertrader.setDespawnDelay(48000);
|
|
+ // entityvillagertrader.setDespawnDelay(48000); // CraftBukkit - moved to EntityVillagerTrader constructor. This lets the value be modified by plugins on CreatureSpawnEvent
|
|
entityvillagertrader.setWanderTarget(blockposition1);
|
|
entityvillagertrader.restrictTo(blockposition1, 16);
|
|
return true;
|
|
@@ -136,7 +136,7 @@
|
|
BlockPosition blockposition = this.findSpawnPositionNear(worldserver, entityvillagertrader.blockPosition(), i);
|
|
|
|
if (blockposition != null) {
|
|
- EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawn(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false);
|
|
+ EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawn(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
|
|
|
|
if (entityllamatrader != null) {
|
|
entityllamatrader.setLeashedTo(entityvillagertrader, true);
|