Add cancellable FactionRelationWishEvent
This event is called before a faction relation wish is applied by a player using `/f relation`
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.massivecraft.factions.event;
|
||||
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class FactionRelationWishEvent extends FactionPlayerEvent implements Cancellable {
|
||||
private final Faction targetFaction;
|
||||
private final Relation currentRelation;
|
||||
private final Relation targetRelation;
|
||||
|
||||
private boolean cancelled;
|
||||
|
||||
public FactionRelationWishEvent(FPlayer caller, Faction sender, Faction targetFaction, Relation currentRelation, Relation targetRelation) {
|
||||
super(sender, caller);
|
||||
|
||||
this.targetFaction = targetFaction;
|
||||
this.currentRelation = currentRelation;
|
||||
this.targetRelation = targetRelation;
|
||||
}
|
||||
|
||||
public Faction getTargetFaction() {
|
||||
return targetFaction;
|
||||
}
|
||||
|
||||
public Relation getCurrentRelation() {
|
||||
return currentRelation;
|
||||
}
|
||||
|
||||
public Relation getTargetRelation() {
|
||||
return targetRelation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user