mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b0b54e4e Optimize Villager Pathfinding - Massive Villager Improvement 33a2134b Workaround for really evil plugins breaking sounds b88ee11f Don't unregister the primary dimensions on world unload 21f9efa2 Improve implementation of chunk leak clean to not run as often 7ee71146 Add missing null check for structure start chunk access b12177fb One more to seal the deal to improve unloading inactive chunks 78ee3b4e Restore a condition I accidently removed in last build 88a68829 Fix unloading inaccessible chunks too fast regressing gen speed 210a32f2 Unload leaked Cached Chunks c9795e92 Fix Spigot bug with chunk unloading
59 lines
3.4 KiB
Diff
59 lines
3.4 KiB
Diff
From 84c4a40a15f523104c986a0a12140d94c537a8eb 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 854c97bddb..b65df63333 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -600,12 +600,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
|
|
|