Files
Purpur/patches/server/0040-Rabbit-naturally-spawn-toast-and-killer.patch
William Blake Galbreath 5c7cdad371 Updated Upstream (Paper & Tuinity)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
fcbeac8a [CI-SKIP] Readme update (#3702)
824f8086 Bandaid italic legacy serialization #3757 (#3760)

Tuinity Changes:
9f21359: Re-add optimise collision checking in player move packet handling
1152054: Revert player move packet optimisation
ef0a6c4: Optimise collision checking in player move packets
2020-07-02 20:38:04 -05:00

57 lines
2.5 KiB
Java

From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
index 00c9233f8..1be0f943b 100644
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
@@ -297,6 +297,10 @@ public class EntityRabbit extends EntityAnimal {
if (!this.hasCustomName()) {
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bw)));
}
+ // Purpur start
+ } else if (i == 98) {
+ setCustomName(new ChatMessage("Toast"));
+ // Purpur end
}
this.datawatcher.set(EntityRabbit.bv, i);
@@ -318,6 +322,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(this.getChunkCoordinates());
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 5004d6f77..52e459002 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -137,6 +137,13 @@ public class PurpurWorldConfig {
illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
}
+ public double rabbitNaturalToast = 0.0D;
+ public double rabbitNaturalKiller = 0.0D;
+ private void rabbitSettings() {
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
+ }
+
public int villagerBrainTicks = 1;
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
private void villagerSettings() {