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: 55e2de5c6 Improve per player mob spawning (#3971) 42433c262 Updated Upstream (Bukkit/CraftBukkit) (#3980) e5ede546a Fix IDE Debug JVM Flag for 1.16 (#3983) 2712c6888 [Auto] Updated Upstream (Bukkit/CraftBukkit) 0901ffd04 Use title packet for actionbar methods (#3959) 2e11235d1 Expand MaterialTags (#3964) cc25ae47c Amend last commit to fix decompile error forgot to commit f503db37c Fix AdvancementDataPlayer leak due from quitting early in login 282763b88 Fix SPIGOT-5885 Unable to disable advancements 9b93d122e Fix SPIGOT-5824 Bukkit world-container is not used bede4d304 Load config files early on Tuinity Changes: b0673b3 Merge dev/optimise-notify into ver/1.16 d3dc35c Name craft scheduler threads according to the plugin using them
50 lines
2.9 KiB
Diff
50 lines
2.9 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 a1870fbd6..596ef231c 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -1070,12 +1070,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 70f8feffb..d0fd8f9cd 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -138,4 +138,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);
|
|
+ }
|
|
}
|