Skip to content

Commit 1c035f6

Browse files
committed
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.
1 parent a47a187 commit 1c035f6

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/main/java/com/falsepattern/endlessids/mixin/mixins/common/potion/vanilla/PotionEffectMixin.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@
2222

2323
package com.falsepattern.endlessids.mixin.mixins.common.potion.vanilla;
2424

25-
import com.falsepattern.endlessids.EndlessIDs;
26-
import com.falsepattern.endlessids.constants.ExtendedConstants;
2725
import lombok.val;
28-
import lombok.var;
2926
import org.spongepowered.asm.mixin.Mixin;
3027
import org.spongepowered.asm.mixin.Shadow;
3128
import org.spongepowered.asm.mixin.injection.At;
3229
import org.spongepowered.asm.mixin.injection.Inject;
33-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
3430
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
3531

3632
import net.minecraft.nbt.NBTTagCompound;
@@ -40,35 +36,6 @@
4036
@Mixin(value = PotionEffect.class,
4137
priority = 2000 ) //Hodgepodge fixPotionLimit compat (inject-head into overwrite in readCustomPotionEffectFromNBT)
4238
public abstract class PotionEffectMixin {
43-
@Inject(method = "<init>(IIIZ)V",
44-
at = @At("RETURN"),
45-
require = 1)
46-
private void fixOutOfBoundsID(int p_i1576_1_, int p_i1576_2_, int p_i1576_3_, boolean p_i1576_4_, CallbackInfo ci) {
47-
var id = p_i1576_1_ & ExtendedConstants.potionIDMask;
48-
recovery:
49-
if (id != p_i1576_1_ && Potion.potionTypes[id] == null) {
50-
//Maybe vanilla code?
51-
val realId = id;
52-
id = id & 0xFF;
53-
if (Potion.potionTypes[id] == null) {
54-
//Nope
55-
id = realId;
56-
}
57-
}
58-
if (Potion.potionTypes[id] == null) {
59-
EndlessIDs.LOG.error("Encountered invalid potion ID: {}. See the following stacktrace for more info.", p_i1576_1_);
60-
EndlessIDs.LOG.error("Stacktrace:", new Throwable());
61-
EndlessIDs.LOG.error("Recovering to a valid potion ID (usually movement speed)");
62-
for (int i = 0; i < Potion.potionTypes.length; i++) {
63-
if (Potion.potionTypes[i] != null) {
64-
id = i;
65-
break;
66-
}
67-
}
68-
}
69-
this.potionID = id;
70-
}
71-
7239
@Inject(method = "readCustomPotionEffectFromNBT",
7340
at = @At(value = "HEAD"),
7441
cancellable = true,

0 commit comments

Comments
 (0)