Files
Purpur/patches/server/0014-Zombie-horse-naturally-spawn.patch
William Blake Galbreath 193c511fce Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132)
c65dcad3 Don't delay chunk unloads during entity ticking
bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114
5553e6b3 Disable Sync Events firing Async errors during shutdown
e12c51d9 Use better variable for isStopping() API
586ee2bb Remove patch for MC-111480, fixed in 1.14
09a94215 Remove streams from Mob AI System
bb5c294e Fix Disabling Asynchronous Chunks
089d8356 Implement Chunk Priority / Urgency System for World Gen
fce69af7 Use dedicated thread for main thread blocking chunk loads
588b62e4 Add tick times API and /mspt command (#3102)
11de41c7 Add API MinecraftServer#isStopping (#3129)
942ff3c2 My patches are under MIT (#3130)
2020-04-12 03:45:54 -05:00

59 lines
3.4 KiB
Diff

From b91f254c61044afeb51cddd2c150b1f8b4015684 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 7 Jul 2019 19:52:16 -0500
Subject: [PATCH] Zombie horse naturally spawn
---
.../java/net/minecraft/server/WorldServer.java | 18 ++++++++++++------
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 84a3367b87..7d9e61a82d 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -586,12 +586,18 @@ public class WorldServer extends World {
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
if (flag1) {
- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
-
- entityhorseskeleton.r(true);
- entityhorseskeleton.setAgeRaw(0);
- entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
+ // Purpur start
+ EntityHorseAbstract horse;
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
+ horse = EntityTypes.ZOMBIE_HORSE.create(this);
+ } else {
+ horse = EntityTypes.SKELETON_HORSE.create(this);
+ ((EntityHorseSkeleton) horse).setTrap(true);
+ }
+ horse.setAgeRaw(0);
+ horse.setPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ addEntity(horse, CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
+ // Purpur end
}
this.strikeLightning(new EntityLightning(this, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, flag1), org.bukkit.event.weather.LightningStrikeEvent.Cause.WEATHER); // CraftBukkit
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 96a66926fc..4c7469b903 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -657,9 +657,11 @@ public class PurpurWorldConfig {
public boolean zombieHorseCanSwim = false;
public boolean zombieHorseRidableInWater = false;
+ public double zombieHorseSpawnChance = 0.0D;
private void zombieHorseSettings() {
zombieHorseCanSwim = getBoolean("mobs.zombie_horse.can-swim", zombieHorseCanSwim);
zombieHorseRidableInWater = getBoolean("mobs.zombie_horse.ridable-in-water", zombieHorseRidableInWater);
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
}
public boolean zombiePigmanRidable = false;
--
2.24.0