Moved Faction entity to useage of MStore as well.

This commit is contained in:
Olof Larsson
2013-04-12 09:47:43 +02:00
parent 76f3f044ca
commit 3036b0a157
24 changed files with 265 additions and 904 deletions

View File

@ -1,13 +1,10 @@
package com.massivecraft.factions.event;
import org.bukkit.entity.Player;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FactionColl;
public class FactionCreateEvent extends Event implements Cancellable
{
// -------------------------------------------- //
@ -22,36 +19,30 @@ public class FactionCreateEvent extends Event implements Cancellable
// FIELDS
// -------------------------------------------- //
private boolean cancelled;
private boolean cancelled = false;
@Override public boolean isCancelled() { return this.cancelled; }
@Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; }
// TODO: Could the fields be reorganized to achieve symmetry?
private final CommandSender sender;
public CommandSender getSender() { return this.sender; }
// TODO: How do we know what universe? Should we perhaps actually create the faction?
private String factionTag;
public String getFactionTag() { return this.factionTag; }
private Player sender;
public FPlayer getFPlayer()
{
return FPlayer.get(this.sender);
}
public String getFactionId()
{
return FactionColl.i.getNextId();
}
private String factionId;
public String getFactionId() { return this.factionId; }
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public FactionCreateEvent(Player sender, String tag)
public FactionCreateEvent(CommandSender sender, String factionTag, String factionId)
{
this.cancelled = false;
this.factionTag = tag;
this.sender = sender;
this.factionTag = factionTag;
this.factionId = factionId;
}
}

View File

@ -34,7 +34,7 @@ public class FactionDisbandEvent extends Event implements Cancellable
public Faction getFaction()
{
return FactionColl.i.get(id);
return FactionColl.get().get(id);
}
public FPlayer getFPlayer()