Compare commits

..
2 Commits
Author SHA1 Message Date
FalsePattern 1c035f6110 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.
2025-11-03 04:27:15 +01:00
FalsePattern a47a187d65 fix: DragonAPI mixin compat error 2025-09-30 22:30:34 +02:00
2 changed files with 5 additions and 34 deletions

No files matched your search

@@ -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 = "<init>(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,
@@ -119,9 +119,13 @@ public enum Mixin implements IMixins {
common("biome.vanilla.BiomeDictionaryMixin",
"biome.vanilla.BiomeGenBaseMixin",
"biome.vanilla.ChunkMixin",
"biome.vanilla.GenLayerRiverMixMixin",
"biome.vanilla.GenLayerVoronoiZoomMixin")),
Biome_Vanilla_NoDragonAPI(Phase.EARLY,
Ext.Biome,
avoid(DragonAPI),
common("biome.vanilla.GenLayerRiverMixMixin")),
Biome_Vanilla_Placeholders(Phase.EARLY,
() -> GeneralConfig.extendBiome && GeneralConfig.biomeConflictAvoidancePlaceholders,
common("biome.vanilla.BiomeGenBasePlaceholderMixin")),