mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Add killer rabbit natural spawn chance
This commit is contained in:
@@ -183,6 +183,11 @@ mobs
|
|||||||
- **default**: false
|
- **default**: false
|
||||||
- **description**: Disables random pillager patrols (does not effect pillager outposts)
|
- **description**: Disables random pillager patrols (does not effect pillager outposts)
|
||||||
|
|
||||||
|
* rabbit
|
||||||
|
* spawn-killer-rabbit-chance
|
||||||
|
- **default**: 0.0
|
||||||
|
- **description**: Percent chance (0.0-1.0) the killer rabbit naturally spawns
|
||||||
|
|
||||||
* snow_golem
|
* snow_golem
|
||||||
* drops-pumpkin-when-sheared
|
* drops-pumpkin-when-sheared
|
||||||
- **default**: false
|
- **default**: false
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
From f722064d889392fd7040a2c420c76d1647582ae0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sat, 31 Aug 2019 17:24:41 -0500
|
||||||
|
Subject: [PATCH] Add killer rabbit natural spawn chance
|
||||||
|
|
||||||
|
---
|
||||||
|
src/main/java/net/minecraft/server/EntityRabbit.java | 2 ++
|
||||||
|
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||||
|
2 files changed, 7 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||||
|
index d48610df3..498c453d7 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||||
|
@@ -328,6 +328,8 @@ public class EntityRabbit extends EntityAnimal {
|
||||||
|
}
|
||||||
|
|
||||||
|
private int a(GeneratorAccess generatoraccess) {
|
||||||
|
+ if (net.pl3x.purpur.PurpurConfig.killerRabbitChance > 0D && net.pl3x.purpur.PurpurConfig.killerRabbitChance > random.nextDouble()) return 99; // Purpur
|
||||||
|
+
|
||||||
|
BiomeBase biomebase = generatoraccess.getBiome(new BlockPosition(this));
|
||||||
|
int i = this.random.nextInt(100);
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
index 46c31ad1c..d03b96bcc 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -247,6 +247,11 @@ public class PurpurConfig {
|
||||||
|
disablePillagerPatrols = getBoolean("settings.mobs.pillager.disable-patrols", disablePillagerPatrols);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public static double killerRabbitChance = 0.0D;
|
||||||
|
+ private static void rabbitSettings() {
|
||||||
|
+ killerRabbitChance = getDouble("settings.mobs.rabbit.spawn-killer-rabbit-chance", killerRabbitChance);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public static boolean snowmanDropsPumpkin = false;
|
||||||
|
public static boolean snowmanPumpkinPutBack = false;
|
||||||
|
private static void snowmansSettings() {
|
||||||
|
--
|
||||||
|
2.23.0.rc1
|
||||||
|
|
||||||
Reference in New Issue
Block a user