mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 01:24:09 +00:00
Keep the pBurnItem migration on revision 23
Revision 23 never shipped without the burn flag - it released together with it - so no saved NPC carries version 23 from a build that lacked pBurnItem. The migration belongs in the < 23 gate, and bumping ModRev would only force a redundant pass over every NPC.
This commit is contained in:
1 parent
3193a2bfc3
commit
2de0795a8e
1 file changed
+11
-11
@@ -14,26 +14,26 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class VersionCompatibility {
|
||||
public static int ModRev = 24;
|
||||
public static int ModRev = 23;
|
||||
|
||||
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");
|
||||
compound.setInteger("AimType", !aimShot ? 0 : 1);
|
||||
}
|
||||
|
||||
// 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. Shipped alongside revision 23, so anything already
|
||||
// at 23 was written by a build that had the flag.
|
||||
if (compound.hasKey("pEffect") && !compound.hasKey("pBurnItem")) {
|
||||
if (EnumPotionType.fromOrdinal(compound.getInteger("pEffect")) == EnumPotionType.Fire) {
|
||||
compound.setBoolean("pBurnItem", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (npc.npcVersion < 22) {
|
||||
if (compound.hasKey("CanLeap")) {
|
||||
|
||||
Reference in new issue
Block a user