mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 02:47:43 +01:00
add prefixes and descriptions
This commit is contained in:
60
patches/server/0031-FEAT-Zombie-horse-naturally-spawn.patch
Normal file
60
patches/server/0031-FEAT-Zombie-horse-naturally-spawn.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
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] |FEAT| Zombie horse naturally spawn
|
||||
|
||||
Adds the ability to control natural zombie horse spawns during thunderstorms. These zombie horse
|
||||
spawns will replace the natural skeleton horse spawns at the configured percent value (0.0 - 1.0)
|
||||
|
||||
$-----------------------------$
|
||||
mobs:
|
||||
zombie_horse:
|
||||
spawn-chance:
|
||||
default: 0.0
|
||||
description: |-
|
||||
Percent chance (0.0 - 1.0) a zombie horse will spawn instead of a skeleton horse during thunderstorms
|
||||
$-----------------------------$
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 93d7860c229f78a214b1e89c7b401eac986ddabb..32c725eb4819b28279f7cc4db30b5f711967a799 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -866,9 +866,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
|
||||
|
||||
if (flag1) {
|
||||
- SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create((Level) 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.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 01c33f5021905736b05fc33c268e42e4e82c2863..9db45abd1963ae7f48fe06f29fc4e3bf9e2cd983 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1266,6 +1266,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);
|
||||
@@ -1281,6 +1282,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;
|
||||
Reference in New Issue
Block a user