Files
Purpur/patches/server/0028-Zombie-horse-naturally-spawn.patch
BillyGalbreath e581a731bf Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
0514fc4e2 Add missing effects
8f5d9effd Add getMainThreadExecutor to BukkitScheduler
313b5020b Allow adding items to BlockDropItemEvent (#5093)
9a556d9da [CI-SKIP] [Auto] Rebuild Patches
72b2768ad Inline shift fields in EnumDirection (#5082)
ffff53fa7 added option to disable pathfinding updates on block changes (#5123)
b67081fd7 add DragonEggFormEvent (fixes #5110) (#5112)
3eefafbaf Fix javadoc build
0081ed1c4 Add javadoc step to GH Actions
01082503e Add dropLeash variable to EntityUnleashEvent (#5130)
31f9f869a [CI-SKIP] Fix YourKit links in readme, fixes #5091
8ac27aa38 [Auto] Updated Upstream (CraftBukkit)
c4d9cc831 [Auto] Updated Upstream (Bukkit/CraftBukkit)
d0477d326 [Auto] Updated Upstream (CraftBukkit)
d9f5f7018 EntityMoveEvent (#4614)
2021-01-30 20:41:46 -06:00

50 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index e99c3ad507f1381c9aa495052d2014ba8b7e0750..49ae8bd50810473d121e786a06a813b777909904 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -996,12 +996,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
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.t(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
}
EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this);
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 5c716a6b4f9ff33912ebb274b36eef70679ea87b..04dfb820053925c2835bdcec702d5a467a9fe48e 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -155,4 +155,9 @@ public class PurpurWorldConfig {
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
}
+
+ public double zombieHorseSpawnChance = 0.0D;
+ private void zombieHorseSettings() {
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
+ }
}