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: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
62 lines
2.9 KiB
Diff
62 lines
2.9 KiB
Diff
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/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
|
index 587feda351efae19407cb9f23c6c1d42d5ed0cc9..e0ba1ef404c9f8ba1eae563b733d10d94b1442e4 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
|
@@ -426,7 +426,11 @@ public class Rabbit extends Animal {
|
|
if (!this.hasCustomName()) {
|
|
this.setCustomName(new TranslatableComponent(Util.makeDescriptionId("entity", Rabbit.KILLER_BUNNY)));
|
|
}
|
|
+ // Purpur start
|
|
+ } else if (rabbitType == 98) {
|
|
+ setCustomName(new TranslatableComponent("Toast"));
|
|
}
|
|
+ // Purpur end
|
|
|
|
this.entityData.set(Rabbit.DATA_TYPE_ID, rabbitType);
|
|
}
|
|
@@ -447,6 +451,16 @@ public class Rabbit extends Animal {
|
|
}
|
|
|
|
private int getRandomRabbitType(LevelAccessor world) {
|
|
+ // Purpur start
|
|
+ Level level = world.getMinecraftWorld();
|
|
+ if (level.purpurConfig.rabbitNaturalKiller > 0D && random.nextDouble() <= level.purpurConfig.rabbitNaturalKiller) {
|
|
+ return 99;
|
|
+ }
|
|
+ if (level.purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= level.purpurConfig.rabbitNaturalToast) {
|
|
+ return 98;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
Biome biomebase = world.getBiome(this.blockPosition());
|
|
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 c7a844bb8111dae7c9502ae2cf1660816d3a83f8..08bfa6591548259906f0e7c82046826aafe6bb33 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -817,6 +817,8 @@ public class PurpurWorldConfig {
|
|
public boolean rabbitRidable = false;
|
|
public boolean rabbitRidableInWater = false;
|
|
public double rabbitMaxHealth = 3.0D;
|
|
+ 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);
|
|
@@ -826,6 +828,8 @@ public class PurpurWorldConfig {
|
|
set("mobs.rabbit.attributes.max_health", oldValue);
|
|
}
|
|
rabbitMaxHealth = getDouble("mobs.rabbit.attributes.max_health", rabbitMaxHealth);
|
|
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
|
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
|
}
|
|
|
|
public boolean ravagerRidable = false;
|