Fix pEffect legacy Compatibility

This commit is contained in:
zeng-github01 committed 2026-03-29 10:19:32 +08:00
1 parent b2c279feeb
commit 07a914272a
1 file changed
+9
@@ -4,6 +4,7 @@ import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
import net.minecraft.nbt.NBTTagList;
import noppes.npcs.constants.EnumPotionType;
import noppes.npcs.controllers.data.Line;
import noppes.npcs.controllers.data.Lines;
import noppes.npcs.entity.EntityNPCInterface;
@@ -49,6 +50,14 @@ public class VersionCompatibility {
if (compound.hasKey("DialogDarkenScreen")) {
compound.removeTag("DialogDarkenScreen");
}
if (compound.hasKey("pEffect")) {
int effect = compound.getInteger("pEffect");
EnumPotionType enumPotionType = EnumPotionType.fromOrdinal(effect);
if (enumPotionType == EnumPotionType.Fire) {
compound.setBoolean("pBurnItem", true);
}
}
}
if (npc.npcVersion < 12) {
CompatabilityFix(compound, npc.advanced.writeToNBT(new NBTTagCompound()));