From 1c035f6110e7d3fb03f9cefe03e765b338cf2629 Mon Sep 17 00:00:00 2001 From: FalsePattern Date: Mon, 3 Nov 2025 04:27:15 +0100 Subject: [PATCH] fix: Remove broken potion ID recovery logic It was causing issues with Salis Arcana, SuperTic, etc. I am not fixing your bugs. Garbage in, garbage out, figure it out, i don't care anymore. --- .../potion/vanilla/PotionEffectMixin.java | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/potion/vanilla/PotionEffectMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/potion/vanilla/PotionEffectMixin.java index f93fc9f..07a9d40 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/potion/vanilla/PotionEffectMixin.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/potion/vanilla/PotionEffectMixin.java @@ -22,15 +22,11 @@ package com.falsepattern.endlessids.mixin.mixins.common.potion.vanilla; -import com.falsepattern.endlessids.EndlessIDs; -import com.falsepattern.endlessids.constants.ExtendedConstants; import lombok.val; -import lombok.var; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.nbt.NBTTagCompound; @@ -40,35 +36,6 @@ import net.minecraft.potion.PotionEffect; @Mixin(value = PotionEffect.class, priority = 2000 ) //Hodgepodge fixPotionLimit compat (inject-head into overwrite in readCustomPotionEffectFromNBT) public abstract class PotionEffectMixin { - @Inject(method = "(IIIZ)V", - at = @At("RETURN"), - require = 1) - private void fixOutOfBoundsID(int p_i1576_1_, int p_i1576_2_, int p_i1576_3_, boolean p_i1576_4_, CallbackInfo ci) { - var id = p_i1576_1_ & ExtendedConstants.potionIDMask; - recovery: - if (id != p_i1576_1_ && Potion.potionTypes[id] == null) { - //Maybe vanilla code? - val realId = id; - id = id & 0xFF; - if (Potion.potionTypes[id] == null) { - //Nope - id = realId; - } - } - if (Potion.potionTypes[id] == null) { - EndlessIDs.LOG.error("Encountered invalid potion ID: {}. See the following stacktrace for more info.", p_i1576_1_); - EndlessIDs.LOG.error("Stacktrace:", new Throwable()); - EndlessIDs.LOG.error("Recovering to a valid potion ID (usually movement speed)"); - for (int i = 0; i < Potion.potionTypes.length; i++) { - if (Potion.potionTypes[i] != null) { - id = i; - break; - } - } - } - this.potionID = id; - } - @Inject(method = "readCustomPotionEffectFromNBT", at = @At(value = "HEAD"), cancellable = true,