diff options
author | MiniDigger | Martin <[email protected]> | 2024-01-14 11:04:49 +0100 |
---|---|---|
committer | MiniDigger | Martin <[email protected]> | 2024-01-14 11:04:49 +0100 |
commit | bee74680e607c2e29b038329f62181238911cd83 (patch) | |
tree | 708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/npc/WanderingTraderSpawner.java.patch | |
parent | 0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff) | |
download | Paper-softspoon.tar.gz Paper-softspoon.zip |
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/npc/WanderingTraderSpawner.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/npc/WanderingTraderSpawner.java.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/npc/WanderingTraderSpawner.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/npc/WanderingTraderSpawner.java.patch new file mode 100644 index 0000000000..7be38ff45b --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/npc/WanderingTraderSpawner.java.patch @@ -0,0 +1,47 @@ +--- a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java ++++ b/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +@@ -101,16 +110,17 @@ + return false; + } + +- WanderingTrader wanderingTrader = EntityType.WANDERING_TRADER.spawn(serverLevel, blockPos2, MobSpawnType.EVENT); +- if (wanderingTrader != null) { +- for (int i1 = 0; i1 < 2; i1++) { +- this.tryToSpawnLlamaFor(serverLevel, wanderingTrader, 4); ++ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(serverLevel, blockposition2, EnumMobSpawn.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit ++ ++ if (entityvillagertrader != null) { ++ for (int i = 0; i < 2; ++i) { ++ this.tryToSpawnLlamaFor(serverLevel, entityvillagertrader, 4); + } + +- this.serverLevelData.setWanderingTraderId(wanderingTrader.getUUID()); +- wanderingTrader.setDespawnDelay(48000); +- wanderingTrader.setWanderTarget(blockPos1); +- wanderingTrader.restrictTo(blockPos1, 16); ++ this.serverLevelData.setWanderingTraderId(entityvillagertrader.getUUID()); ++ // 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; + } + } +@@ -120,11 +130,13 @@ + } + + private void tryToSpawnLlamaFor(ServerLevel serverLevel, WanderingTrader trader, int maxDistance) { +- BlockPos blockPos = this.findSpawnPositionNear(serverLevel, trader.blockPosition(), maxDistance); +- if (blockPos != null) { +- TraderLlama traderLlama = EntityType.TRADER_LLAMA.spawn(serverLevel, blockPos, MobSpawnType.EVENT); +- if (traderLlama != null) { +- traderLlama.setLeashedTo(trader, true); ++ BlockPos blockposition = this.findSpawnPositionNear(serverLevel, trader.blockPosition(), maxDistance); ++ ++ if (blockposition != null) { ++ TraderLlama entityllamatrader = (TraderLlama) EntityType.TRADER_LLAMA.spawn(serverLevel, blockposition, EnumMobSpawn.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit ++ ++ if (entityllamatrader != null) { ++ entityllamatrader.setLeashedTo(trader, true); + } + } + } |