Event first

This commit is contained in:
Olof Larsson 2014-06-04 16:47:01 +02:00
parent e43f63cf59
commit 56768aca55
38 changed files with 134 additions and 134 deletions

View File

@ -13,9 +13,9 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.event.FactionsEventCreate;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsCreate;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.store.MStore;
@ -69,7 +69,7 @@ public class CmdFactionsCreate extends FCommand
String factionId = MStore.createId();
// Event
FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName);
EventFactionsCreate createEvent = new EventFactionsCreate(sender, coll.getUniverse(), factionId, newName);
createEvent.run();
if (createEvent.isCancelled()) return;
@ -80,7 +80,7 @@ public class CmdFactionsCreate extends FCommand
usender.setRole(Rel.LEADER);
usender.setFaction(faction);
FactionsEventMembershipChange joinEvent = new FactionsEventMembershipChange(sender, usender, faction, MembershipChangeReason.CREATE);
EventFactionsMembershipChange joinEvent = new EventFactionsMembershipChange(sender, usender, faction, MembershipChangeReason.CREATE);
joinEvent.run();
// NOTE: join event cannot be cancelled or you'll have an empty faction

View File

@ -5,7 +5,7 @@ import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.event.FactionsEventDescriptionChange;
import com.massivecraft.factions.event.EventFactionsDescriptionChange;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.mixin.Mixin;
@ -42,7 +42,7 @@ public class CmdFactionsDescription extends FCommand
String newDescription = this.argConcatFrom(0);
// Event
FactionsEventDescriptionChange event = new FactionsEventDescriptionChange(sender, usenderFaction, newDescription);
EventFactionsDescriptionChange event = new EventFactionsDescriptionChange(sender, usenderFaction, newDescription);
event.run();
if (event.isCancelled()) return;
newDescription = event.getNewDescription();

View File

@ -7,9 +7,9 @@ import com.massivecraft.factions.entity.UPlayerColls;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.event.FactionsEventDisband;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsDisband;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.FPerm;
import com.massivecraft.factions.Factions;
@ -58,7 +58,7 @@ public class CmdFactionsDisband extends FCommand
}
// Event
FactionsEventDisband event = new FactionsEventDisband(me, faction);
EventFactionsDisband event = new EventFactionsDisband(me, faction);
event.run();
if (event.isCancelled()) return;
@ -67,7 +67,7 @@ public class CmdFactionsDisband extends FCommand
// Run event for each player in the faction
for (UPlayer uplayer : faction.getUPlayers())
{
FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, uplayer, FactionColls.get().get(faction).getNone(), MembershipChangeReason.DISBAND);
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, uplayer, FactionColls.get().get(faction).getNone(), MembershipChangeReason.DISBAND);
membershipChangeEvent.run();
}

View File

@ -11,7 +11,7 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.event.FactionsEventChunkChangeType;
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.Perm;
@ -86,7 +86,7 @@ public class CmdFactionsFaction extends FCommand
{
long landCount = faction.getLandCount();
for (FactionsEventChunkChangeType type : FactionsEventChunkChangeType.values())
for (EventFactionsChunkChangeType type : EventFactionsChunkChangeType.values())
{
Double money = uconf.econChunkCost.get(type);
if (money == null) continue;

View File

@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.BoardColls;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.event.FactionsEventHomeTeleport;
import com.massivecraft.factions.event.EventFactionsHomeTeleport;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
import com.massivecraft.massivecore.mixin.Mixin;
@ -133,7 +133,7 @@ public class CmdFactionsHome extends FCommand
}
// Event
FactionsEventHomeTeleport event = new FactionsEventHomeTeleport(sender);
EventFactionsHomeTeleport event = new EventFactionsHomeTeleport(sender);
event.run();
if (event.isCancelled()) return;

View File

@ -7,7 +7,7 @@ import com.massivecraft.factions.cmd.arg.ARUPlayer;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.event.FactionsEventInvitedChange;
import com.massivecraft.factions.event.EventFactionsInvitedChange;
import com.massivecraft.massivecore.cmd.arg.ARBoolean;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
@ -60,7 +60,7 @@ public class CmdFactionsInvite extends FCommand
if ( ! FPerm.INVITE.has(usender, usenderFaction, true)) return;
// Event
FactionsEventInvitedChange event = new FactionsEventInvitedChange(sender, uplayer, usenderFaction, newInvited);
EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, uplayer, usenderFaction, newInvited);
event.run();
if (event.isCancelled()) return;
newInvited = event.isNewInvited();

