Event first
This commit is contained in:
parent
e43f63cf59
commit
56768aca55
@ -13,9 +13,9 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.FactionColl;
|
import com.massivecraft.factions.entity.FactionColl;
|
||||||
import com.massivecraft.factions.entity.FactionColls;
|
import com.massivecraft.factions.entity.FactionColls;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.factions.event.FactionsEventCreate;
|
import com.massivecraft.factions.event.EventFactionsCreate;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.store.MStore;
|
import com.massivecraft.massivecore.store.MStore;
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public class CmdFactionsCreate extends FCommand
|
|||||||
String factionId = MStore.createId();
|
String factionId = MStore.createId();
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventCreate createEvent = new FactionsEventCreate(sender, coll.getUniverse(), factionId, newName);
|
EventFactionsCreate createEvent = new EventFactionsCreate(sender, coll.getUniverse(), factionId, newName);
|
||||||
createEvent.run();
|
createEvent.run();
|
||||||
if (createEvent.isCancelled()) return;
|
if (createEvent.isCancelled()) return;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public class CmdFactionsCreate extends FCommand
|
|||||||
usender.setRole(Rel.LEADER);
|
usender.setRole(Rel.LEADER);
|
||||||
usender.setFaction(faction);
|
usender.setFaction(faction);
|
||||||
|
|
||||||
FactionsEventMembershipChange joinEvent = new FactionsEventMembershipChange(sender, usender, faction, MembershipChangeReason.CREATE);
|
EventFactionsMembershipChange joinEvent = new EventFactionsMembershipChange(sender, usender, faction, MembershipChangeReason.CREATE);
|
||||||
joinEvent.run();
|
joinEvent.run();
|
||||||
// NOTE: join event cannot be cancelled or you'll have an empty faction
|
// NOTE: join event cannot be cancelled or you'll have an empty faction
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import com.massivecraft.factions.Rel;
|
|||||||
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||||
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
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.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.mixin.Mixin;
|
import com.massivecraft.massivecore.mixin.Mixin;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class CmdFactionsDescription extends FCommand
|
|||||||
String newDescription = this.argConcatFrom(0);
|
String newDescription = this.argConcatFrom(0);
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventDescriptionChange event = new FactionsEventDescriptionChange(sender, usenderFaction, newDescription);
|
EventFactionsDescriptionChange event = new EventFactionsDescriptionChange(sender, usenderFaction, newDescription);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newDescription = event.getNewDescription();
|
newDescription = event.getNewDescription();
|
||||||
|
@ -7,9 +7,9 @@ import com.massivecraft.factions.entity.UPlayerColls;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.FactionColls;
|
import com.massivecraft.factions.entity.FactionColls;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.factions.event.FactionsEventDisband;
|
import com.massivecraft.factions.event.EventFactionsDisband;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.factions.FFlag;
|
import com.massivecraft.factions.FFlag;
|
||||||
import com.massivecraft.factions.FPerm;
|
import com.massivecraft.factions.FPerm;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
@ -58,7 +58,7 @@ public class CmdFactionsDisband extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventDisband event = new FactionsEventDisband(me, faction);
|
EventFactionsDisband event = new EventFactionsDisband(me, faction);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public class CmdFactionsDisband extends FCommand
|
|||||||
// Run event for each player in the faction
|
// Run event for each player in the faction
|
||||||
for (UPlayer uplayer : faction.getUPlayers())
|
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();
|
membershipChangeEvent.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
|||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
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.integration.Econ;
|
||||||
import com.massivecraft.factions.FFlag;
|
import com.massivecraft.factions.FFlag;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
@ -86,7 +86,7 @@ public class CmdFactionsFaction extends FCommand
|
|||||||
{
|
{
|
||||||
long landCount = faction.getLandCount();
|
long landCount = faction.getLandCount();
|
||||||
|
|
||||||
for (FactionsEventChunkChangeType type : FactionsEventChunkChangeType.values())
|
for (EventFactionsChunkChangeType type : EventFactionsChunkChangeType.values())
|
||||||
{
|
{
|
||||||
Double money = uconf.econChunkCost.get(type);
|
Double money = uconf.econChunkCost.get(type);
|
||||||
if (money == null) continue;
|
if (money == null) continue;
|
||||||
|
@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.BoardColls;
|
|||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
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.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||||
import com.massivecraft.massivecore.mixin.Mixin;
|
import com.massivecraft.massivecore.mixin.Mixin;
|
||||||
@ -133,7 +133,7 @@ public class CmdFactionsHome extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventHomeTeleport event = new FactionsEventHomeTeleport(sender);
|
EventFactionsHomeTeleport event = new EventFactionsHomeTeleport(sender);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import com.massivecraft.factions.cmd.arg.ARUPlayer;
|
|||||||
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||||
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
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.arg.ARBoolean;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||||
@ -60,7 +60,7 @@ public class CmdFactionsInvite extends FCommand
|
|||||||
if ( ! FPerm.INVITE.has(usender, usenderFaction, true)) return;
|
if ( ! FPerm.INVITE.has(usender, usenderFaction, true)) return;
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventInvitedChange event = new FactionsEventInvitedChange(sender, uplayer, usenderFaction, newInvited);
|
EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, uplayer, usenderFaction, newInvited);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newInvited = event.isNewInvited();
|
newInvited = event.isNewInvited();
|
||||||
|
@ -9,8 +9,8 @@ import com.massivecraft.factions.entity.UPlayer;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ public class CmdFactionsJoin extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, usender, faction, MembershipChangeReason.JOIN);
|
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, usender, faction, MembershipChangeReason.JOIN);
|
||||||
membershipChangeEvent.run();
|
membershipChangeEvent.run();
|
||||||
if (membershipChangeEvent.isCancelled()) return;
|
if (membershipChangeEvent.isCancelled()) return;
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.FactionColls;
|
import com.massivecraft.factions.entity.FactionColls;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
|
|
||||||
public class CmdFactionsKick extends FCommand
|
public class CmdFactionsKick extends FCommand
|
||||||
@ -70,7 +70,7 @@ public class CmdFactionsKick extends FCommand
|
|||||||
if (!FPerm.KICK.has(usender, uplayerFaction, true)) return;
|
if (!FPerm.KICK.has(usender, uplayerFaction, true)) return;
|
||||||
|
|
||||||
// Event
|
// 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();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
|||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.entity.UPlayerColls;
|
import com.massivecraft.factions.entity.UPlayerColls;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
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
|
// only run event when newLeader isn't actually in the faction
|
||||||
if (newLeader.getFaction() != targetFaction)
|
if (newLeader.getFaction() != targetFaction)
|
||||||
{
|
{
|
||||||
FactionsEventMembershipChange event = new FactionsEventMembershipChange(sender, newLeader, targetFaction, MembershipChangeReason.LEADER);
|
EventFactionsMembershipChange event = new EventFactionsMembershipChange(sender, newLeader, targetFaction, MembershipChangeReason.LEADER);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.FactionColl;
|
import com.massivecraft.factions.entity.FactionColl;
|
||||||
import com.massivecraft.factions.entity.FactionColls;
|
import com.massivecraft.factions.entity.FactionColls;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
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.factions.util.MiscUtil;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public class CmdFactionsName extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventNameChange event = new FactionsEventNameChange(sender, usenderFaction, newName);
|
EventFactionsNameChange event = new EventFactionsNameChange(sender, usenderFaction, newName);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newName = event.getNewName();
|
newName = event.getNewName();
|
||||||
|
@ -5,7 +5,7 @@ import com.massivecraft.factions.Rel;
|
|||||||
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||||
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
||||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
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.arg.ARBoolean;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class CmdFactionsOpen extends FCommand
|
|||||||
if (newOpen == null) return;
|
if (newOpen == null) return;
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventOpenChange event = new FactionsEventOpenChange(sender, usenderFaction, newOpen);
|
EventFactionsOpenChange event = new EventFactionsOpenChange(sender, usenderFaction, newOpen);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newOpen = event.isNewOpen();
|
newOpen = event.isNewOpen();
|
||||||
|
@ -9,7 +9,7 @@ import com.massivecraft.factions.cmd.req.ReqHasFaction;
|
|||||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
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;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
|
|
||||||
public abstract class CmdFactionsRelationAbstract extends FCommand
|
public abstract class CmdFactionsRelationAbstract extends FCommand
|
||||||
@ -66,7 +66,7 @@ public abstract class CmdFactionsRelationAbstract extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventRelationChange event = new FactionsEventRelationChange(sender, usenderFaction, otherFaction, newRelation);
|
EventFactionsRelationChange event = new EventFactionsRelationChange(sender, usenderFaction, otherFaction, newRelation);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newRelation = event.getNewRelation();
|
newRelation = event.getNewRelation();
|
||||||
|
@ -7,7 +7,7 @@ import com.massivecraft.factions.cmd.arg.ARFaction;
|
|||||||
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
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.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
import com.massivecraft.massivecore.cmd.req.ReqIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
@ -63,7 +63,7 @@ public class CmdFactionsSethome extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventHomeChange event = new FactionsEventHomeChange(sender, faction, newHome);
|
EventFactionsHomeChange event = new EventFactionsHomeChange(sender, faction, newHome);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newHome = event.getNewHome();
|
newHome = event.getNewHome();
|
||||||
|
@ -8,7 +8,7 @@ import com.massivecraft.factions.cmd.arg.ARUPlayer;
|
|||||||
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||||
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
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.arg.ARString;
|
||||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
@ -58,7 +58,7 @@ public class CmdFactionsTitle extends FCommand
|
|||||||
if ( ! canIAdministerYou(usender, you)) return;
|
if ( ! canIAdministerYou(usender, you)) return;
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventTitleChange event = new FactionsEventTitleChange(sender, you, newTitle);
|
EventFactionsTitleChange event = new EventFactionsTitleChange(sender, you, newTitle);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
newTitle = event.getNewTitle();
|
newTitle = event.getNewTitle();
|
||||||
|
@ -14,7 +14,7 @@ import com.massivecraft.factions.entity.BoardColls;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.FactionColls;
|
import com.massivecraft.factions.entity.FactionColls;
|
||||||
import com.massivecraft.factions.entity.MConf;
|
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.cmd.req.ReqHasPerm;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ public class CmdFactionsUnclaimall extends FCommand
|
|||||||
int countFail = 0;
|
int countFail = 0;
|
||||||
for (PS chunk : chunks)
|
for (PS chunk : chunks)
|
||||||
{
|
{
|
||||||
FactionsEventChunkChange event = new FactionsEventChunkChange(sender, chunk, newFaction);
|
EventFactionsChunkChange event = new EventFactionsChunkChange(sender, chunk, newFaction);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled())
|
if (event.isCancelled())
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import com.massivecraft.factions.FFlag;
|
import com.massivecraft.factions.FFlag;
|
||||||
import com.massivecraft.factions.FPerm;
|
import com.massivecraft.factions.FPerm;
|
||||||
import com.massivecraft.factions.Rel;
|
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.Entity;
|
||||||
import com.massivecraft.massivecore.store.SenderEntity;
|
import com.massivecraft.massivecore.store.SenderEntity;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
@ -219,11 +219,11 @@ public class UConf extends Entity<UConf>
|
|||||||
// INTEGRATION: LWC
|
// INTEGRATION: LWC
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public Map<FactionsEventChunkChangeType, Boolean> lwcRemoveOnChange = MUtil.map(
|
public Map<EventFactionsChunkChangeType, Boolean> lwcRemoveOnChange = MUtil.map(
|
||||||
FactionsEventChunkChangeType.BUY, false,
|
EventFactionsChunkChangeType.BUY, false,
|
||||||
FactionsEventChunkChangeType.SELL, false,
|
EventFactionsChunkChangeType.SELL, false,
|
||||||
FactionsEventChunkChangeType.CONQUER, false,
|
EventFactionsChunkChangeType.CONQUER, false,
|
||||||
FactionsEventChunkChangeType.PILLAGE, false
|
EventFactionsChunkChangeType.PILLAGE, false
|
||||||
);
|
);
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -237,11 +237,11 @@ public class UConf extends Entity<UConf>
|
|||||||
|
|
||||||
public String econUniverseAccount = "";
|
public String econUniverseAccount = "";
|
||||||
|
|
||||||
public Map<FactionsEventChunkChangeType, Double> econChunkCost = MUtil.map(
|
public Map<EventFactionsChunkChangeType, Double> econChunkCost = MUtil.map(
|
||||||
FactionsEventChunkChangeType.BUY, 30.0,
|
EventFactionsChunkChangeType.BUY, 30.0,
|
||||||
FactionsEventChunkChangeType.SELL, -20.0,
|
EventFactionsChunkChangeType.SELL, -20.0,
|
||||||
FactionsEventChunkChangeType.CONQUER, -10.0,
|
EventFactionsChunkChangeType.CONQUER, -10.0,
|
||||||
FactionsEventChunkChangeType.PILLAGE, -10.0
|
EventFactionsChunkChangeType.PILLAGE, -10.0
|
||||||
);
|
);
|
||||||
|
|
||||||
public double econCostCreate = 200.0;
|
public double econCostCreate = 200.0;
|
||||||
|
@ -13,9 +13,9 @@ import com.massivecraft.factions.Factions;
|
|||||||
import com.massivecraft.factions.Lang;
|
import com.massivecraft.factions.Lang;
|
||||||
import com.massivecraft.factions.Rel;
|
import com.massivecraft.factions.Rel;
|
||||||
import com.massivecraft.factions.RelationParticipator;
|
import com.massivecraft.factions.RelationParticipator;
|
||||||
import com.massivecraft.factions.event.FactionsEventChunkChange;
|
import com.massivecraft.factions.event.EventFactionsChunkChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.massivecore.mixin.Mixin;
|
import com.massivecraft.massivecore.mixin.Mixin;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
@ -620,7 +620,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(this.getSender(), this, myFaction, MembershipChangeReason.LEAVE);
|
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(this.getSender(), this, myFaction, MembershipChangeReason.LEAVE);
|
||||||
membershipChangeEvent.run();
|
membershipChangeEvent.run();
|
||||||
if (membershipChangeEvent.isCancelled()) return;
|
if (membershipChangeEvent.isCancelled()) return;
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
FactionsEventChunkChange event = new FactionsEventChunkChange(sender, chunk, newFaction);
|
EventFactionsChunkChange event = new EventFactionsChunkChange(sender, chunk, newFaction);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) return false;
|
if (event.isCancelled()) return false;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.event;
|
|||||||
|
|
||||||
import com.massivecraft.massivecore.event.EventMassiveCore;
|
import com.massivecraft.massivecore.event.EventMassiveCore;
|
||||||
|
|
||||||
public abstract class FactionsEventAbstract extends EventMassiveCore
|
public abstract class EventFactionsAbstract extends EventMassiveCore
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.massivecore.event.EventMassiveCore;
|
import com.massivecraft.massivecore.event.EventMassiveCore;
|
||||||
|
|
||||||
public abstract class FactionsEventAbstractSender extends EventMassiveCore
|
public abstract class EventFactionsAbstractSender extends EventMassiveCore
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// FIELDS
|
// FIELDS
|
||||||
@ -19,7 +19,7 @@ public abstract class FactionsEventAbstractSender extends EventMassiveCore
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventAbstractSender(CommandSender sender)
|
public EventFactionsAbstractSender(CommandSender sender)
|
||||||
{
|
{
|
||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ import com.massivecraft.factions.entity.Faction;
|
|||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
|
||||||
public class FactionsEventChunkChange extends FactionsEventAbstractSender
|
public class EventFactionsChunkChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -33,7 +33,7 @@ public class FactionsEventChunkChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventChunkChange(CommandSender sender, PS chunk, Faction newFaction)
|
public EventFactionsChunkChange(CommandSender sender, PS chunk, Faction newFaction)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.chunk = chunk.getChunk(true);
|
this.chunk = chunk.getChunk(true);
|
||||||
@ -45,15 +45,15 @@ public class FactionsEventChunkChange extends FactionsEventAbstractSender
|
|||||||
// UTIL
|
// UTIL
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventChunkChangeType getType()
|
public EventFactionsChunkChangeType getType()
|
||||||
{
|
{
|
||||||
if (currentFaction.isNone()) return FactionsEventChunkChangeType.BUY;
|
if (currentFaction.isNone()) return EventFactionsChunkChangeType.BUY;
|
||||||
if (newFaction.isNormal()) return FactionsEventChunkChangeType.CONQUER;
|
if (newFaction.isNormal()) return EventFactionsChunkChangeType.CONQUER;
|
||||||
|
|
||||||
UPlayer usender = this.getUSender();
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package com.massivecraft.factions.event;
|
package com.massivecraft.factions.event;
|
||||||
|
|
||||||
public enum FactionsEventChunkChangeType
|
public enum EventFactionsChunkChangeType
|
||||||
{
|
{
|
||||||
BUY,
|
BUY,
|
||||||
SELL,
|
SELL,
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.event;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
public class FactionsEventCreate extends FactionsEventAbstractSender
|
public class EventFactionsCreate extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -30,7 +30,7 @@ public class FactionsEventCreate extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventCreate(CommandSender sender, String universe, String factionId, String factionName)
|
public EventFactionsCreate(CommandSender sender, String universe, String factionId, String factionName)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.universe = universe;
|
this.universe = universe;
|
@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class FactionsEventDescriptionChange extends FactionsEventAbstractSender
|
public class EventFactionsDescriptionChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -30,7 +30,7 @@ public class FactionsEventDescriptionChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventDescriptionChange(CommandSender sender, Faction faction, String newDescription)
|
public EventFactionsDescriptionChange(CommandSender sender, Faction faction, String newDescription)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.faction = faction;
|
this.faction = faction;
|
@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class FactionsEventDisband extends FactionsEventAbstractSender
|
public class EventFactionsDisband extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -29,7 +29,7 @@ public class FactionsEventDisband extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventDisband(CommandSender sender, Faction faction)
|
public EventFactionsDisband(CommandSender sender, Faction faction)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.faction = faction;
|
this.faction = faction;
|
@ -6,7 +6,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
|
||||||
public class FactionsEventHomeChange extends FactionsEventAbstractSender
|
public class EventFactionsHomeChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -31,7 +31,7 @@ public class FactionsEventHomeChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventHomeChange(CommandSender sender, Faction faction, PS newHome)
|
public EventFactionsHomeChange(CommandSender sender, Faction faction, PS newHome)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.faction = faction;
|
this.faction = faction;
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.event;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
public class FactionsEventHomeTeleport extends FactionsEventAbstractSender
|
public class EventFactionsHomeTeleport extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -17,7 +17,7 @@ public class FactionsEventHomeTeleport extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventHomeTeleport(CommandSender sender)
|
public EventFactionsHomeTeleport(CommandSender sender)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
}
|
}
|
@ -6,7 +6,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class FactionsEventInvitedChange extends FactionsEventAbstractSender
|
public class EventFactionsInvitedChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -34,7 +34,7 @@ public class FactionsEventInvitedChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventInvitedChange(CommandSender sender, UPlayer uplayer, Faction faction, boolean newInvited)
|
public EventFactionsInvitedChange(CommandSender sender, UPlayer uplayer, Faction faction, boolean newInvited)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.uplayer = uplayer;
|
this.uplayer = uplayer;
|
@ -6,7 +6,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class FactionsEventMembershipChange extends FactionsEventAbstractSender
|
public class EventFactionsMembershipChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -40,7 +40,7 @@ public class FactionsEventMembershipChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventMembershipChange(CommandSender sender, UPlayer uplayer, Faction newFaction, MembershipChangeReason reason)
|
public EventFactionsMembershipChange(CommandSender sender, UPlayer uplayer, Faction newFaction, MembershipChangeReason reason)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.uplayer = uplayer;
|
this.uplayer = uplayer;
|
@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class FactionsEventNameChange extends FactionsEventAbstractSender
|
public class EventFactionsNameChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -30,7 +30,7 @@ public class FactionsEventNameChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventNameChange(CommandSender sender, Faction faction, String newName)
|
public EventFactionsNameChange(CommandSender sender, Faction faction, String newName)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.faction = faction;
|
this.faction = faction;
|
@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class FactionsEventOpenChange extends FactionsEventAbstractSender
|
public class EventFactionsOpenChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -30,7 +30,7 @@ public class FactionsEventOpenChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventOpenChange(CommandSender sender, Faction faction, boolean newOpen)
|
public EventFactionsOpenChange(CommandSender sender, Faction faction, boolean newOpen)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.faction = faction;
|
this.faction = faction;
|
@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
|
|
||||||
public class FactionsEventPowerChange extends FactionsEventAbstractSender
|
public class EventFactionsPowerChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -33,7 +33,7 @@ public class FactionsEventPowerChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventPowerChange(CommandSender sender, UPlayer uplayer, PowerChangeReason reason, double newPower)
|
public EventFactionsPowerChange(CommandSender sender, UPlayer uplayer, PowerChangeReason reason, double newPower)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.uplayer = uplayer;
|
this.uplayer = uplayer;
|
@ -13,7 +13,7 @@ import com.massivecraft.factions.entity.UPlayer;
|
|||||||
* Note that the defender field always is set but the attacker can be null.
|
* Note that the defender field always is set but the attacker can be null.
|
||||||
* Some other plugins seem to fire EntityDamageByEntityEvent without an attacker.
|
* Some other plugins seem to fire EntityDamageByEntityEvent without an attacker.
|
||||||
*/
|
*/
|
||||||
public class FactionsEventPvpDisallowed extends FactionsEventAbstract
|
public class EventFactionsPvpDisallowed extends EventFactionsAbstract
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -42,7 +42,7 @@ public class FactionsEventPvpDisallowed extends FactionsEventAbstract
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventPvpDisallowed(Player attacker, Player defender, EntityDamageByEntityEvent event)
|
public EventFactionsPvpDisallowed(Player attacker, Player defender, EntityDamageByEntityEvent event)
|
||||||
{
|
{
|
||||||
this.attacker = attacker;
|
this.attacker = attacker;
|
||||||
this.defender = defender;
|
this.defender = defender;
|
@ -7,7 +7,7 @@ import com.massivecraft.factions.Rel;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
|
|
||||||
|
|
||||||
public class FactionsEventRelationChange extends FactionsEventAbstractSender
|
public class EventFactionsRelationChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -35,7 +35,7 @@ public class FactionsEventRelationChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventRelationChange(CommandSender sender, Faction faction, Faction otherFaction, Rel newRelation)
|
public EventFactionsRelationChange(CommandSender sender, Faction faction, Faction otherFaction, Rel newRelation)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.faction = faction;
|
this.faction = faction;
|
@ -5,7 +5,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
|
|
||||||
public class FactionsEventTitleChange extends FactionsEventAbstractSender
|
public class EventFactionsTitleChange extends EventFactionsAbstractSender
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// REQUIRED EVENT CODE
|
// REQUIRED EVENT CODE
|
||||||
@ -30,7 +30,7 @@ public class FactionsEventTitleChange extends FactionsEventAbstractSender
|
|||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public FactionsEventTitleChange(CommandSender sender, UPlayer uplayer, String newTitle)
|
public EventFactionsTitleChange(CommandSender sender, UPlayer uplayer, String newTitle)
|
||||||
{
|
{
|
||||||
super(sender);
|
super(sender);
|
||||||
this.uplayer = uplayer;
|
this.uplayer = uplayer;
|
@ -19,8 +19,8 @@ import com.massivecraft.factions.Factions;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.event.FactionsEventChunkChange;
|
import com.massivecraft.factions.event.EventFactionsChunkChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventChunkChangeType;
|
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
|
||||||
|
|
||||||
@ -53,12 +53,12 @@ public class EngineLwc implements Listener
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@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 ...
|
// If we are supposed to clear at this chunk change type ...
|
||||||
Faction newFaction = event.getNewFaction();
|
Faction newFaction = event.getNewFaction();
|
||||||
UConf uconf = UConf.get(newFaction);
|
UConf uconf = UConf.get(newFaction);
|
||||||
FactionsEventChunkChangeType type = event.getType();
|
EventFactionsChunkChangeType type = event.getType();
|
||||||
Boolean remove = uconf.lwcRemoveOnChange.get(type);
|
Boolean remove = uconf.lwcRemoveOnChange.get(type);
|
||||||
if (remove == null) return;
|
if (remove == null) return;
|
||||||
if (remove == false) return;
|
if (remove == false) return;
|
||||||
|
@ -9,21 +9,21 @@ import com.massivecraft.factions.Factions;
|
|||||||
import com.massivecraft.factions.entity.Faction;
|
import com.massivecraft.factions.entity.Faction;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.event.FactionsEventAbstractSender;
|
import com.massivecraft.factions.event.EventFactionsAbstractSender;
|
||||||
import com.massivecraft.factions.event.FactionsEventChunkChange;
|
import com.massivecraft.factions.event.EventFactionsChunkChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventChunkChangeType;
|
import com.massivecraft.factions.event.EventFactionsChunkChangeType;
|
||||||
import com.massivecraft.factions.event.FactionsEventCreate;
|
import com.massivecraft.factions.event.EventFactionsCreate;
|
||||||
import com.massivecraft.factions.event.FactionsEventDescriptionChange;
|
import com.massivecraft.factions.event.EventFactionsDescriptionChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventDisband;
|
import com.massivecraft.factions.event.EventFactionsDisband;
|
||||||
import com.massivecraft.factions.event.FactionsEventHomeChange;
|
import com.massivecraft.factions.event.EventFactionsHomeChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventHomeTeleport;
|
import com.massivecraft.factions.event.EventFactionsHomeTeleport;
|
||||||
import com.massivecraft.factions.event.FactionsEventInvitedChange;
|
import com.massivecraft.factions.event.EventFactionsInvitedChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.factions.event.FactionsEventOpenChange;
|
import com.massivecraft.factions.event.EventFactionsNameChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventRelationChange;
|
import com.massivecraft.factions.event.EventFactionsOpenChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventNameChange;
|
import com.massivecraft.factions.event.EventFactionsRelationChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventTitleChange;
|
import com.massivecraft.factions.event.EventFactionsTitleChange;
|
||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.money.Money;
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void takeOnLeave(FactionsEventMembershipChange event)
|
public void takeOnLeave(EventFactionsMembershipChange event)
|
||||||
{
|
{
|
||||||
// If a player is leaving the faction ...
|
// If a player is leaving the faction ...
|
||||||
if (event.getReason() != MembershipChangeReason.LEAVE) return;
|
if (event.getReason() != MembershipChangeReason.LEAVE) return;
|
||||||
@ -70,7 +70,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void takeOnDisband(FactionsEventDisband event)
|
public void takeOnDisband(EventFactionsDisband event)
|
||||||
{
|
{
|
||||||
// If there is a usender ...
|
// If there is a usender ...
|
||||||
UPlayer usender = event.getUSender();
|
UPlayer usender = event.getUSender();
|
||||||
@ -95,7 +95,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
// PAY FOR ACTION
|
// 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 ...
|
// If there is a sender ...
|
||||||
UPlayer usender = event.getUSender();
|
UPlayer usender = event.getUSender();
|
||||||
@ -113,11 +113,11 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForAction(FactionsEventChunkChange event)
|
public void payForAction(EventFactionsChunkChange event)
|
||||||
{
|
{
|
||||||
Faction newFaction = event.getNewFaction();
|
Faction newFaction = event.getNewFaction();
|
||||||
UConf uconf = UConf.get(newFaction);
|
UConf uconf = UConf.get(newFaction);
|
||||||
FactionsEventChunkChangeType type = event.getType();
|
EventFactionsChunkChangeType type = event.getType();
|
||||||
Double cost = uconf.econChunkCost.get(type);
|
Double cost = uconf.econChunkCost.get(type);
|
||||||
|
|
||||||
String desc = type.toString().toLowerCase() + " this land";
|
String desc = type.toString().toLowerCase() + " this land";
|
||||||
@ -126,7 +126,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForAction(FactionsEventMembershipChange event)
|
public void payForAction(EventFactionsMembershipChange event)
|
||||||
{
|
{
|
||||||
Double cost = null;
|
Double cost = null;
|
||||||
String desc = null;
|
String desc = null;
|
||||||
@ -158,7 +158,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@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());
|
Double cost = UConf.get(event.getSender()).econRelCost.get(event.getNewRelation());
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsRelationNeutral.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsRelationNeutral.getDesc();
|
||||||
@ -167,7 +167,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventHomeChange event)
|
public void payForCommand(EventFactionsHomeChange event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostSethome;
|
Double cost = UConf.get(event.getSender()).econCostSethome;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsSethome.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsSethome.getDesc();
|
||||||
@ -176,7 +176,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventCreate event)
|
public void payForCommand(EventFactionsCreate event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostCreate;
|
Double cost = UConf.get(event.getSender()).econCostCreate;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsCreate.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsCreate.getDesc();
|
||||||
@ -185,7 +185,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventDescriptionChange event)
|
public void payForCommand(EventFactionsDescriptionChange event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostDescription;
|
Double cost = UConf.get(event.getSender()).econCostDescription;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsDescription.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsDescription.getDesc();
|
||||||
@ -194,7 +194,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventNameChange event)
|
public void payForCommand(EventFactionsNameChange event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostName;
|
Double cost = UConf.get(event.getSender()).econCostName;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsName.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsName.getDesc();
|
||||||
@ -203,7 +203,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventTitleChange event)
|
public void payForCommand(EventFactionsTitleChange event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostTitle;
|
Double cost = UConf.get(event.getSender()).econCostTitle;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsTitle.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsTitle.getDesc();
|
||||||
@ -212,7 +212,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventOpenChange event)
|
public void payForCommand(EventFactionsOpenChange event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostOpen;
|
Double cost = UConf.get(event.getSender()).econCostOpen;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsOpen.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsOpen.getDesc();
|
||||||
@ -221,7 +221,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@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;
|
Double cost = event.isNewInvited() ? UConf.get(event.getSender()).econCostInvite : UConf.get(event.getSender()).econCostDeinvite;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsInvite.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsInvite.getDesc();
|
||||||
@ -230,7 +230,7 @@ public class FactionsListenerEcon implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void payForCommand(FactionsEventHomeTeleport event)
|
public void payForCommand(EventFactionsHomeTeleport event)
|
||||||
{
|
{
|
||||||
Double cost = UConf.get(event.getSender()).econCostHome;
|
Double cost = UConf.get(event.getSender()).econCostHome;
|
||||||
String desc = Factions.get().getOuterCmdFactions().cmdFactionsHome.getDesc();
|
String desc = Factions.get().getOuterCmdFactions().cmdFactionsHome.getDesc();
|
||||||
|
@ -66,9 +66,9 @@ import com.massivecraft.factions.entity.MConf;
|
|||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.entity.UPlayerColl;
|
import com.massivecraft.factions.entity.UPlayerColl;
|
||||||
import com.massivecraft.factions.entity.UPlayerColls;
|
import com.massivecraft.factions.entity.UPlayerColls;
|
||||||
import com.massivecraft.factions.event.FactionsEventPvpDisallowed;
|
import com.massivecraft.factions.event.EventFactionsPvpDisallowed;
|
||||||
import com.massivecraft.factions.event.FactionsEventPowerChange;
|
import com.massivecraft.factions.event.EventFactionsPowerChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventPowerChange.PowerChangeReason;
|
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
|
||||||
import com.massivecraft.factions.util.VisualizeUtil;
|
import com.massivecraft.factions.util.VisualizeUtil;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
@ -218,7 +218,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
// ... alter the power ...
|
// ... alter the power ...
|
||||||
double newPower = uplayer.getPower() + uplayer.getPowerPerDeath();
|
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();
|
powerChangeEvent.run();
|
||||||
if (powerChangeEvent.isCancelled()) return;
|
if (powerChangeEvent.isCancelled()) return;
|
||||||
newPower = powerChangeEvent.getNewPower();
|
newPower = powerChangeEvent.getNewPower();
|
||||||
@ -279,7 +279,7 @@ public class FactionsListenerMain implements Listener
|
|||||||
// Utility method used in "canCombatDamageHappen" below.
|
// Utility method used in "canCombatDamageHappen" below.
|
||||||
public static boolean falseUnlessDisallowedPvpEventCancelled(Player attacker, Player defender, EntityDamageByEntityEvent event)
|
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();
|
dpe.run();
|
||||||
return dpe.isCancelled();
|
return dpe.isCancelled();
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@ import org.bukkit.entity.Player;
|
|||||||
import com.massivecraft.factions.entity.MConf;
|
import com.massivecraft.factions.entity.MConf;
|
||||||
import com.massivecraft.factions.entity.UConf;
|
import com.massivecraft.factions.entity.UConf;
|
||||||
import com.massivecraft.factions.entity.UPlayer;
|
import com.massivecraft.factions.entity.UPlayer;
|
||||||
import com.massivecraft.factions.event.FactionsEventPowerChange;
|
import com.massivecraft.factions.event.EventFactionsPowerChange;
|
||||||
import com.massivecraft.factions.event.FactionsEventPowerChange.PowerChangeReason;
|
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
|
||||||
import com.massivecraft.massivecore.ModuloRepeatTask;
|
import com.massivecraft.massivecore.ModuloRepeatTask;
|
||||||
import com.massivecraft.massivecore.util.TimeUnit;
|
import com.massivecraft.massivecore.util.TimeUnit;
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public class TaskPlayerPowerUpdate extends ModuloRepeatTask
|
|||||||
UPlayer uplayer = UPlayer.get(player);
|
UPlayer uplayer = UPlayer.get(player);
|
||||||
double newPower = uplayer.getPower() + uplayer.getPowerPerHour() * millis / TimeUnit.MILLIS_PER_HOUR;
|
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();
|
event.run();
|
||||||
if (event.isCancelled()) continue;
|
if (event.isCancelled()) continue;
|
||||||
newPower = event.getNewPower();
|
newPower = event.getNewPower();
|
||||||
|
Loading…
Reference in New Issue
Block a user