mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: fb36f15d6 Let some more packets be send immediately, closes #4140 (#4896) ede41fe16 Emancipate more features to PlayerHandshakeEvent 3fdeba1f5 [CI-SKIP] [Auto] Rebuild Patches 5fc07bd63 Maded Title-Objects directy sendable to targets e7b9a478e Player Chunk Load/Unload Events 1d0cfc0cc MC-4 Fix item position desync 458db6206 Limit auto recipe packets
50 lines
3.1 KiB
Diff
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 b8e788eb66575051073ec2230e8b71dbd59d5b71..9469d6052ad920f9fd9848e7ee55e488372e5e62 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -1049,12 +1049,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);
|
|
+ }
|
|
}
|