View File

@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.util.Txt;
@ -93,7 +93,7 @@ public class CmdFactionsJoin extends FCommand
}
// Event
FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, usender, faction, MembershipChangeReason.JOIN);
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, usender, faction, MembershipChangeReason.JOIN);
membershipChangeEvent.run();
if (membershipChangeEvent.isCancelled()) return;

View File

@ -11,8 +11,8 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
public class CmdFactionsKick extends FCommand
@ -70,7 +70,7 @@ public class CmdFactionsKick extends FCommand
if (!FPerm.KICK.has(usender, uplayerFaction, true)) return;
// Event
FactionsEventMembershipChange event = new FactionsEventMembershipChange(sender, uplayer, FactionColls.get().get(uplayer).getNone(), MembershipChangeReason.KICK);
EventFactionsMembershipChange event = new EventFactionsMembershipChange(sender, uplayer, FactionColls.get().get(uplayer).getNone(), MembershipChangeReason.KICK);
event.run();
if (event.isCancelled()) return;

View File

@ -8,8 +8,8 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.UPlayerColls;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.util.RelationUtil;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.util.Txt;
@ -78,7 +78,7 @@ public class CmdFactionsLeader extends FCommand
// only run event when newLeader isn't actually in the faction
if (newLeader.getFaction() != targetFaction)
{
FactionsEventMembershipChange event = new FactionsEventMembershipChange(sender, newLeader, targetFaction, MembershipChangeReason.LEADER);
EventFactionsMembershipChange event = new EventFactionsMembershipChange(sender, newLeader, targetFaction, MembershipChangeReason.LEADER);
event.run();
if (event.isCancelled()) return;
}

View File

@ -11,7 +11,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.event.FactionsEventNameChange;
import com.massivecraft.factions.event.EventFactionsNameChange;
import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
@ -64,7 +64,7 @@ public class CmdFactionsName extends FCommand
}
// Event
FactionsEventNameChange event = new FactionsEventNameChange(sender, usenderFaction, newName);
EventFactionsNameChange event = new EventFactionsNameChange(sender, usenderFaction, newName);
event.run();
if (event.isCancelled()) return;
newName = event.getNewName();

View File

@ -5,7 +5,7 @@ import com.massivecraft.factions.Rel;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.event.FactionsEventOpenChange;
import com.massivecraft.factions.event.EventFactionsOpenChange;
import com.massivecraft.massivecore.cmd.arg.ARBoolean;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
@ -42,7 +42,7 @@ public class CmdFactionsOpen extends FCommand
if (newOpen == null) return;
// Event
FactionsEventOpenChange event = new FactionsEventOpenChange(sender, usenderFaction, newOpen);
EventFactionsOpenChange event = new EventFactionsOpenChange(sender, usenderFaction, newOpen);
event.run();
if (event.isCancelled()) return;
newOpen = event.isNewOpen();

View File

@ -9,7 +9,7 @@ import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.event.FactionsEventRelationChange;
import com.massivecraft.factions.event.EventFactionsRelationChange;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
public abstract class CmdFactionsRelationAbstract extends FCommand
@ -66,7 +66,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand
}
// Event
FactionsEventRelationChange event = new FactionsEventRelationChange(sender, usenderFaction, otherFaction, newRelation);
EventFactionsRelationChange event = new EventFactionsRelationChange(sender, usenderFaction, otherFaction, newRelation);
event.run();
if (event.isCancelled()) return;
newRelation = event.getNewRelation();

View File

@ -7,7 +7,7 @@ import com.massivecraft.factions.cmd.arg.ARFaction;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.event.FactionsEventHomeChange;
import com.massivecraft.factions.event.EventFactionsHomeChange;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
import com.massivecraft.massivecore.ps.PS;
@ -63,7 +63,7 @@ public class CmdFactionsSethome extends FCommand
}
// Event
FactionsEventHomeChange event = new FactionsEventHomeChange(sender, faction, newHome);
EventFactionsHomeChange event = new EventFactionsHomeChange(sender, faction, newHome);
event.run();
if (event.isCancelled()) return;
newHome = event.getNewHome();

View File

