MCore changes

This commit is contained in:
Olof Larsson 2013-05-03 09:58:43 +02:00
parent cf03bd5b8a
commit 7c10a6c83f
9 changed files with 17 additions and 26 deletions

View File

@ -40,10 +40,10 @@ import com.massivecraft.factions.task.TaskPlayerDataRemove;
import com.massivecraft.factions.task.TaskEconLandReward; import com.massivecraft.factions.task.TaskEconLandReward;
import com.massivecraft.factions.task.TaskPlayerPowerUpdate; 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.MPlugin;
import com.massivecraft.mcore.usys.Aspect; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.usys.AspectColl;
import com.massivecraft.mcore.usys.Multiverse;
import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.MUtil;
import com.massivecraft.mcore.xlib.gson.Gson; import com.massivecraft.mcore.xlib.gson.Gson;
import com.massivecraft.mcore.xlib.gson.GsonBuilder; import com.massivecraft.mcore.xlib.gson.GsonBuilder;

View File

@ -17,6 +17,7 @@ import com.massivecraft.factions.event.FactionsEventCreate;
import com.massivecraft.factions.event.FactionsEventMembershipChange; import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason; import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.store.MStore;
public class CmdFactionsCreate extends FCommand public class CmdFactionsCreate extends FCommand
{ {
@ -54,7 +55,7 @@ public class CmdFactionsCreate extends FCommand
} }
// Pre-Generate Id // Pre-Generate Id
String factionId = coll.getIdStrategy().generate(coll); String factionId = MStore.createId();
// Event // Event
FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName); FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName);

View File

@ -47,7 +47,7 @@ public class CmdFactionsPerm extends FCommand
FPerm perm = this.arg(1, ARFPerm.get()); FPerm perm = this.arg(1, ARFPerm.get());
if (perm == null) return; if (perm == null) return;
System.out.println("perm = "+perm); //System.out.println("perm = "+perm);
if ( ! this.argIsSet(2)) if ( ! this.argIsSet(2))
{ {
@ -73,7 +73,7 @@ public class CmdFactionsPerm extends FCommand
if (val == null) return; if (val == null) return;
// Do the change // 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); 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. // The following is to make sure the leader always has the right to change perms if that is our goal.

View File

@ -12,9 +12,9 @@ import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.RelationParticipator;
import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.TerritoryAccess;
import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.ps.PS; import com.massivecraft.mcore.ps.PS;
import com.massivecraft.mcore.ps.PSBuilder; import com.massivecraft.mcore.ps.PSBuilder;
import com.massivecraft.mcore.usys.Aspect;
import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.util.DiscUtil;
import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken;

View File

@ -22,7 +22,6 @@ import com.massivecraft.mcore.ps.PS;
import com.massivecraft.mcore.store.Entity; import com.massivecraft.mcore.store.Entity;
import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.MUtil;
import com.massivecraft.mcore.util.SenderUtil; import com.massivecraft.mcore.util.SenderUtil;
import com.massivecraft.mcore.xlib.gson.reflect.TypeToken;
public class Faction extends Entity<Faction> implements EconomyParticipator public class Faction extends Entity<Faction> implements EconomyParticipator
@ -661,8 +660,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
} }
} }
System.out.println("setPerms target:"); //System.out.println("setPerms target:");
System.out.println(Factions.get().gson.toJson(target, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType())); //System.out.println(Factions.get().gson.toJson(target, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
// Detect Nochange // Detect Nochange
if (MUtil.equals(this.perms, target)) return; if (MUtil.equals(this.perms, target)) return;
@ -699,8 +698,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
{ {
Map<FPerm, Set<Rel>> perms = this.getPerms(); Map<FPerm, Set<Rel>> perms = this.getPerms();
System.out.println("setRelationPermitted before:"); //System.out.println("setRelationPermitted before:");
System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType())); //System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
Set<Rel> rels = perms.get(perm); Set<Rel> rels = perms.get(perm);
@ -713,8 +712,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
rels.remove(rel); rels.remove(rel);
} }
System.out.println("setRelationPermitted after:"); //System.out.println("setRelationPermitted after:");
System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType())); //System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
this.setPerms(perms); this.setPerms(perms);
} }

View File

@ -8,8 +8,8 @@ import java.util.Set;
import com.massivecraft.factions.Const; import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.usys.Aspect;
import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.util.DiscUtil;
import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.MUtil;
import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken;

View File

@ -2,8 +2,8 @@ package com.massivecraft.factions.entity;
import com.massivecraft.factions.Const; import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.usys.Aspect;
public class UConfColls extends XColls<UConfColl, UConf> public class UConfColls extends XColls<UConfColl, UConf>
{ {

View File

@ -7,8 +7,8 @@ import java.util.Map.Entry;
import com.massivecraft.factions.Const; import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.usys.Aspect;
import com.massivecraft.mcore.util.DiscUtil; import com.massivecraft.mcore.util.DiscUtil;
import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken;

View File

@ -650,15 +650,6 @@ public class FactionsListenerMain implements Listener
// If the faction at the block has firespread disabled ... // If the faction at the block has firespread disabled ...
PS ps = PS.valueOf(block); PS ps = PS.valueOf(block);
Faction faction = BoardColls.get().getFactionAt(ps); 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; if (faction.getFlag(FFlag.FIRESPREAD)) return;