mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 05:11:27 +01:00
Only set despawnTimer for Wandering Traders spawned by WanderingTraderSpawner
This commit is contained in:
parent
90366d505a
commit
4ced264ab6
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
public WanderingTrader(EntityType<? extends WanderingTrader> type, Level world) {
|
public WanderingTrader(EntityType<? extends WanderingTrader> type, Level world) {
|
||||||
super(type, 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
|
@Override
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, EntitySpawnReason.EVENT);
|
- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, EntitySpawnReason.EVENT);
|
||||||
+ 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) {
|
if (entityvillagertrader != null) {
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user