Remove Maven
This commit is contained in:
@ -1,21 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import com.massivecraft.massivecore.event.EventMassiveCore;
|
||||
|
||||
public abstract class EventFactionsAbstract extends EventMassiveCore
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsAbstract()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EventFactionsAbstract(boolean isAsync)
|
||||
{
|
||||
super(isAsync);
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.event.EventMassiveCore;
|
||||
|
||||
public abstract class EventFactionsAbstractSender extends EventMassiveCore
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final CommandSender sender;
|
||||
public CommandSender getSender() { return this.sender; }
|
||||
public MPlayer getMSender() { return this.sender == null ? null : MPlayer.get(this.sender); }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsAbstractSender(CommandSender sender)
|
||||
{
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
public EventFactionsAbstractSender(boolean async, CommandSender sender)
|
||||
{
|
||||
super(async);
|
||||
this.sender = sender;
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public enum EventFactionsChunkChangeType
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// ENUM
|
||||
// -------------------------------------------- //
|
||||
|
||||
NONE("none", "none"),
|
||||
BUY("buy", "bought"),
|
||||
SELL("sell", "sold"),
|
||||
CONQUER("conquer", "conquered"),
|
||||
PILLAGE("pillage", "pillaged"),
|
||||
|
||||
// END OF LIST
|
||||
;
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
public final String now;
|
||||
public final String past;
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
EventFactionsChunkChangeType(String now, String past)
|
||||
{
|
||||
this.now = now;
|
||||
this.past = past;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static EventFactionsChunkChangeType get(Faction oldFaction, Faction newFaction, Faction self)
|
||||
{
|
||||
if (newFaction == oldFaction) return NONE;
|
||||
if (oldFaction.isNone()) return BUY;
|
||||
if (newFaction.isNormal()) return CONQUER;
|
||||
if (oldFaction == self) return SELL;
|
||||
return PILLAGE;
|
||||
}
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.massivecraft.massivecore.util.MUtil;
|
||||
|
||||
public class EventFactionsChunksChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Set<PS> chunks;
|
||||
public Set<PS> getChunks() { return this.chunks; }
|
||||
|
||||
private final Faction newFaction;
|
||||
public Faction getNewFaction() { return this.newFaction; }
|
||||
|
||||
private final Map<PS, Faction> oldChunkFaction;
|
||||
public Map<PS, Faction> getOldChunkFaction() { return this.oldChunkFaction; }
|
||||
|
||||
private final Map<Faction, Set<PS>> oldFactionChunks;
|
||||
public Map<Faction, Set<PS>> getOldFactionChunks() { return this.oldFactionChunks; }
|
||||
|
||||
private final Map<PS, EventFactionsChunkChangeType> chunkType;
|
||||
public Map<PS, EventFactionsChunkChangeType> getChunkType() { return this.chunkType; }
|
||||
|
||||
private final Map<EventFactionsChunkChangeType, Set<PS>> typeChunks;
|
||||
public Map<EventFactionsChunkChangeType, Set<PS>> getTypeChunks() { return this.typeChunks; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsChunksChange(CommandSender sender, Set<PS> chunks, Faction newFaction)
|
||||
{
|
||||
super(sender);
|
||||
chunks = PS.getDistinctChunks(chunks);
|
||||
this.chunks = Collections.unmodifiableSet(chunks);
|
||||
this.newFaction = newFaction;
|
||||
this.oldChunkFaction = Collections.unmodifiableMap(BoardColl.getChunkFaction(chunks));
|
||||
this.oldFactionChunks = Collections.unmodifiableMap(MUtil.reverseIndex(this.oldChunkFaction));
|
||||
|
||||
MPlayer msender = this.getMSender();
|
||||
Faction self = null;
|
||||
if (msender != null) self = msender.getFaction();
|
||||
Map<PS, EventFactionsChunkChangeType> currentChunkType = new LinkedHashMap<PS, EventFactionsChunkChangeType>();
|
||||
for (Entry<PS, Faction> entry : this.oldChunkFaction.entrySet())
|
||||
{
|
||||
PS chunk = entry.getKey();
|
||||
Faction from = entry.getValue();
|
||||
currentChunkType.put(chunk, EventFactionsChunkChangeType.get(from, newFaction, self));
|
||||
}
|
||||
|
||||
this.chunkType = Collections.unmodifiableMap(currentChunkType);
|
||||
this.typeChunks = Collections.unmodifiableMap(MUtil.reverseIndex(this.chunkType));
|
||||
}
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class EventFactionsCreate extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final String factionId;
|
||||
public final String getFactionId() { return this.factionId; }
|
||||
|
||||
private final String factionName;
|
||||
public final String getFactionName() { return this.factionName; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsCreate(CommandSender sender, String factionId, String factionName)
|
||||
{
|
||||
super(sender);
|
||||
this.factionId = factionId;
|
||||
this.factionName = factionName;
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* External plugins that add Faction flags should make sure they exist when this event is called.
|
||||
*/
|
||||
public class EventFactionsCreateFlags extends EventFactionsAbstract
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsCreateFlags()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EventFactionsCreateFlags(boolean isAsync)
|
||||
{
|
||||
super(isAsync);
|
||||
}
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* External plugins that add Faction perms should make sure they exist when this event is called.
|
||||
*/
|
||||
public class EventFactionsCreatePerms extends EventFactionsAbstract
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public class EventFactionsDescriptionChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private String newDescription;
|
||||
public String getNewDescription() { return this.newDescription; }
|
||||
public void setNewDescription(String newDescription) { this.newDescription = newDescription; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsDescriptionChange(CommandSender sender, Faction faction, String newDescription)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.newDescription = newDescription;
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public class EventFactionsDisband extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private final String factionId;
|
||||
public String getFactionId() { return this.factionId; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsDisband(CommandSender sender, Faction faction)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.factionId = faction.getId();
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.massivecore.CaseInsensitiveComparator;
|
||||
import com.massivecraft.massivecore.collections.MassiveTreeMap;
|
||||
|
||||
public class EventFactionsExpansions extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final MassiveTreeMap<String, Boolean, CaseInsensitiveComparator> expansions = new MassiveTreeMap<String, Boolean, CaseInsensitiveComparator>(CaseInsensitiveComparator.get());
|
||||
public Map<String, Boolean> getExpansions() { return this.expansions; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsExpansions(CommandSender sender)
|
||||
{
|
||||
super(sender);
|
||||
this.getExpansions().put("FactionsTax", false);
|
||||
this.getExpansions().put("FactionsDynmap", false);
|
||||
}
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.PriorityLines;
|
||||
|
||||
public class EventFactionsFactionShowAsync extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private final Map<String, PriorityLines> idPriorityLiness;
|
||||
public Map<String, PriorityLines> getIdPriorityLiness() { return this.idPriorityLiness; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsFactionShowAsync(CommandSender sender, Faction faction)
|
||||
{
|
||||
super(true, sender);
|
||||
this.faction = faction;
|
||||
this.idPriorityLiness = new HashMap<String, PriorityLines>();
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MFlag;
|
||||
|
||||
public class EventFactionsFlagChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private final MFlag flag;
|
||||
public MFlag getFlag() { return this.flag; }
|
||||
|
||||
private boolean newValue;
|
||||
public boolean isNewValue() { return this.newValue; }
|
||||
public void setNewValue(boolean newValue) { this.newValue = newValue; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsFlagChange(CommandSender sender, Faction faction, MFlag flag, boolean newValue)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.flag = flag;
|
||||
this.newValue = newValue;
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
|
||||
public class EventFactionsHomeChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private PS newHome;
|
||||
public PS getNewHome() { return this.newHome; }
|
||||
public void setNewHome(PS newHome) { this.newHome = newHome; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsHomeChange(CommandSender sender, Faction faction, PS newHome)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.newHome = newHome;
|
||||
}
|
||||
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class EventFactionsHomeTeleport extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsHomeTeleport(CommandSender sender)
|
||||
{
|
||||
super(sender);
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public class EventFactionsInvitedChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final MPlayer mplayer;
|
||||
public MPlayer getMPlayer() { return this.mplayer; }
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private boolean newInvited;
|
||||
public boolean isNewInvited() { return this.newInvited; }
|
||||
public void setNewInvited(boolean newInvited) { this.newInvited = newInvited; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsInvitedChange(CommandSender sender, MPlayer mplayer, Faction faction, boolean newInvited)
|
||||
{
|
||||
super(sender);
|
||||
this.mplayer = mplayer;
|
||||
this.faction = faction;
|
||||
this.newInvited = newInvited;
|
||||
}
|
||||
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public class EventFactionsMembershipChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled)
|
||||
{
|
||||
if (!this.reason.isCancellable()) cancelled = false;
|
||||
super.setCancelled(cancelled);
|
||||
}
|
||||
|
||||
private final MPlayer mplayer;
|
||||
public MPlayer getMPlayer() { return this.mplayer; }
|
||||
|
||||
private final Faction newFaction;
|
||||
public Faction getNewFaction() { return this.newFaction; }
|
||||
|
||||
private final MembershipChangeReason reason;
|
||||
public MembershipChangeReason getReason() { return this.reason; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsMembershipChange(CommandSender sender, MPlayer mplayer, Faction newFaction, MembershipChangeReason reason)
|
||||
{
|
||||
super(sender);
|
||||
this.mplayer = mplayer;
|
||||
this.newFaction = newFaction;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// REASON ENUM
|
||||
// -------------------------------------------- //
|
||||
|
||||
public enum MembershipChangeReason
|
||||
{
|
||||
// Join
|
||||
JOIN (true),
|
||||
CREATE (false),
|
||||
LEADER (true),
|
||||
|
||||
// Leave
|
||||
LEAVE (true),
|
||||
//JOINOTHER (true),
|
||||
KICK (true),
|
||||
DISBAND (false),
|
||||
//RESET (false),
|
||||
;
|
||||
|
||||
private final boolean cancellable;
|
||||
public boolean isCancellable() { return this.cancellable; }
|
||||
|
||||
private MembershipChangeReason(boolean cancellable)
|
||||
{
|
||||
this.cancellable = cancellable;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public class EventFactionsMotdChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private String newMotd;
|
||||
public String getNewMotd() { return this.newMotd; }
|
||||
public void setNewMotd(String newMotd) { this.newMotd = newMotd; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsMotdChange(CommandSender sender, Faction faction, String newMotd)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.newMotd = newMotd;
|
||||
}
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
public class EventFactionsNameChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private String newName;
|
||||
public String getNewName() { return this.newName; }
|
||||
public void setNewName(String newName) { this.newName = newName; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsNameChange(CommandSender sender, Faction faction, String newName)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.newName = newName;
|
||||
}
|
||||
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
|
||||
public class EventFactionsPowerChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final MPlayer mplayer;
|
||||
public MPlayer getMPlayer() { return this.mplayer; }
|
||||
|
||||
private final PowerChangeReason reason;
|
||||
public PowerChangeReason getReason() { return this.reason; }
|
||||
|
||||
private double newPower;
|
||||
public double getNewPower() { return this.newPower; }
|
||||
public void setNewPower(double newPower) { this.newPower = newPower; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsPowerChange(CommandSender sender, MPlayer mplayer, PowerChangeReason reason, double newPower)
|
||||
{
|
||||
super(sender);
|
||||
this.mplayer = mplayer;
|
||||
this.reason = reason;
|
||||
this.newPower = mplayer.getLimitedPower(newPower);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// REASON ENUM
|
||||
// -------------------------------------------- //
|
||||
|
||||
public enum PowerChangeReason
|
||||
{
|
||||
TIME,
|
||||
DEATH,
|
||||
UNDEFINED,
|
||||
;
|
||||
}
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
|
||||
/**
|
||||
* This event is fired when PVP is disallowed between players due to any rules in Factions.
|
||||
* Canceling this event allows the PVP in spite of this and stops text messages from being sent.
|
||||
*
|
||||
* Note that the defender field always is set but the attacker can be null.
|
||||
* Some other plugins seem to fire EntityDamageByEntityEvent without an attacker.
|
||||
*/
|
||||
public class EventFactionsPvpDisallowed extends EventFactionsAbstract
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Player attacker;
|
||||
public Player getAttacker() { return this.attacker; }
|
||||
public MPlayer getMAttacker() { return this.attacker == null ? null : MPlayer.get(this.attacker); }
|
||||
|
||||
private final Player defender;
|
||||
public Player getDefender() { return this.defender; }
|
||||
public MPlayer getMDefender() { return this.defender == null ? null : MPlayer.get(this.defender); }
|
||||
|
||||
private final EntityDamageByEntityEvent event;
|
||||
public EntityDamageByEntityEvent getEvent() { return this.event; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsPvpDisallowed(Player attacker, Player defender, EntityDamageByEntityEvent event)
|
||||
{
|
||||
this.attacker = attacker;
|
||||
this.defender = defender;
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
|
||||
public class EventFactionsRankChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final MPlayer mplayer;
|
||||
public MPlayer getMPlayer() { return this.mplayer; }
|
||||
|
||||
private Rel newRank;
|
||||
public Rel getNewRank() { return this.newRank; }
|
||||
public void setNewRank(Rel newRole) { this.newRank = newRole; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsRankChange(CommandSender sender, MPlayer mplayer, Rel newRank)
|
||||
{
|
||||
super(sender);
|
||||
this.mplayer = mplayer;
|
||||
this.newRank = newRank;
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.Rel;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
|
||||
|
||||
public class EventFactionsRelationChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Faction faction;
|
||||
public Faction getFaction() { return this.faction; }
|
||||
|
||||
private final Faction otherFaction;
|
||||
public Faction getOtherFaction() { return this.otherFaction; }
|
||||
|
||||
private Rel newRelation;
|
||||
public Rel getNewRelation() { return this.newRelation; }
|
||||
public void setNewRelation(Rel newRelation) { this.newRelation = newRelation; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsRelationChange(CommandSender sender, Faction faction, Faction otherFaction, Rel newRelation)
|
||||
{
|
||||
super(sender);
|
||||
this.faction = faction;
|
||||
this.otherFaction = otherFaction;
|
||||
this.newRelation = newRelation;
|
||||
}
|
||||
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MConf;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.event.EventMassiveCore;
|
||||
|
||||
public class EventFactionsRemovePlayerMillis extends EventMassiveCore
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELD
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final MPlayer mplayer;
|
||||
public MPlayer getMPlayer() { return this.mplayer; }
|
||||
|
||||
private long millis;
|
||||
public long getMillis() { return this.millis; }
|
||||
public void setMillis(long millis) { this.millis = millis; }
|
||||
|
||||
private Map<String, Long> causeMillis = new LinkedHashMap<String, Long>();
|
||||
public Map<String, Long> getCauseMillis() { return this.causeMillis; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsRemovePlayerMillis(boolean async, MPlayer mplayer)
|
||||
{
|
||||
super(async);
|
||||
|
||||
this.mplayer = mplayer;
|
||||
this.millis = MConf.get().removePlayerMillisDefault;
|
||||
|
||||
// Default
|
||||
this.causeMillis.put("Default", MConf.get().removePlayerMillisDefault);
|
||||
|
||||
// Player Age Bonus
|
||||
this.applyPlayerAgeBonus();
|
||||
|
||||
// Faction Age Bonus
|
||||
this.applyFactionAgeBonus();
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
|
||||
public void applyPlayerAgeBonus()
|
||||
{
|
||||
// Skip if this bonus is totally disabled.
|
||||
// We don't want it showing up with 0 for everyone.
|
||||
if (MConf.get().removePlayerMillisPlayerAgeToBonus.isEmpty()) return;
|
||||
|
||||
// Calculate First Played
|
||||
Long firstPlayed = this.getMPlayer().getFirstPlayed();
|
||||
Long age = 0L;
|
||||
if (firstPlayed != null)
|
||||
{
|
||||
age = System.currentTimeMillis() - firstPlayed;
|
||||
}
|
||||
|
||||
// Calculate the Bonus!
|
||||
long bonus = 0;
|
||||
for (Entry<Long, Long> entry : MConf.get().removePlayerMillisPlayerAgeToBonus.entrySet())
|
||||
{
|
||||
Long key = entry.getKey();
|
||||
if (key == null) continue;
|
||||
|
||||
Long value = entry.getValue();
|
||||
if (value == null) continue;
|
||||
|
||||
if (age >= key)
|
||||
{
|
||||
bonus = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply
|
||||
this.setMillis(this.getMillis() + bonus);
|
||||
|
||||
// Inform
|
||||
this.getCauseMillis().put("Player Age Bonus", bonus);
|
||||
}
|
||||
|
||||
public void applyFactionAgeBonus()
|
||||
{
|
||||
// Skip if this bonus is totally disabled.
|
||||
// We don't want it showing up with 0 for everyone.
|
||||
if (MConf.get().removePlayerMillisFactionAgeToBonus.isEmpty()) return;
|
||||
|
||||
// Calculate Faction Age
|
||||
Faction faction = this.getMPlayer().getFaction();
|
||||
long age = 0;
|
||||
if ( ! faction.isNone())
|
||||
{
|
||||
age = System.currentTimeMillis() - faction.getCreatedAtMillis();
|
||||
}
|
||||
|
||||
// Calculate the Bonus!
|
||||
long bonus = 0;
|
||||
for (Entry<Long, Long> entry : MConf.get().removePlayerMillisFactionAgeToBonus.entrySet())
|
||||
{
|
||||
Long key = entry.getKey();
|
||||
if (key == null) continue;
|
||||
|
||||
Long value = entry.getValue();
|
||||
if (value == null) continue;
|
||||
|
||||
if (age >= key)
|
||||
{
|
||||
bonus = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply
|
||||
this.setMillis(this.getMillis() + bonus);
|
||||
|
||||
// Inform
|
||||
this.getCauseMillis().put("Faction Age Bonus", bonus);
|
||||
}
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
|
||||
public class EventFactionsTitleChange extends EventFactionsAbstractSender
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final MPlayer mplayer;
|
||||
public MPlayer getMPlayer() { return this.mplayer; }
|
||||
|
||||
private String newTitle;
|
||||
public String getNewTitle() { return this.newTitle; }
|
||||
public void setNewTitle(String newTitle) { this.newTitle = newTitle; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CONSTRUCT
|
||||
// -------------------------------------------- //
|
||||
|
||||
public EventFactionsTitleChange(CommandSender sender, MPlayer mplayer, String newTitle)
|
||||
{
|
||||
super(sender);
|
||||
this.mplayer = mplayer;
|
||||
this.newTitle = newTitle;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user