@ -8,7 +8,7 @@ import com.massivecraft.factions.cmd.arg.ARUPlayer;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.event.FactionsEventTitleChange;
import com.massivecraft.factions.event.EventFactionsTitleChange;
import com.massivecraft.massivecore.cmd.arg.ARString;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.util.Txt;
@ -58,7 +58,7 @@ public class CmdFactionsTitle extends FCommand
if ( ! canIAdministerYou(usender, you)) return;
// Event
FactionsEventTitleChange event = new FactionsEventTitleChange(sender, you, newTitle);
EventFactionsTitleChange event = new EventFactionsTitleChange(sender, you, newTitle);
event.run();
if (event.isCancelled()) return;
newTitle = event.getNewTitle();

View File

@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.BoardColls;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.event.FactionsEventChunkChange;
import com.massivecraft.factions.event.EventFactionsChunkChange;
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
import com.massivecraft.massivecore.ps.PS;
@ -58,7 +58,7 @@ public class CmdFactionsUnclaimall extends FCommand
int countFail = 0;
for (PS chunk : chunks)
{
FactionsEventChunkChange event = new FactionsEventChunkChange(sender, chunk, newFaction);
EventFactionsChunkChange event = new EventFactionsChunkChange(sender, chunk, newFaction);
event.run();
if (event.isCancelled())
{

View File

@ -12,7 +12,7 @@ import org.bukkit.event.EventPriority;
import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.FPerm;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.event.FactionsEventChunkChangeType;
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
import com.massivecraft.massivecore.store.Entity;
import com.massivecraft.massivecore.store.SenderEntity;
import com.massivecraft.massivecore.util.MUtil;
@ -219,11 +219,11 @@ public class UConf extends Entity<UConf>
// INTEGRATION: LWC
// -------------------------------------------- //
public Map<FactionsEventChunkChangeType, Boolean> lwcRemoveOnChange = MUtil.map(
FactionsEventChunkChangeType.BUY, false,
FactionsEventChunkChangeType.SELL, false,
FactionsEventChunkChangeType.CONQUER, false,
FactionsEventChunkChangeType.PILLAGE, false
public Map<EventFactionsChunkChangeType, Boolean> lwcRemoveOnChange = MUtil.map(
EventFactionsChunkChangeType.BUY, false,
EventFactionsChunkChangeType.SELL, false,
EventFactionsChunkChangeType.CONQUER, false,
EventFactionsChunkChangeType.PILLAGE, false
);
// -------------------------------------------- //
@ -237,11 +237,11 @@ public class UConf extends Entity<UConf>
public String econUniverseAccount = "";
public Map<FactionsEventChunkChangeType, Double> econChunkCost = MUtil.map(
FactionsEventChunkChangeType.BUY, 30.0,
FactionsEventChunkChangeType.SELL, -20.0,
FactionsEventChunkChangeType.CONQUER, -10.0,
FactionsEventChunkChangeType.PILLAGE, -10.0
public Map<EventFactionsChunkChangeType, Double> econChunkCost = MUtil.map(
EventFactionsChunkChangeType.BUY, 30.0,
EventFactionsChunkChangeType.SELL, -20.0,
EventFactionsChunkChangeType.CONQUER, -10.0,
EventFactionsChunkChangeType.PILLAGE, -10.0
);
public double econCostCreate = 200.0;

View File

@ -13,9 +13,9 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Lang;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.RelationParticipator;
import com.massivecraft.factions.event.FactionsEventChunkChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsChunkChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.util.RelationUtil;
import com.massivecraft.massivecore.mixin.Mixin;
import com.massivecraft.massivecore.ps.PS;
@ -620,7 +620,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
}
// Event
FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(this.getSender(), this, myFaction, MembershipChangeReason.LEAVE);
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(this.getSender(), this, myFaction, MembershipChangeReason.LEAVE);
membershipChangeEvent.run();
if (membershipChangeEvent.isCancelled()) return;
@ -760,7 +760,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
}
// Event
FactionsEventChunkChange event = new FactionsEventChunkChange(sender, chunk, newFaction);
EventFactionsChunkChange event = new EventFactionsChunkChange(sender, chunk, newFaction);
event.run();
if (event.isCancelled()) return false;

View File

@ -2,7 +2,7 @@ package com.massivecraft.factions.event;
import com.massivecraft.massivecore.event.EventMassiveCore;
public abstract class FactionsEventAbstract extends EventMassiveCore
public abstract class EventFactionsAbstract extends EventMassiveCore
{
}

View File

@ -5,7 +5,7 @@ import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.massivecore.event.EventMassiveCore;
public abstract class FactionsEventAbstractSender extends EventMassiveCore
public abstract class EventFactionsAbstractSender extends EventMassiveCore
{
// -------------------------------------------- //
// FIELDS
@ -19,7 +19,7 @@ public abstract class FactionsEventAbstractSender extends EventMassiveCore
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventAbstractSender(CommandSender sender)
public EventFactionsAbstractSender(CommandSender sender)
{
this.sender = sender;
}

View File

@ -8,7 +8,7 @@ import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.massivecore.ps.PS;
public class FactionsEventChunkChange extends FactionsEventAbstractSender
public class EventFactionsChunkChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -33,7 +33,7 @@ public class FactionsEventChunkChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventChunkChange(CommandSender sender, PS chunk, Faction newFaction)
public EventFactionsChunkChange(CommandSender sender, PS chunk, Faction newFaction)
{
super(sender);
this.chunk = chunk.getChunk(true);
@ -45,15 +45,15 @@ public class FactionsEventChunkChange extends FactionsEventAbstractSender
// UTIL
// -------------------------------------------- //
public FactionsEventChunkChangeType getType()
public EventFactionsChunkChangeType getType()
{
if (currentFaction.isNone()) return FactionsEventChunkChangeType.BUY;
if (newFaction.isNormal()) return FactionsEventChunkChangeType.CONQUER;
if (currentFaction.isNone()) return EventFactionsChunkChangeType.BUY;
if (newFaction.isNormal()) return EventFactionsChunkChangeType.CONQUER;
UPlayer usender = this.getUSender();
if (usender != null && usender.getFaction() == currentFaction) return FactionsEventChunkChangeType.SELL;
if (usender != null && usender.getFaction() == currentFaction) return EventFactionsChunkChangeType.SELL;
return FactionsEventChunkChangeType.PILLAGE;
return EventFactionsChunkChangeType.PILLAGE;
}
}

View File

@ -1,6 +1,6 @@
package com.massivecraft.factions.event;
public enum FactionsEventChunkChangeType
public enum EventFactionsChunkChangeType
{
BUY,
SELL,

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.event;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList;
public class FactionsEventCreate extends FactionsEventAbstractSender
public class EventFactionsCreate extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -30,7 +30,7 @@ public class FactionsEventCreate extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventCreate(CommandSender sender, String universe, String factionId, String factionName)
public EventFactionsCreate(CommandSender sender, String universe, String factionId, String factionName)
{
super(sender);
this.universe = universe;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventDescriptionChange extends FactionsEventAbstractSender
public class EventFactionsDescriptionChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -30,7 +30,7 @@ public class FactionsEventDescriptionChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventDescriptionChange(CommandSender sender, Faction faction, String newDescription)
public EventFactionsDescriptionChange(CommandSender sender, Faction faction, String newDescription)
{
super(sender);
this.faction = faction;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventDisband extends FactionsEventAbstractSender
public class EventFactionsDisband extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -29,7 +29,7 @@ public class FactionsEventDisband extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventDisband(CommandSender sender, Faction faction)
public EventFactionsDisband(CommandSender sender, Faction faction)
{
super(sender);
this.faction = faction;

View File

@ -6,7 +6,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.massivecore.ps.PS;
public class FactionsEventHomeChange extends FactionsEventAbstractSender
public class EventFactionsHomeChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -31,7 +31,7 @@ public class FactionsEventHomeChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventHomeChange(CommandSender sender, Faction faction, PS newHome)
public EventFactionsHomeChange(CommandSender sender, Faction faction, PS newHome)
{
super(sender);
this.faction = faction;

View File

@ -3,7 +3,7 @@ package com.massivecraft.factions.event;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList;
public class FactionsEventHomeTeleport extends FactionsEventAbstractSender
public class EventFactionsHomeTeleport extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -17,7 +17,7 @@ public class FactionsEventHomeTeleport extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventHomeTeleport(CommandSender sender)
public EventFactionsHomeTeleport(CommandSender sender)
{
super(sender);
}

View File

@ -6,7 +6,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventInvitedChange extends FactionsEventAbstractSender
public class EventFactionsInvitedChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -34,7 +34,7 @@ public class FactionsEventInvitedChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventInvitedChange(CommandSender sender, UPlayer uplayer, Faction faction, boolean newInvited)
public EventFactionsInvitedChange(CommandSender sender, UPlayer uplayer, Faction faction, boolean newInvited)
{
super(sender);
this.uplayer = uplayer;

View File

@ -6,7 +6,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventMembershipChange extends FactionsEventAbstractSender
public class EventFactionsMembershipChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -40,7 +40,7 @@ public class FactionsEventMembershipChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventMembershipChange(CommandSender sender, UPlayer uplayer, Faction newFaction, MembershipChangeReason reason)
public EventFactionsMembershipChange(CommandSender sender, UPlayer uplayer, Faction newFaction, MembershipChangeReason reason)
{
super(sender);
this.uplayer = uplayer;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventNameChange extends FactionsEventAbstractSender
public class EventFactionsNameChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -30,7 +30,7 @@ public class FactionsEventNameChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventNameChange(CommandSender sender, Faction faction, String newName)
public EventFactionsNameChange(CommandSender sender, Faction faction, String newName)
{
super(sender);
this.faction = faction;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventOpenChange extends FactionsEventAbstractSender
public class EventFactionsOpenChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -30,7 +30,7 @@ public class FactionsEventOpenChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventOpenChange(CommandSender sender, Faction faction, boolean newOpen)
public EventFactionsOpenChange(CommandSender sender, Faction faction, boolean newOpen)
{
super(sender);
this.faction = faction;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.UPlayer;
public class FactionsEventPowerChange extends FactionsEventAbstractSender
public class EventFactionsPowerChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -33,7 +33,7 @@ public class FactionsEventPowerChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventPowerChange(CommandSender sender, UPlayer uplayer, PowerChangeReason reason, double newPower)
public EventFactionsPowerChange(CommandSender sender, UPlayer uplayer, PowerChangeReason reason, double newPower)
{
super(sender);
this.uplayer = uplayer;

View File

@ -13,7 +13,7 @@ import com.massivecraft.factions.entity.UPlayer;
* 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 FactionsEventPvpDisallowed extends FactionsEventAbstract
public class EventFactionsPvpDisallowed extends EventFactionsAbstract
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -42,7 +42,7 @@ public class FactionsEventPvpDisallowed extends FactionsEventAbstract
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventPvpDisallowed(Player attacker, Player defender, EntityDamageByEntityEvent event)
public EventFactionsPvpDisallowed(Player attacker, Player defender, EntityDamageByEntityEvent event)
{
this.attacker = attacker;
this.defender = defender;

View File

@ -7,7 +7,7 @@ import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.Faction;
public class FactionsEventRelationChange extends FactionsEventAbstractSender
public class EventFactionsRelationChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -35,7 +35,7 @@ public class FactionsEventRelationChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventRelationChange(CommandSender sender, Faction faction, Faction otherFaction, Rel newRelation)
public EventFactionsRelationChange(CommandSender sender, Faction faction, Faction otherFaction, Rel newRelation)
{
super(sender);
this.faction = faction;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
import com.massivecraft.factions.entity.UPlayer;
public class FactionsEventTitleChange extends FactionsEventAbstractSender
public class EventFactionsTitleChange extends EventFactionsAbstractSender
{
// -------------------------------------------- //
// REQUIRED EVENT CODE
@ -30,7 +30,7 @@ public class FactionsEventTitleChange extends FactionsEventAbstractSender
// CONSTRUCT
// -------------------------------------------- //
public FactionsEventTitleChange(CommandSender sender, UPlayer uplayer, String newTitle)
public EventFactionsTitleChange(CommandSender sender, UPlayer uplayer, String newTitle)
{
super(sender);
this.uplayer = uplayer;

View File

@ -19,8 +19,8 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.event.FactionsEventChunkChange;
import com.massivecraft.factions.event.FactionsEventChunkChangeType;
import com.massivecraft.factions.event.EventFactionsChunkChange;
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
import com.massivecraft.massivecore.ps.PS;
@ -53,12 +53,12 @@ public class EngineLwc implements Listener
// -------------------------------------------- //
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void removeProtectionsOnChunkChange(FactionsEventChunkChange event)
public void removeProtectionsOnChunkChange(EventFactionsChunkChange event)
{
// If we are supposed to clear at this chunk change type ...
Faction newFaction = event.getNewFaction();
UConf uconf = UConf.get(newFaction);
FactionsEventChunkChangeType type = event.getType();
EventFactionsChunkChangeType type = event.getType();
Boolean remove = uconf.lwcRemoveOnChange.get(type);
if (remove == null) return;
if (remove == false) return;

View File

@ -9,21 +9,21 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.event.FactionsEventAbstractSender;
import com.massivecraft.factions.event.FactionsEventChunkChange;
import com.massivecraft.factions.event.FactionsEventChunkChangeType;
import com.massivecraft.factions.event.FactionsEventCreate;
import com.massivecraft.factions.event.FactionsEventDescriptionChange;
import com.massivecraft.factions.event.FactionsEventDisband;
import com.massivecraft.factions.event.FactionsEventHomeChange;
import com.massivecraft.factions.event.FactionsEventHomeTeleport;
import com.massivecraft.factions.event.FactionsEventInvitedChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange;
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.FactionsEventOpenChange;
import com.massivecraft.factions.event.FactionsEventRelationChange;
import com.massivecraft.factions.event.FactionsEventNameChange;
import com.massivecraft.factions.event.FactionsEventTitleChange;
import com.massivecraft.factions.event.EventFactionsAbstractSender;
import com.massivecraft.factions.event.EventFactionsChunkChange;
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
import com.massivecraft.factions.event.EventFactionsCreate;
import com.massivecraft.factions.event.EventFactionsDescriptionChange;
import com.massivecraft.factions.event.EventFactionsDisband;
import com.massivecraft.factions.event.EventFactionsHomeChange;
import com.massivecraft.factions.event.EventFactionsHomeTeleport;
import com.massivecraft.factions.event.EventFactionsInvitedChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange;
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
import com.massivecraft.factions.event.EventFactionsNameChange;
import com.massivecraft.factions.event.EventFactionsOpenChange;
import com.massivecraft.factions.event.EventFactionsRelationChange;
import com.massivecraft.factions.event.EventFactionsTitleChange;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.massivecore.money.Money;
@ -51,7 +51,7 @@ public class FactionsListenerEcon implements Listener
// -------------------------------------------- //
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void takeOnLeave(FactionsEventMembershipChange event)
public void takeOnLeave(EventFactionsMembershipChange event)
{
// If a player is leaving the faction ...
if (event.getReason() != MembershipChangeReason.LEAVE) return;
@ -70,7 +70,7 @@ public class FactionsListenerEcon implements Listener
// -------------------------------------------- //
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void takeOnDisband(FactionsEventDisband event)
public void takeOnDisband(EventFactionsDisband event)
{
// If there is a usender ...
UPlayer usender = event.getUSender();
@ -95,7 +95,7 @@ public class FactionsListenerEcon implements Listener
// PAY FOR ACTION
// -------------------------------------------- //
public static void payForAction(FactionsEventAbstractSender event, Double cost, String desc)
public static void payForAction(EventFactionsAbstractSender event, Double cost, String desc)
{
// If there is a sender ...
UPlayer usender = event.getUSender();
@ -113,11 +113,11 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForAction(FactionsEventChunkChange event)
public void payForAction(EventFactionsChunkChange event)
{
Faction newFaction = event.getNewFaction();
UConf uconf = UConf.get(newFaction);
FactionsEventChunkChangeType type = event.getType();
EventFactionsChunkChangeType type = event.getType();
Double cost = uconf.econChunkCost.get(type);
String desc = type.toString().toLowerCase() + " this land";
@ -126,7 +126,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForAction(FactionsEventMembershipChange event)
public void payForAction(EventFactionsMembershipChange event)
{
Double cost = null;
String desc = null;
@ -158,7 +158,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventRelationChange event)
public void payForCommand(EventFactionsRelationChange event)
{
Double cost = UConf.get(event.getSender()).econRelCost.get(event.getNewRelation());
String desc = Factions.get().getOuterCmdFactions().cmdFactionsRelationNeutral.getDesc();
@ -167,7 +167,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventHomeChange event)
public void payForCommand(EventFactionsHomeChange event)
{
Double cost = UConf.get(event.getSender()).econCostSethome;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsSethome.getDesc();
@ -176,7 +176,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventCreate event)
public void payForCommand(EventFactionsCreate event)
{
Double cost = UConf.get(event.getSender()).econCostCreate;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsCreate.getDesc();
@ -185,7 +185,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventDescriptionChange event)
public void payForCommand(EventFactionsDescriptionChange event)
{
Double cost = UConf.get(event.getSender()).econCostDescription;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsDescription.getDesc();
@ -194,7 +194,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventNameChange event)
public void payForCommand(EventFactionsNameChange event)
{
Double cost = UConf.get(event.getSender()).econCostName;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsName.getDesc();
@ -203,7 +203,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventTitleChange event)
public void payForCommand(EventFactionsTitleChange event)
{
Double cost = UConf.get(event.getSender()).econCostTitle;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsTitle.getDesc();
@ -212,7 +212,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventOpenChange event)
public void payForCommand(EventFactionsOpenChange event)
{
Double cost = UConf.get(event.getSender()).econCostOpen;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsOpen.getDesc();
@ -221,7 +221,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventInvitedChange event)
public void payForCommand(EventFactionsInvitedChange event)
{
Double cost = event.isNewInvited() ? UConf.get(event.getSender()).econCostInvite : UConf.get(event.getSender()).econCostDeinvite;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsInvite.getDesc();
@ -230,7 +230,7 @@ public class FactionsListenerEcon implements Listener
}
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void payForCommand(FactionsEventHomeTeleport event)
public void payForCommand(EventFactionsHomeTeleport event)
{
Double cost = UConf.get(event.getSender()).econCostHome;
String desc = Factions.get().getOuterCmdFactions().cmdFactionsHome.getDesc();

View File

@ -66,9 +66,9 @@ import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayerColl;
import com.massivecraft.factions.entity.UPlayerColls;
import com.massivecraft.factions.event.FactionsEventPvpDisallowed;
import com.massivecraft.factions.event.FactionsEventPowerChange;
import com.massivecraft.factions.event.FactionsEventPowerChange.PowerChangeReason;
import com.massivecraft.factions.event.EventFactionsPvpDisallowed;
import com.massivecraft.factions.event.EventFactionsPowerChange;
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
import com.massivecraft.factions.util.VisualizeUtil;
import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.MUtil;
@ -218,7 +218,7 @@ public class FactionsListenerMain implements Listener
// ... alter the power ...
double newPower = uplayer.getPower() + uplayer.getPowerPerDeath();
FactionsEventPowerChange powerChangeEvent = new FactionsEventPowerChange(null, uplayer, PowerChangeReason.DEATH, newPower);
EventFactionsPowerChange powerChangeEvent = new EventFactionsPowerChange(null, uplayer, PowerChangeReason.DEATH, newPower);
powerChangeEvent.run();
if (powerChangeEvent.isCancelled()) return;
newPower = powerChangeEvent.getNewPower();
@ -279,7 +279,7 @@ public class FactionsListenerMain implements Listener
// Utility method used in "canCombatDamageHappen" below.
public static boolean falseUnlessDisallowedPvpEventCancelled(Player attacker, Player defender, EntityDamageByEntityEvent event)
{
FactionsEventPvpDisallowed dpe = new FactionsEventPvpDisallowed(attacker, defender, event);
EventFactionsPvpDisallowed dpe = new EventFactionsPvpDisallowed(attacker, defender, event);
dpe.run();
return dpe.isCancelled();
}

View File

@ -6,8 +6,8 @@ import org.bukkit.entity.Player;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.event.FactionsEventPowerChange;
import com.massivecraft.factions.event.FactionsEventPowerChange.PowerChangeReason;
import com.massivecraft.factions.event.EventFactionsPowerChange;
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
import com.massivecraft.massivecore.ModuloRepeatTask;
import com.massivecraft.massivecore.util.TimeUnit;
@ -51,7 +51,7 @@ public class TaskPlayerPowerUpdate extends ModuloRepeatTask
UPlayer uplayer = UPlayer.get(player);
double newPower = uplayer.getPower() + uplayer.getPowerPerHour() * millis / TimeUnit.MILLIS_PER_HOUR;
FactionsEventPowerChange event = new FactionsEventPowerChange(null, uplayer, PowerChangeReason.TIME, newPower);
EventFactionsPowerChange event = new EventFactionsPowerChange(null, uplayer, PowerChangeReason.TIME, newPower);
event.run();
if (event.isCancelled()) continue;
newPower = event.getNewPower();