Paper/Spigot-Server-Patches/0594-Toggle-for-removing-existing-dragon.patch
Jake Potrebic 899bc53b79
Updated Upstream (Bukkit/CraftBukkit) (#4779)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
f47abd88 SPIGOT-6242: Fix some file line endings
de96535b SPIGOT-6234: enum classes don't serialize properly when implementing ConfigurationSerializable

CraftBukkit Changes:
4475707d SPIGOT-6244: /spawnpoint ignores angle
8b3b096d SPIGOT-6242: Fix some file line endings
4b33c749 SPIGOT-6186: Canceling a CreatureSpawnEvent​ results in a "Unable to summon entity due to duplicate UUIDs" error
2b3ca726 SPIGOT-6236: Vehicle passenger portal cooldown does not change
2020-11-17 22:45:18 -05:00

37 lines
1.9 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 8923314d731dea5c2707dbb271b8b0819d826a2e..9a0ade5875c34487a65f82f9380f9d25b4432586 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -672,4 +672,12 @@ public class PaperWorldConfig {
log("Using vanilla redstone algorithm.");
}
}
+
+ 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.");
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index 95ecf9dd511836cc2f70173f07234ef8822d6038..38dc6086d18951e065d4048d1d8eee288c5c5fd1 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -172,7 +172,7 @@ public class EnderDragonBattle {
this.dragonUUID = entityenderdragon.getUniqueID();
EnderDragonBattle.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon);
this.dragonKilled = false;
- if (!flag) {
+ if (!flag && this.world.paperConfig.shouldRemoveDragon) { // Paper
EnderDragonBattle.LOGGER.info("But we didn't have a portal, let's remove it.");
entityenderdragon.die();
this.dragonUUID = null;