mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Add config for items breaking turtle eggs
This commit is contained in:
@@ -147,7 +147,17 @@ campfire-regen
|
|||||||
- **default**: false
|
- **default**: false
|
||||||
- **description**: Only players within line of sight of the campfire will receive the regen buff when the campfire is in smoke signal mode
|
- **description**: Only players within line of sight of the campfire will receive the regen buff when the campfire is in smoke signal mode
|
||||||
|
|
||||||
|
campfires-go-out-in-rain
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
* **default**: true
|
||||||
|
* **description**: Campfires burn out in the rain
|
||||||
|
|
||||||
allow-sign-colors
|
allow-sign-colors
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
* **default**: true
|
* **default**: true
|
||||||
* **description**: Allow players to use color codes on signs
|
* **description**: Allow players to use color codes on signs
|
||||||
|
|
||||||
|
items-can-break-turtle-eggs
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
* **default**: false
|
||||||
|
* **description**: Allow dropped items to damage/break turtle eggs
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
From fd5cde0c918895459900c386cf96a6bcfa922d86 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Thu, 6 Jun 2019 22:15:46 -0500
|
||||||
|
Subject: [PATCH] Add config for items breaking turtle eggs
|
||||||
|
|
||||||
|
---
|
||||||
|
.../java/net/minecraft/server/BlockTurtleEgg.java | 13 ++++++++++++-
|
||||||
|
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||||
|
2 files changed, 17 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||||
|
index a32ea2a4f..37a394d92 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||||
|
@@ -163,6 +163,17 @@ public class BlockTurtleEgg extends Block {
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean a(World world, Entity entity) {
|
||||||
|
- return entity instanceof EntityTurtle ? false : (entity instanceof EntityLiving && !(entity instanceof EntityHuman) ? world.getGameRules().getBoolean("mobGriefing") : true);
|
||||||
|
+ // Purpur start
|
||||||
|
+ if (entity instanceof EntityTurtle) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ if (!world.purpurConfig.itemsCanBreakTurtleEggs && entity instanceof EntityItem) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) {
|
||||||
|
+ return world.getGameRules().getBoolean("mobGriefing");
|
||||||
|
+ }
|
||||||
|
+ return true;
|
||||||
|
+ // Purpur end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index 7f1c3ccb6..a649a4c35 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -101,4 +101,9 @@ public class PurpurWorldConfig {
|
||||||
|
private void allowSignColors() {
|
||||||
|
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public boolean itemsCanBreakTurtleEggs = false;
|
||||||
|
+ private void itemsCanBreakTurtleEggs() {
|
||||||
|
+ itemsCanBreakTurtleEggs = getBoolean("items-can-break-turtle-eggs", itemsCanBreakTurtleEggs);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user