PaperMC/patches/removed/1.17/No longer needed/0501-Fix-enderdragon-exp-dupe.patch

33 lines
1.4 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 12 Jun 2020 22:25:11 -0700
Subject: [PATCH] Fix enderdragon exp dupe
Properly track death stage when unloading/loading in the
dragon
1.17: Mojang fixed in 1.17(maybe before, idk)
2021-06-15 04:54:17 +02:00
resolved by Mojang https://bugs.mojang.com/browse/MCPE-64818
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index ec9436005a3a6fdfb4783d1092bb361224eb6414..b224a630f8adb1fa357c838e6b32c784aed0b15b 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -879,6 +879,7 @@ public class EnderDragon extends Mob implements Enemy {
public void addAdditionalSaveData(CompoundTag tag) {
super.addAdditionalSaveData(tag);
tag.putInt("DragonPhase", this.phaseManager.getCurrentPhase().getPhase().getId());
+ tag.putInt("Paper.DeathTick", this.dragonDeathTime); // Paper
}
@Override
@@ -887,6 +888,7 @@ public class EnderDragon extends Mob implements Enemy {
if (tag.contains("DragonPhase")) {
this.phaseManager.setPhase(EnderDragonPhase.getById(tag.getInt("DragonPhase")));
}
+ this.dragonDeathTime = tag.getInt("Paper.DeathTick"); // Paper
}