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

Paper Changes:
PaperMC/Paper@f6a69de Undeprecate getOfflinePlayer (#7773)
PaperMC/Paper@a117da6 Add PlayerStopUsingItemEvent (#7787)
PaperMC/Paper@f3a8a0b FallingBlock auto expire setting (#7037)
PaperMC/Paper@4219389 Don't tick markers (#7299)
PaperMC/Paper@2515bc4 Improve configurable door difficulty (#6985)
PaperMC/Paper@8c9d98e Clean unused field for Configurable door breaking difficulty (#7793)
PaperMC/Paper@b831784 Only log for passenger / vehicle world mismatch
PaperMC/Paper@7a6163b Add Alternate Current's redstone implementation as an alternative to Vanilla and Eigencraft's. (#7701)
PaperMC/Paper@1a17a83 Move redstone config changes to Eigencraft patch
2022-05-07 14:07:40 -04:00

50 lines
3.5 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/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8066a3372d21823357942771adc0b4768f505ea2..ac233f1f6a645a927631efdda15aee91040705d8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -772,9 +772,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
if (flag1) {
- SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this);
-
- entityhorseskeleton.setTrap(true);
+ // Purpur start
+ net.minecraft.world.entity.animal.horse.AbstractHorse entityhorseskeleton = EntityType.SKELETON_HORSE.create(this);
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
+ entityhorseskeleton = EntityType.ZOMBIE_HORSE.create(this);
+ } else {
+ entityhorseskeleton = EntityType.SKELETON_HORSE.create(this);
+ ((SkeletonHorse) entityhorseskeleton).setTrap(true);
+ }
+ // Purpur end
entityhorseskeleton.setAge(0);
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 336b214230600b8b1d223c65470820e388f676d9..6a5507be0f9a78855225437676865e15f06bcd9a 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1416,6 +1416,7 @@ public class PurpurWorldConfig {
public double zombieHorseJumpStrengthMax = 1.0D;
public double zombieHorseMovementSpeedMin = 0.2D;
public double zombieHorseMovementSpeedMax = 0.2D;
+ public double zombieHorseSpawnChance = 0.0D;
private void zombieHorseSettings() {
zombieHorseRidableInWater = getBoolean("mobs.zombie_horse.ridable-in-water", zombieHorseRidableInWater);
zombieHorseCanSwim = getBoolean("mobs.zombie_horse.can-swim", zombieHorseCanSwim);
@@ -1431,6 +1432,7 @@ public class PurpurWorldConfig {
zombieHorseJumpStrengthMax = getDouble("mobs.zombie_horse.attributes.jump_strength.max", zombieHorseJumpStrengthMax);
zombieHorseMovementSpeedMin = getDouble("mobs.zombie_horse.attributes.movement_speed.min", zombieHorseMovementSpeedMin);
zombieHorseMovementSpeedMax = getDouble("mobs.zombie_horse.attributes.movement_speed.max", zombieHorseMovementSpeedMax);
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
}
public boolean zombieVillagerRidable = false;