mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
65 lines
2.9 KiB
Diff
65 lines
2.9 KiB
Diff
From 7a740eac98a1acd7253c498e690324cd18e42d47 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sat, 31 Aug 2019 17:47:11 -0500
|
|
Subject: [PATCH] Rabbit naturally spawn toast and killer
|
|
|
|
---
|
|
.../java/net/minecraft/server/EntityRabbit.java | 14 ++++++++++++++
|
|
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
|
2 files changed, 18 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
index 9040ab1c54..0232226f06 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
@@ -364,6 +364,10 @@ public class EntityRabbit extends EntityAnimal {
|
|
if (!this.hasCustomName()) {
|
|
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bx), new Object[0]));
|
|
}
|
|
+ // Purpur start
|
|
+ } else if (i == 98) {
|
|
+ setCustomName(new ChatMessage("Toast"));
|
|
+ // Purpur end
|
|
}
|
|
|
|
this.datawatcher.set(EntityRabbit.bw, i);
|
|
@@ -385,6 +389,16 @@ public class EntityRabbit extends EntityAnimal {
|
|
}
|
|
|
|
private int a(GeneratorAccess generatoraccess) {
|
|
+ // Purpur start
|
|
+ World world = generatoraccess.getMinecraftWorld();
|
|
+ if (world.purpurConfig.rabbitNaturalKiller > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalKiller) {
|
|
+ return 99;
|
|
+ }
|
|
+ if (world.purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalToast) {
|
|
+ return 98;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
BiomeBase biomebase = generatoraccess.getBiome(new BlockPosition(this));
|
|
int i = this.random.nextInt(100);
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index bbae44ddb5..4aaf75fcf4 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -440,10 +440,14 @@ public class PurpurWorldConfig {
|
|
public boolean rabbitRidable = false;
|
|
public boolean rabbitRidableInWater = false;
|
|
public boolean rabbitRequireShiftToMount = true;
|
|
+ public double rabbitNaturalToast = 0.0D;
|
|
+ public double rabbitNaturalKiller = 0.0D;
|
|
private void rabbitSettings() {
|
|
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
|
|
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
|
|
rabbitRequireShiftToMount = getBoolean("mobs.rabbit.require-shift-to-mount", rabbitRequireShiftToMount);
|
|
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
|
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
|
}
|
|
|
|
public boolean ravagerRidable = false;
|
|
--
|
|
2.24.0
|
|
|