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