mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
53 lines
2.3 KiB
Diff
53 lines
2.3 KiB
Diff
From 5daded8219c8a600f6ad744e0efdab29ff5958a1 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 cb36334e41..238d260b5f 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
|
@@ -157,6 +157,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(GameRules.MOB_GRIEFING) : 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(GameRules.MOB_GRIEFING);
|
|
+ }
|
|
+ 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 f91019986c..37bd83271b 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -104,6 +104,11 @@ public class PurpurWorldConfig {
|
|
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
|
}
|
|
|
|
+ public boolean itemsCanBreakTurtleEggs = false;
|
|
+ private void itemsCanBreakTurtleEggs() {
|
|
+ itemsCanBreakTurtleEggs = getBoolean("items-can-break-turtle-eggs", itemsCanBreakTurtleEggs);
|
|
+ }
|
|
+
|
|
public boolean enderDragonAlwaysDropsEggBlock = false;
|
|
private void enderDragonSettings() {
|
|
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
|
--
|
|
2.24.0
|
|
|