From 15f03799a9fde13ef7a007c561596c4409d4c2ec Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Fri, 1 Feb 2019 11:25:49 +0100 Subject: [PATCH] Rename field from usingAdminMode to overriding --- src/com/massivecraft/factions/Factions.java | 4 +++- .../massivecraft/factions/entity/MPlayer.java | 4 +--- .../MigratorMPlayer002UsingAdminMode.java | 21 +++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/com/massivecraft/factions/entity/migrator/MigratorMPlayer002UsingAdminMode.java diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index f732dbff..2e3c1b9b 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -62,6 +62,7 @@ import com.massivecraft.factions.entity.migrator.MigratorMConf004Rank; import com.massivecraft.factions.entity.migrator.MigratorMConf005Warps; import com.massivecraft.factions.entity.migrator.MigratorMPerm001Warps; import com.massivecraft.factions.entity.migrator.MigratorMPlayer001Ranks; +import com.massivecraft.factions.entity.migrator.MigratorMPlayer002UsingAdminMode; import com.massivecraft.factions.event.EventFactionsChunkChangeType; import com.massivecraft.factions.integration.V18.IntegrationV18; import com.massivecraft.factions.integration.V19.IntegrationV19; @@ -150,7 +151,8 @@ public class Factions extends MassivePlugin MigratorMConf004Rank.class, MigratorMConf005Warps.class, MigratorMPerm001Warps.class, - MigratorMPlayer001Ranks.class + MigratorMPlayer001Ranks.class, + MigratorMPlayer002UsingAdminMode.class ); } diff --git a/src/com/massivecraft/factions/entity/MPlayer.java b/src/com/massivecraft/factions/entity/MPlayer.java index bbf8e47e..096d62d5 100644 --- a/src/com/massivecraft/factions/entity/MPlayer.java +++ b/src/com/massivecraft/factions/entity/MPlayer.java @@ -1,6 +1,5 @@ package com.massivecraft.factions.entity; -import com.google.gson.annotations.SerializedName; import com.massivecraft.factions.Factions; import com.massivecraft.factions.FactionsIndex; import com.massivecraft.factions.FactionsParticipator; @@ -52,7 +51,7 @@ public class MPlayer extends SenderEntity implements FactionsParticipat // VERSION // -------------------------------------------- // - public int version = 1; + public int version = 2; // -------------------------------------------- // // LOAD @@ -168,7 +167,6 @@ public class MPlayer extends SenderEntity implements FactionsParticipat // Is this player overriding? // Null means false - @SerializedName(value = "usingAdminMode") private Boolean overriding = null; // Does this player use titles for territory info? diff --git a/src/com/massivecraft/factions/entity/migrator/MigratorMPlayer002UsingAdminMode.java b/src/com/massivecraft/factions/entity/migrator/MigratorMPlayer002UsingAdminMode.java new file mode 100644 index 00000000..90a68b8f --- /dev/null +++ b/src/com/massivecraft/factions/entity/migrator/MigratorMPlayer002UsingAdminMode.java @@ -0,0 +1,21 @@ +package com.massivecraft.factions.entity.migrator; + +import com.massivecraft.factions.entity.MPlayer; +import com.massivecraft.massivecore.store.migrator.MigratorFieldRename; +import com.massivecraft.massivecore.store.migrator.MigratorRoot; + +public class MigratorMPlayer002UsingAdminMode extends MigratorRoot +{ + // -------------------------------------------- // + // INSTANCE & CONSTRUCT + // -------------------------------------------- // + + private static MigratorMPlayer002UsingAdminMode i = new MigratorMPlayer002UsingAdminMode(); + public static MigratorMPlayer002UsingAdminMode get() { return i; } + private MigratorMPlayer002UsingAdminMode() + { + super(MPlayer.class); + this.addInnerMigrator(MigratorFieldRename.get("usingAdminMode", "overriding")); + } + +}