MCore changes
This commit is contained in:
parent
cf03bd5b8a
commit
7c10a6c83f
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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<Faction> implements EconomyParticipator
|
||||
@ -661,8 +660,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("setPerms target:");
|
||||
System.out.println(Factions.get().gson.toJson(target, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
//System.out.println("setPerms target:");
|
||||
//System.out.println(Factions.get().gson.toJson(target, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
|
||||
// Detect Nochange
|
||||
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();
|
||||
|
||||
System.out.println("setRelationPermitted before:");
|
||||
System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
//System.out.println("setRelationPermitted before:");
|
||||
//System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
|
||||
Set<Rel> rels = perms.get(perm);
|
||||
|
||||
@ -713,8 +712,8 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
rels.remove(rel);
|
||||
}
|
||||
|
||||
System.out.println("setRelationPermitted after:");
|
||||
System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
//System.out.println("setRelationPermitted after:");
|
||||
//System.out.println(Factions.get().gson.toJson(perms, new TypeToken<Map<FPerm, Set<Rel>>>(){}.getType()));
|
||||
|
||||
this.setPerms(perms);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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<UConfColl, UConf>
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
@ -651,15 +651,6 @@ public class FactionsListenerMain implements Listener
|
||||
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;
|
||||
|
||||
// then cancel the event.
|
||||
|
Loading…
Reference in New Issue
Block a user