mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@55a16d8 Fix Varint21FrameDecoder cached length buf usage PaperMC/Paper@e6e37ba Add api to resolve components (#7648) PaperMC/Paper@7168438 [ci skip] Rework workflows to support optional paperclip build (#8583) PaperMC/Paper@da230d5 More vanilla friendly methods to update trades (#8478) PaperMC/Paper@8aff07a Add /paper dumplisteners command (#8507) PaperMC/Paper@b8919a7 pr command action fixes (#8591) PaperMC/Paper@185fa48 Fix chest relooting mechanics (#8580) PaperMC/Paper@b4beac0 Fixes potential issues arising from optimizing getPlayerByUUID (#8585) PaperMC/Paper@f637b1a Fix async entity add due to fungus trees (#7626) PaperMC/Paper@414ea80 ItemStack damage API (#7801) PaperMC/Paper@d98c370 Add displayName methods for advancements (#8584) PaperMC/Paper@44bb599 Add Tick TemporalUnit (#5445) PaperMC/Paper@9f7eef8 Friction API (#6611) PaperMC/Paper@4048d3e Allow using degrees for ArmorStand rotations (#7847) PaperMC/Paper@f59c802 Schoolable Fish API (#7089) PaperMC/Paper@21b964a Added ability to control player's insomnia and phantoms spawning (#6500) PaperMC/Paper@f1583fc Add `/paper dumplisteners tofile` and increase detail of command output (#8592)
50 lines
3.6 KiB
Diff
50 lines
3.6 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 503bf34f3c9256ed6f0f31f5396d0baeb9ffea59..125faced389b5f467d96dab4e2ac4ffe85c82f50 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -832,9 +832,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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
|
|
|
|
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 ebea7fe95f5722eb526aa94787e899f9bbfe6e72..c48312f89859787cdecf667becee866a10c88e3b 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -1458,6 +1458,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);
|
|
@@ -1473,6 +1474,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;
|