Created
February 11, 2026 00:58
-
-
Save tildejustin/2ced09a60e06e7ce26b9dc18b69875b9 to your computer and use it in GitHub Desktop.
fix broken portal spawn and dragon skip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | |
| import net.minecraft.entity.boss.dragon.EnderDragonFight; | |
| import net.minecraft.util.math.BlockPos; | |
| import org.objectweb.asm.Opcodes; | |
| import org.spongepowered.asm.mixin.*; | |
| import org.spongepowered.asm.mixin.injection.At; | |
| @Mixin(EnderDragonFight.class) | |
| public abstract class EnderDragonFightMixin { | |
| @Shadow | |
| private boolean doLegacyCheck; | |
| @ModifyExpressionValue(method = "generateEndPortal", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/BlockPos;down()Lnet/minecraft/util/math/BlockPos;", ordinal = 0)) | |
| private BlockPos appropriateMin(BlockPos original) { | |
| return new BlockPos(original.getX(), Math.max(original.getY(), 1), original.getZ()); | |
| } | |
| @ModifyExpressionValue(method = "respawnDragon()V", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/boss/dragon/EnderDragonFight;dragonKilled:Z", opcode = Opcodes.GETFIELD)) | |
| private boolean respawnCheckIfDoingLegacyCheck(boolean original) { | |
| return original && !this.doLegacyCheck; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment