Skip to content

Commit e4e7cb6

Browse files
fix MC-187100 (#427)
* fix MC-187100 * fix root cause --------- Co-authored-by: isxander <xander@isxander.dev>
1 parent 8caabef commit e4e7cb6

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

PATCHED.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
| Basic | [MC-165381](https://bugs.mojang.com/browse/MC-165381) | Block breaking can be delayed by dropping/throwing the tool while breaking a block | |
2525
| Basic | [MC-176559](https://bugs.mojang.com/browse/MC-176559) | Breaking process resets when a pickaxe enchanted with Mending mends by XP / Mending slows down breaking blocks again |
2626
| Basic | [MC-183776](https://bugs.mojang.com/browse/MC-183776) | After switching gamemodes using F3+F4, you need to press F3 twice to toggle the debug screen |
27+
| Basic | [MC-187100](https://bugs.mojang.com/browse/MC-187100) | End crystals try to heal dying Ender dragons |
2728
| Basic | [MC-197260](https://bugs.mojang.com/browse/MC-197260) | Armor Stand renders itself and armor dark if its head is in a solid block |
2829
| Basic | [MC-201723](https://bugs.mojang.com/browse/MC-201723) | Statistics sprites don't look pressed when clicked |
2930
| Basic | [MC-206540](https://bugs.mojang.com/browse/MC-206540) | Increased input delay when riding an entity |
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package dev.isxander.debugify.mixins.basic.mc187100;
2+
3+
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
4+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
5+
import net.minecraft.world.entity.boss.enderdragon.EndCrystal;
6+
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
7+
import org.jetbrains.annotations.Nullable;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.Shadow;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
import org.spongepowered.asm.mixin.injection.Inject;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13+
14+
@Mixin(EnderDragon.class)
15+
public class EnderDragonMixin {
16+
@Shadow
17+
public int dragonDeathTime;
18+
19+
@Shadow
20+
@Nullable
21+
public EndCrystal nearestCrystal;
22+
23+
@WrapMethod(method = "checkCrystals")
24+
private void dontFindNearestCrystalIfDying(Operation<Void> original) {
25+
if (this.dragonDeathTime > 0) {
26+
this.nearestCrystal = null;
27+
} else {
28+
original.call();
29+
}
30+
}
31+
32+
@Inject(method = "tickDeath", at = @At("HEAD"))
33+
private void clearNearestCrystalOnDeath(CallbackInfo ci) {
34+
this.nearestCrystal = null;
35+
}
36+
}

src/main/resources/debugify.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"basic.mc170462.MobEffectsMixin",
2424
"basic.mc179072.SwellGoalMixin",
2525
"basic.mc183990.MobMixin",
26+
"basic.mc187100.EnderDragonMixin",
2627
"basic.mc199467.MthMixin",
2728
"basic.mc200418.ZombieVillagerMixin",
2829
"basic.mc2025.EntityMixin",

0 commit comments

Comments
 (0)