mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Update to 1.15
This commit is contained in:
49
patches/server/0058-Add-option-to-spawn-Toast.patch
Normal file
49
patches/server/0058-Add-option-to-spawn-Toast.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 2654372002db43e578e7d72832a91b1223ceb2b7 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] Add option to spawn Toast
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityRabbit.java | 3 ++-
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 2 ++
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
index c8de748664..35b8e182c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
@@ -300,7 +300,7 @@ public class EntityRabbit extends EntityAnimal {
|
||||
if (!this.hasCustomName()) {
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bx), new Object[0]));
|
||||
}
|
||||
- }
|
||||
+ } else if (i == 98) setCustomName(new ChatMessage("Toast")); // Purpur
|
||||
|
||||
this.datawatcher.set(EntityRabbit.bw, i);
|
||||
}
|
||||
@@ -322,6 +322,7 @@ 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
|
||||
+ if (net.pl3x.purpur.PurpurConfig.toastRabbitChance > 0D && net.pl3x.purpur.PurpurConfig.toastRabbitChance > random.nextDouble()) return 98; // 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 3e96f63dbe..569c5b3442 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -245,8 +245,10 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static double killerRabbitChance = 0.0D;
|
||||
+ public static double toastRabbitChance = 0.0D;
|
||||
private static void rabbitSettings() {
|
||||
killerRabbitChance = getDouble("settings.mobs.rabbit.spawn-killer-rabbit-chance", killerRabbitChance);
|
||||
+ toastRabbitChance = getDouble("settings.mobs.rabbit.spawn-toast-chance", toastRabbitChance);
|
||||
}
|
||||
|
||||
public static boolean snowmanDropsPumpkin = false;
|
||||
--
|
||||
2.24.0.rc1
|
||||
|
||||
Reference in New Issue
Block a user