PaperMC/paper-server/nms-patches/net/minecraft/world/entity/npc/MobSpawnerTrader.patch

30 lines
2.2 KiB
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/entity/npc/MobSpawnerTrader.java
+++ b/net/minecraft/world/entity/npc/MobSpawnerTrader.java
@@ -104,7 +104,7 @@
return false;
}
- EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition2, EnumMobSpawn.EVENT, false, false);
+ EntityVillagerTrader entityvillagertrader = (EntityVillagerTrader) EntityTypes.WANDERING_TRADER.spawnCreature(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) {
2021-03-15 23:00:00 +01:00
@@ -112,7 +112,7 @@
}
this.b.a(entityvillagertrader.getUniqueID());
2021-03-15 23:00:00 +01:00
- entityvillagertrader.setDespawnDelay(48000);
+ // entityvillagertrader.u(48000); // CraftBukkit - moved to EntityVillagerTrader constructor. This lets the value be modified by plugins on CreatureSpawnEvent
entityvillagertrader.g(blockposition1);
entityvillagertrader.a(blockposition1, 16);
return true;
2021-03-15 23:00:00 +01:00
@@ -127,7 +127,7 @@
BlockPosition blockposition = this.a((IWorldReader) worldserver, entityvillagertrader.getChunkCoordinates(), i);
if (blockposition != null) {
- EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false);
+ EntityLlamaTrader entityllamatrader = (EntityLlamaTrader) EntityTypes.TRADER_LLAMA.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition, EnumMobSpawn.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
if (entityllamatrader != null) {
entityllamatrader.setLeashHolder(entityvillagertrader, true);