Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
39 Zeilen
2.0 KiB
Diff
39 Zeilen
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
Date: Wed, 30 Sep 2020 22:49:14 +0200
|
|
Subject: [PATCH] Toggle for removing existing dragon
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index bc93318246eab1da5462aa3fa0cde4c100622f4e..62e60057a362ad7c3e96b3167f78ba154cfefdc3 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -71,6 +71,14 @@ public class PaperWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public boolean shouldRemoveDragon = false;
|
|
+ private void shouldRemoveDragon() {
|
|
+ shouldRemoveDragon = getBoolean("should-remove-dragon", shouldRemoveDragon);
|
|
+ if (shouldRemoveDragon) {
|
|
+ log("The Ender Dragon will be removed if she already exists without a portal.");
|
|
+ }
|
|
+ }
|
|
+
|
|
public short keepLoadedRange;
|
|
private void keepLoadedRange() {
|
|
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
|
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
index 01fb5d0c18d50e298a891a42428c5c87d6820194..ddfaaac55646527ccd5bb4f5b4d35aa3ddaf34f4 100644
|
|
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
@@ -216,7 +216,7 @@ public class EndDragonFight {
|
|
this.dragonUUID = enderDragon.getUUID();
|
|
LOGGER.info("Found that there's a dragon still alive ({})", (Object)enderDragon);
|
|
this.dragonKilled = false;
|
|
- if (!bl) {
|
|
+ if (!bl && this.level.paperConfig.shouldRemoveDragon) {
|
|
LOGGER.info("But we didn't have a portal, let's remove it.");
|
|
enderDragon.discard();
|
|
this.dragonUUID = null;
|