mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@f7124df Fix recursive chunk loading in chunk unload event PaperMC/Paper@8b558d9 Apply entity tracker desync patch PaperMC/Paper@a594d18 Fix entities not being visible to clients when teleporting PaperMC/Paper@f250ec0 Increment ChunkHolderManager current tick PaperMC/Paper@7bd22b1 Optimise entity tracker PaperMC/Paper@90ae1dc Port collision optimisation patch from Moonrise PaperMC/Paper@821081d Drop unapplied patches PaperMC/Paper@1d0fcb5 Port lag compensation patch PaperMC/Paper@0e02aa5 Port watchdog detail patch PaperMC/Paper@c6e9579 Fix explosions calculation getting stuck (#11061) PaperMC/Paper@2773dc4 Add light block to indestructible block list PaperMC/Paper@70ff1ec Only skip damage tick if damage is unmodified zero (#11058)
52 lines
3.8 KiB
Diff
52 lines
3.8 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 1d349c11a98977c84808c60124e58dfe5ea233e6..73e1f32dd8fa03c715b650eaffc971806fc9a119 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -848,10 +848,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
|
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper - Configurable spawn chances for skeleton horses
|
|
|
|
if (flag1) {
|
|
- SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this);
|
|
+ // Purpur start
|
|
+ net.minecraft.world.entity.animal.horse.AbstractHorse entityhorseskeleton;
|
|
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
|
+ entityhorseskeleton = EntityType.ZOMBIE_HORSE.create(this);
|
|
+ } else {
|
|
+ entityhorseskeleton = EntityType.SKELETON_HORSE.create(this);
|
|
+ if (entityhorseskeleton != null) ((SkeletonHorse) entityhorseskeleton).setTrap(true);
|
|
+ }
|
|
+ // Purpur end
|
|
|
|
if (entityhorseskeleton != null) {
|
|
- entityhorseskeleton.setTrap(true);
|
|
+ //entityhorseskeleton.setTrap(true); // Purpur - moved up
|
|
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 22248cd0752812739df8e7ab911ef04b3d2ed458..3b6089eaf8a9af932c7bcc9a37fc7c077eb79870 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1644,6 +1644,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() {
|
|
zombieHorseRidable = getBoolean("mobs.zombie_horse.ridable", zombieHorseRidable);
|
|
zombieHorseRidableInWater = getBoolean("mobs.zombie_horse.ridable-in-water", zombieHorseRidableInWater);
|
|
@@ -1660,6 +1661,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;
|