From 3bd7f206110875d6fe6384702d5b4fdae94ceac8 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 30 May 2021 18:18:03 -0700 Subject: [PATCH] Fix invulnerable end crystals: MC-108513 (#5734) --- .../Fix-invulnerable-end-crystals.patch | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Spigot-Server-Patches/Fix-invulnerable-end-crystals.patch diff --git a/Spigot-Server-Patches/Fix-invulnerable-end-crystals.patch b/Spigot-Server-Patches/Fix-invulnerable-end-crystals.patch new file mode 100644 index 0000000000..1a2b800623 --- /dev/null +++ b/Spigot-Server-Patches/Fix-invulnerable-end-crystals.patch @@ -0,0 +1,76 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Thu, 27 May 2021 14:52:30 -0700 +Subject: [PATCH] Fix invulnerable end crystals + +MC-108513 + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperWorldConfig { + private void fixItemsMergingThroughWalls() { + fixItemsMergingThroughWalls = getBoolean("fix-items-merging-through-walls", fixItemsMergingThroughWalls); + } ++ ++ public boolean fixInvulnerableEndCrystalExploit = true; ++ private void fixInvulnerableEndCrystalExploit() { ++ fixInvulnerableEndCrystalExploit = getBoolean("unsupported-settings.fix-invulnerable-end-crystal-exploit", fixInvulnerableEndCrystalExploit); ++ } + } +diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EnderDragonBattle.java b/src/main/java/net/minecraft/world/level/dimension/end/EnderDragonBattle.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/dimension/end/EnderDragonBattle.java ++++ b/src/main/java/net/minecraft/world/level/dimension/end/EnderDragonBattle.java +@@ -0,0 +0,0 @@ public class EnderDragonBattle { + + while (iterator.hasNext()) { + WorldGenEnder.Spike worldgenender_spike = (WorldGenEnder.Spike) iterator.next(); ++ if (!this.world.paperConfig.fixInvulnerableEndCrystalExploit || worldgenender_spike.crystal == null) { // Paper + List list = this.world.a(EntityEnderCrystal.class, worldgenender_spike.f()); + Iterator iterator1 = list.iterator(); + +@@ -0,0 +0,0 @@ public class EnderDragonBattle { + entityendercrystal.setInvulnerable(false); + entityendercrystal.setBeamTarget((BlockPosition) null); + } ++ // Paper start ++ } else { ++ worldgenender_spike.crystal.setInvulnerable(false); ++ worldgenender_spike.crystal.setBeamTarget(null); ++ worldgenender_spike.crystal = null; ++ } ++ // Paper end + } + + } +diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java +@@ -0,0 +0,0 @@ public class WorldGenEnder extends WorldGenerator list = worldgenfeatureendspikeconfiguration.c(); + + if (list.isEmpty()) { +@@ -0,0 +0,0 @@ public class WorldGenEnder extends WorldGenerator