Paper/patches/server/0612-Add-toggle-for-always-placing-the-dragon-egg.patch

35 lines
2.0 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Thu, 26 Nov 2020 11:47:24 +0000
Subject: [PATCH] Add toggle for always placing the dragon egg
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-06-17 10:37:27 +02:00
index 70815cb7393008f8b02e83e68fe27bb5202d00f6..7fc5bf095afa6d5881285b89091d2ff48ffb69f0 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-06-17 10:37:27 +02:00
@@ -754,5 +754,10 @@ public class PaperWorldConfig {
2021-06-14 21:58:32 +02:00
private void perPlayerMobSpawns() {
perPlayerMobSpawns = getBoolean("per-player-mob-spawns", false);
2021-06-11 14:02:28 +02:00
}
+
+ public boolean enderDragonsDeathAlwaysPlacesDragonEgg = false;
+ private void enderDragonsDeathAlwaysPlacesDragonEgg() {
+ enderDragonsDeathAlwaysPlacesDragonEgg = getBoolean("ender-dragons-death-always-places-dragon-egg", enderDragonsDeathAlwaysPlacesDragonEgg);
+ }
}
2021-06-14 21:58:32 +02:00
2021-06-11 14:02:28 +02:00
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
2021-06-14 21:58:32 +02:00
index e1d689aa65b8d993c7223d306363366f3adff62f..f88719dede80c064f6210e078c435ffda32ecc1a 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
2021-06-14 21:58:32 +02:00
@@ -363,7 +363,7 @@ public class EndDragonFight {
2021-06-11 14:02:28 +02:00
this.dragonEvent.setVisible(false);
this.spawnExitPortal(true);
this.spawnNewGateway();
- if (!this.previouslyKilled) {
+ if (this.level.paperConfig.enderDragonsDeathAlwaysPlacesDragonEgg || !this.previouslyKilled) { // Paper - always place dragon egg
this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.defaultBlockState());
}