Files
Purpur/patches/server/0026-Always-place-dragon-egg-when-dragon-is-killed.patch
2019-06-01 02:04:11 -05:00

52 lines
2.2 KiB
Diff

From 9efc6b7d1792352c08101e95449d603fb260a3da Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 1 Jun 2019 01:16:35 -0500
Subject: [PATCH] Always place dragon egg when dragon is killed
---
src/main/java/net/minecraft/server/EnderDragonBattle.java | 4 +++-
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index 6700c8c65..f0c77eb6c 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -13,6 +13,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.function.Predicate;
import javax.annotation.Nullable;
+
+import net.pl3x.purpur.PurpurConfig;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -356,7 +358,7 @@ public class EnderDragonBattle {
this.bossBattle.setVisible(false);
this.a(true);
this.n();
- if (!this.l) {
+ if (PurpurConfig.enderDragonDeathAlwaysPlacesEggBlock || !this.l) { // Purpur - always place dragon egg
this.d.setTypeUpdate(this.d.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, WorldGenEndTrophy.a), Blocks.DRAGON_EGG.getBlockData());
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 6889dcdde..1c1a63144 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -141,6 +141,11 @@ public class PurpurConfig {
packedBarrels = getBoolean("settings.packed-barrels", packedBarrels);
}
+ public static boolean enderDragonDeathAlwaysPlacesEggBlock = true;
+ private static void enderDragonDeathAlwaysPlacesEggBlock() {
+ enderDragonDeathAlwaysPlacesEggBlock = getBoolean("ender-dragon-death-always-places-egg-block", enderDragonDeathAlwaysPlacesEggBlock);
+ }
+
public static boolean ridableBat = true;
public static boolean ridableBlaze = true;
public static boolean ridableCat = true;
--
2.20.1