From 3642301de0117e4a3d08a04e1093e9cc049db3df Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Tue, 18 Dec 2018 15:29:15 +0100 Subject: [PATCH] Untangle from MassiveCoreXlib --- pom.xml | 9 ++++++++- src/com/massivecraft/factions/Factions.java | 2 +- .../factions/adapter/BoardAdapter.java | 12 ++++++------ .../factions/adapter/BoardMapAdapter.java | 14 +++++++------- .../factions/adapter/RelAdapter.java | 9 +++++---- .../adapter/TerritoryAccessAdapter.java | 19 ++++++++++--------- .../massivecraft/factions/entity/Board.java | 2 +- .../massivecraft/factions/entity/Faction.java | 18 +++++++++--------- .../massivecraft/factions/entity/MPlayer.java | 5 +---- .../MigratorFaction001Invitations.java | 4 ++-- .../MigratorMConf001EnumerationUtil.java | 8 ++++---- 11 files changed, 54 insertions(+), 48 deletions(-) diff --git a/pom.xml b/pom.xml index 251f87d2..441940fa 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,13 @@ ${massiveColorInfo}${project.name} allows the players to team up and claim land as their own and start wars with other factions. This way we hope to inspire politics, intrigue, and team spirit. ${massiveDescriptionSuffix} ${massiveBaseUrl}/factions + + + sk89q-repo + http://maven.sk89q.com/repo/ + + + @@ -77,5 +84,5 @@ - + diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 9b6e37e5..af9cdd32 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -1,5 +1,6 @@ package com.massivecraft.factions; +import com.google.gson.GsonBuilder; import com.massivecraft.factions.adapter.BoardAdapter; import com.massivecraft.factions.adapter.BoardMapAdapter; import com.massivecraft.factions.adapter.RelAdapter; @@ -22,7 +23,6 @@ import com.massivecraft.massivecore.collections.MassiveList; import com.massivecraft.massivecore.command.type.RegistryType; import com.massivecraft.massivecore.store.migrator.MigratorUtil; import com.massivecraft.massivecore.util.MUtil; -import com.massivecraft.massivecore.xlib.gson.GsonBuilder; import org.bukkit.ChatColor; import java.util.List; diff --git a/src/com/massivecraft/factions/adapter/BoardAdapter.java b/src/com/massivecraft/factions/adapter/BoardAdapter.java index f232384b..b2df54c3 100644 --- a/src/com/massivecraft/factions/adapter/BoardAdapter.java +++ b/src/com/massivecraft/factions/adapter/BoardAdapter.java @@ -1,14 +1,14 @@ package com.massivecraft.factions.adapter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.entity.Board; import com.massivecraft.massivecore.ps.PS; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; -import com.massivecraft.massivecore.xlib.gson.JsonElement; -import com.massivecraft.massivecore.xlib.gson.JsonParseException; -import com.massivecraft.massivecore.xlib.gson.JsonSerializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonSerializer; import java.lang.reflect.Type; import java.util.Map; diff --git a/src/com/massivecraft/factions/adapter/BoardMapAdapter.java b/src/com/massivecraft/factions/adapter/BoardMapAdapter.java index 89fc0bfc..1556edfb 100644 --- a/src/com/massivecraft/factions/adapter/BoardMapAdapter.java +++ b/src/com/massivecraft/factions/adapter/BoardMapAdapter.java @@ -1,14 +1,14 @@ package com.massivecraft.factions.adapter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.massivecore.ps.PS; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; -import com.massivecraft.massivecore.xlib.gson.JsonElement; -import com.massivecraft.massivecore.xlib.gson.JsonObject; -import com.massivecraft.massivecore.xlib.gson.JsonParseException; -import com.massivecraft.massivecore.xlib.gson.JsonSerializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonSerializer; import java.lang.reflect.Type; import java.util.Map; diff --git a/src/com/massivecraft/factions/adapter/RelAdapter.java b/src/com/massivecraft/factions/adapter/RelAdapter.java index c817ebad..80362ee9 100644 --- a/src/com/massivecraft/factions/adapter/RelAdapter.java +++ b/src/com/massivecraft/factions/adapter/RelAdapter.java @@ -1,12 +1,13 @@ package com.massivecraft.factions.adapter; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; import com.massivecraft.factions.Rel; import com.massivecraft.factions.cmd.type.TypeRel; import com.massivecraft.massivecore.MassiveException; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; -import com.massivecraft.massivecore.xlib.gson.JsonElement; -import com.massivecraft.massivecore.xlib.gson.JsonParseException; import java.lang.reflect.Type; diff --git a/src/com/massivecraft/factions/adapter/TerritoryAccessAdapter.java b/src/com/massivecraft/factions/adapter/TerritoryAccessAdapter.java index ba4aca2c..596eb098 100644 --- a/src/com/massivecraft/factions/adapter/TerritoryAccessAdapter.java +++ b/src/com/massivecraft/factions/adapter/TerritoryAccessAdapter.java @@ -1,15 +1,16 @@ package com.massivecraft.factions.adapter; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.reflect.TypeToken; import com.massivecraft.factions.TerritoryAccess; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonDeserializer; -import com.massivecraft.massivecore.xlib.gson.JsonElement; -import com.massivecraft.massivecore.xlib.gson.JsonObject; -import com.massivecraft.massivecore.xlib.gson.JsonParseException; -import com.massivecraft.massivecore.xlib.gson.JsonPrimitive; -import com.massivecraft.massivecore.xlib.gson.JsonSerializationContext; -import com.massivecraft.massivecore.xlib.gson.JsonSerializer; -import com.massivecraft.massivecore.xlib.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.Set; diff --git a/src/com/massivecraft/factions/entity/Board.java b/src/com/massivecraft/factions/entity/Board.java index 07627f97..ff8635ff 100644 --- a/src/com/massivecraft/factions/entity/Board.java +++ b/src/com/massivecraft/factions/entity/Board.java @@ -1,12 +1,12 @@ package com.massivecraft.factions.entity; +import com.google.gson.reflect.TypeToken; import com.massivecraft.factions.Factions; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.massivecore.collections.MassiveMap; import com.massivecraft.massivecore.collections.MassiveSet; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.store.Entity; -import com.massivecraft.massivecore.xlib.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.Collections; diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index b2833f09..ee9b13b5 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -1,5 +1,6 @@ package com.massivecraft.factions.entity; + import com.massivecraft.factions.Factions; import com.massivecraft.factions.FactionsIndex; import com.massivecraft.factions.FactionsParticipator; @@ -36,7 +37,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; public class Faction extends Entity implements FactionsParticipator @@ -577,11 +577,11 @@ public class Faction extends Entity implements FactionsParticipator } // ... and if anything is explicitly set we use that info ... - Iterator> iter = this.flags.entrySet().iterator(); + Iterator> iter = this.flags.entrySet().iterator(); while (iter.hasNext()) { // ... for each entry ... - Entry entry = iter.next(); + Map.Entry entry = iter.next(); // ... extract id and remove null values ... String id = entry.getKey(); @@ -605,7 +605,7 @@ public class Faction extends Entity implements FactionsParticipator public void setFlags(Map flags) { Map flagIds = new MassiveMap<>(); - for (Entry entry : flags.entrySet()) + for (Map.Entry entry : flags.entrySet()) { flagIds.put(entry.getKey().getId(), entry.getValue()); } @@ -616,7 +616,7 @@ public class Faction extends Entity implements FactionsParticipator { // Clean input MassiveMapDef target = new MassiveMapDef<>(); - for (Entry entry : flagIds.entrySet()) + for (Map.Entry entry : flagIds.entrySet()) { String key = entry.getKey(); if (key == null) continue; @@ -703,11 +703,11 @@ public class Faction extends Entity implements FactionsParticipator } // ... and if anything is explicitly set we use that info ... - Iterator>> iter = this.perms.entrySet().iterator(); + Iterator>> iter = this.perms.entrySet().iterator(); while (iter.hasNext()) { // ... for each entry ... - Entry> entry = iter.next(); + Map.Entry> entry = iter.next(); // ... extract id and remove null values ... String id = entry.getKey(); @@ -730,7 +730,7 @@ public class Faction extends Entity implements FactionsParticipator public void setPerms(Map> perms) { Map> permIds = new MassiveMap<>(); - for (Entry> entry : perms.entrySet()) + for (Map.Entry> entry : perms.entrySet()) { permIds.put(entry.getKey().getId(), entry.getValue()); } @@ -741,7 +741,7 @@ public class Faction extends Entity implements FactionsParticipator { // Clean input MassiveMapDef> target = new MassiveMapDef<>(); - for (Entry> entry : perms.entrySet()) + for (Map.Entry> entry : perms.entrySet()) { String key = entry.getKey(); if (key == null) continue; diff --git a/src/com/massivecraft/factions/entity/MPlayer.java b/src/com/massivecraft/factions/entity/MPlayer.java index 3d6576c3..085e90c9 100644 --- a/src/com/massivecraft/factions/entity/MPlayer.java +++ b/src/com/massivecraft/factions/entity/MPlayer.java @@ -1,5 +1,6 @@ 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; @@ -17,13 +18,10 @@ import com.massivecraft.massivecore.mixin.MixinSenderPs; import com.massivecraft.massivecore.mixin.MixinTitle; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PSFormatHumanSpace; -import com.massivecraft.massivecore.store.Coll; -import com.massivecraft.massivecore.store.Modification; import com.massivecraft.massivecore.store.SenderEntity; import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.Txt; -import com.massivecraft.massivecore.xlib.gson.annotations.SerializedName; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -32,7 +30,6 @@ import java.lang.ref.WeakReference; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; -import java.util.Map; import java.util.Map.Entry; import java.util.Set; diff --git a/src/com/massivecraft/factions/entity/migrator/MigratorFaction001Invitations.java b/src/com/massivecraft/factions/entity/migrator/MigratorFaction001Invitations.java index 7d7e0369..27af7f40 100644 --- a/src/com/massivecraft/factions/entity/migrator/MigratorFaction001Invitations.java +++ b/src/com/massivecraft/factions/entity/migrator/MigratorFaction001Invitations.java @@ -1,11 +1,11 @@ package com.massivecraft.factions.entity.migrator; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.store.migrator.MigratorFieldConvert; import com.massivecraft.massivecore.store.migrator.MigratorFieldRename; import com.massivecraft.massivecore.store.migrator.MigratorRoot; -import com.massivecraft.massivecore.xlib.gson.JsonElement; -import com.massivecraft.massivecore.xlib.gson.JsonObject; public class MigratorFaction001Invitations extends MigratorRoot { diff --git a/src/com/massivecraft/factions/entity/migrator/MigratorMConf001EnumerationUtil.java b/src/com/massivecraft/factions/entity/migrator/MigratorMConf001EnumerationUtil.java index 43ee3266..0a007de0 100644 --- a/src/com/massivecraft/factions/entity/migrator/MigratorMConf001EnumerationUtil.java +++ b/src/com/massivecraft/factions/entity/migrator/MigratorMConf001EnumerationUtil.java @@ -1,12 +1,12 @@ package com.massivecraft.factions.entity.migrator; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.util.EnumerationUtil; import com.massivecraft.massivecore.store.migrator.MigratorRoot; -import com.massivecraft.massivecore.xlib.gson.JsonArray; -import com.massivecraft.massivecore.xlib.gson.JsonElement; -import com.massivecraft.massivecore.xlib.gson.JsonObject; -import com.massivecraft.massivecore.xlib.gson.JsonPrimitive; import java.util.Collection; import java.util.Iterator;