From f4f370e55e653425bc3d9a5b2cf1f6c0429cebdc Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 17 Jan 2024 18:23:36 +1100 Subject: [PATCH] #1337: Add DragonBattle#setPreviouslyKilled By: DaFeist <56165444+dafeist-github@users.noreply.github.com> --- .../world/level/dimension/end/EnderDragonBattle.patch | 9 +++++++++ .../org/bukkit/craftbukkit/boss/CraftDragonBattle.java | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/paper-server/nms-patches/net/minecraft/world/level/dimension/end/EnderDragonBattle.patch b/paper-server/nms-patches/net/minecraft/world/level/dimension/end/EnderDragonBattle.patch index 66b3002c09..d8ee4ee0ad 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/dimension/end/EnderDragonBattle.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/dimension/end/EnderDragonBattle.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/world/level/dimension/end/EnderDragonBattle.java +++ b/net/minecraft/world/level/dimension/end/EnderDragonBattle.java +@@ -83,7 +83,7 @@ + private int ticksSinceCrystalsScanned; + private int ticksSinceLastPlayerScan; + private boolean dragonKilled; +- private boolean previouslyKilled; ++ public boolean previouslyKilled; + private boolean skipArenaLoadedCheck; + @Nullable + public UUID dragonUUID; @@ -110,14 +110,14 @@ this.origin = blockposition; this.validPlayer = IEntitySelector.ENTITY_STILL_ALIVE.and(IEntitySelector.withinDistance((double) blockposition.getX(), (double) (128 + blockposition.getY()), (double) blockposition.getZ(), 192.0D)); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java b/paper-server/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java index c5269942ef..0506fc3f27 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java @@ -62,6 +62,11 @@ public class CraftDragonBattle implements DragonBattle { return handle.hasPreviouslyKilledDragon(); } + @Override + public void setPreviouslyKilled(boolean previouslyKilled) { + handle.previouslyKilled = previouslyKilled; + } + @Override public void initiateRespawn() { this.handle.tryRespawn();