From 7c10a6c83f58106f721e11a2c847d74cd4734388 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 3 May 2013 09:58:43 +0200 Subject: [PATCH] MCore changes --- src/com/massivecraft/factions/Factions.java | 6 +++--- .../factions/cmd/CmdFactionsCreate.java | 3 ++- .../massivecraft/factions/cmd/CmdFactionsPerm.java | 4 ++-- .../massivecraft/factions/entity/BoardColls.java | 2 +- src/com/massivecraft/factions/entity/Faction.java | 13 ++++++------- .../massivecraft/factions/entity/FactionColls.java | 2 +- .../massivecraft/factions/entity/UConfColls.java | 2 +- .../massivecraft/factions/entity/UPlayerColls.java | 2 +- .../factions/listeners/FactionsListenerMain.java | 9 --------- 9 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index faf2d81d..d52b0b11 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -40,10 +40,10 @@ import com.massivecraft.factions.task.TaskPlayerDataRemove; import com.massivecraft.factions.task.TaskEconLandReward; import com.massivecraft.factions.task.TaskPlayerPowerUpdate; +import com.massivecraft.mcore.Aspect; +import com.massivecraft.mcore.AspectColl; import com.massivecraft.mcore.MPlugin; -import com.massivecraft.mcore.usys.Aspect; -import com.massivecraft.mcore.usys.AspectColl; -import com.massivecraft.mcore.usys.Multiverse; +import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.xlib.gson.Gson; import com.massivecraft.mcore.xlib.gson.GsonBuilder; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index bb2016be..137f407b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java @@ -17,6 +17,7 @@ import com.massivecraft.factions.event.FactionsEventCreate; import com.massivecraft.factions.event.FactionsEventMembershipChange; import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason; import com.massivecraft.mcore.cmd.req.ReqHasPerm; +import com.massivecraft.mcore.store.MStore; public class CmdFactionsCreate extends FCommand { @@ -54,7 +55,7 @@ public class CmdFactionsCreate extends FCommand } // Pre-Generate Id - String factionId = coll.getIdStrategy().generate(coll); + String factionId = MStore.createId(); // Event FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java index 39de35ad..90676170 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java @@ -47,7 +47,7 @@ public class CmdFactionsPerm extends FCommand FPerm perm = this.arg(1, ARFPerm.get()); if (perm == null) return; - System.out.println("perm = "+perm); + //System.out.println("perm = "+perm); if ( ! this.argIsSet(2)) { @@ -73,7 +73,7 @@ public class CmdFactionsPerm extends FCommand if (val == null) return; // Do the change - System.out.println("setRelationPermitted perm "+perm+", rel "+rel+", val "+val); + //System.out.println("setRelationPermitted perm "+perm+", rel "+rel+", val "+val); faction.setRelationPermitted(perm, rel, val); // The following is to make sure the leader always has the right to change perms if that is our goal. diff --git a/src/com/massivecraft/factions/entity/BoardColls.java b/src/com/massivecraft/factions/entity/BoardColls.java index 8ce013b6..381e20a4 100644 --- a/src/com/massivecraft/factions/entity/BoardColls.java +++ b/src/com/massivecraft/factions/entity/BoardColls.java @@ -12,9 +12,9 @@ import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.TerritoryAccess; +import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.ps.PS; import com.massivecraft.mcore.ps.PSBuilder; -import com.massivecraft.mcore.usys.Aspect; import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index b54dd76c..da75f4fe 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -22,7 +22,6 @@ import com.massivecraft.mcore.ps.PS; import com.massivecraft.mcore.store.Entity; import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.SenderUtil; -import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; public class Faction extends Entity implements EconomyParticipator @@ -661,8 +660,8 @@ public class Faction extends Entity implements EconomyParticipator } } - System.out.println("setPerms target:"); - System.out.println(Factions.get().gson.toJson(target, new TypeToken>>(){}.getType())); + //System.out.println("setPerms target:"); + //System.out.println(Factions.get().gson.toJson(target, new TypeToken>>(){}.getType())); // Detect Nochange if (MUtil.equals(this.perms, target)) return; @@ -699,8 +698,8 @@ public class Faction extends Entity implements EconomyParticipator { Map> perms = this.getPerms(); - System.out.println("setRelationPermitted before:"); - System.out.println(Factions.get().gson.toJson(perms, new TypeToken>>(){}.getType())); + //System.out.println("setRelationPermitted before:"); + //System.out.println(Factions.get().gson.toJson(perms, new TypeToken>>(){}.getType())); Set rels = perms.get(perm); @@ -713,8 +712,8 @@ public class Faction extends Entity implements EconomyParticipator rels.remove(rel); } - System.out.println("setRelationPermitted after:"); - System.out.println(Factions.get().gson.toJson(perms, new TypeToken>>(){}.getType())); + //System.out.println("setRelationPermitted after:"); + //System.out.println(Factions.get().gson.toJson(perms, new TypeToken>>(){}.getType())); this.setPerms(perms); } diff --git a/src/com/massivecraft/factions/entity/FactionColls.java b/src/com/massivecraft/factions/entity/FactionColls.java index 4dadcee9..a4628950 100644 --- a/src/com/massivecraft/factions/entity/FactionColls.java +++ b/src/com/massivecraft/factions/entity/FactionColls.java @@ -8,8 +8,8 @@ import java.util.Set; import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; +import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.MCore; -import com.massivecraft.mcore.usys.Aspect; import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; diff --git a/src/com/massivecraft/factions/entity/UConfColls.java b/src/com/massivecraft/factions/entity/UConfColls.java index 49b4d5c9..f0ab2fef 100644 --- a/src/com/massivecraft/factions/entity/UConfColls.java +++ b/src/com/massivecraft/factions/entity/UConfColls.java @@ -2,8 +2,8 @@ package com.massivecraft.factions.entity; import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; +import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.MCore; -import com.massivecraft.mcore.usys.Aspect; public class UConfColls extends XColls { diff --git a/src/com/massivecraft/factions/entity/UPlayerColls.java b/src/com/massivecraft/factions/entity/UPlayerColls.java index d502fb8b..e8106ea2 100644 --- a/src/com/massivecraft/factions/entity/UPlayerColls.java +++ b/src/com/massivecraft/factions/entity/UPlayerColls.java @@ -7,8 +7,8 @@ import java.util.Map.Entry; import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; +import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.MCore; -import com.massivecraft.mcore.usys.Aspect; import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java index 46c5f846..13267573 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java @@ -650,15 +650,6 @@ public class FactionsListenerMain implements Listener // If the faction at the block has firespread disabled ... PS ps = PS.valueOf(block); Faction faction = BoardColls.get().getFactionAt(ps); - - // TODO: Remove this debug output soon. - if (faction == null) - { - System.out.println("faction was null"); - System.out.println("block was "+block); - System.out.println("ps was "+ps); - return; - } if (faction.getFlag(FFlag.FIRESPREAD)) return;