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

Paper Changes:
d4532f7e7 bug #5373 - fix AsyncChatEvent not being posted when processing a legacy APCE continuation
522ae1c51 Replace all block states of a specified block (#5055)
1cda67118 [Auto] Updated Upstream (CraftBukkit)

Tuinity Changes:
44e8e5de5 Do not load extra radius of chunks when loading a single chunk
31f9cae05 Revert custom table implementation for blockstate states
9ac33d168 Be aware of entity teleports when chunk checking entities
18c7f3f59 Always set impluse for projectiles to true, even if hit failed

Airplane Changes:
0f8044393 Update Upstream (Tuinity)
2f6cbdc74 More debug for plugins not shutting down tasks
12e1b6169 Update Upstream (Tuinity)
fc778d30b Update README.md
b23bee302 Remove debug
8157e9838 Config style, flare style, disable tracker by def
98d0b589b Updates to README
2021-03-17 13:46:10 -05: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 2d72803f1c52acf8bc069777351a3ef4d75f6e6c..1421c3036c9a374f65f30ebfb2ccc015560ee04c 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1128,12 +1128,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);
+ }
}