mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 20:07:32 +00:00
Bump ModRev so the pBurnItem migration can run
The migration sat in the npcVersion < 17 block, but ModRev has been 23 since 2023 and CheckNpcCompatibility returns early when the save already matches it - so every NPC affected by the regression was skipped. Moved to a < 24 block and bumped ModRev to 24 so it actually reaches them.
This commit is contained in:
1 parent
1532ef722c
commit
fab1062ce8
1 file changed
+11
-9
@@ -14,11 +14,21 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class VersionCompatibility {
|
||||
public static int ModRev = 23;
|
||||
public static int ModRev = 24;
|
||||
|
||||
public static void CheckNpcCompatibility(EntityNPCInterface npc, NBTTagCompound compound) {
|
||||
if (npc.npcVersion == ModRev)
|
||||
return;
|
||||
if (npc.npcVersion < 24) {
|
||||
// Fire projectiles used to ignite unconditionally. The ignite check now also requires
|
||||
// pBurnItem, which reads false when the key is absent, so restore it for anything
|
||||
// saved before the flag existed.
|
||||
if (compound.hasKey("pEffect") && !compound.hasKey("pBurnItem")) {
|
||||
if (EnumPotionType.fromOrdinal(compound.getInteger("pEffect")) == EnumPotionType.Fire) {
|
||||
compound.setBoolean("pBurnItem", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.npcVersion < 23) {
|
||||
if (compound.hasKey("AimWhileShooting")) {
|
||||
boolean aimShot = compound.getBoolean("AimWhileShooting");
|
||||
@@ -50,14 +60,6 @@ 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 (!compound.hasKey("pBurnItem") && enumPotionType == EnumPotionType.Fire) {
|
||||
compound.setBoolean("pBurnItem", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.npcVersion < 12) {
|
||||
CompatabilityFix(compound, npc.advanced.writeToNBT(new NBTTagCompound()));
|
||||
|
||||
Reference in new issue
Block a user