use of me.andrew28.addons.conquer.api.ConquerClaim in project Conquer by xXAndrew28Xx.
the class ExprFactionAtLocClaim method change.
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
Object[] claimObjects = this.targets.getArray(e);
if (claimObjects == null) {
return;
}
for (Object claimObject : claimObjects) {
if (claimObject == null) {
continue;
}
ConquerClaim claim;
if (claimObject instanceof ConquerClaim) {
claim = (ConquerClaim) claimObject;
} else if (claimObject instanceof Location) {
claim = Conquer.getInstance().getFactions().getClaim((Location) claimObject);
} else {
continue;
}
claim.setTo(ClaimType.WILDERNESS);
}
}
use of me.andrew28.addons.conquer.api.ConquerClaim in project Conquer by xXAndrew28Xx.
the class LFEventForwarder method onLandChange.
@EventHandler
public void onLandChange(EventFactionsLandChange event) {
boolean claiming = event.getCause() == EventFactionsLandChange.LandChangeCause.Claim;
ConquerPlayer player = LFPlayer.get(plugin, event.getFPlayer());
Iterator<Map.Entry<FLocation, Faction>> iterator = event.getTransactions().entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<FLocation, Faction> entry = iterator.next();
ConquerClaim<Chunk> claim = LFClaim.get(plugin, entry.getKey());
ConquerFaction faction = LFFaction.get(plugin, entry.getValue());
ConquerLandClaimEvent forwardEvent = new ConquerLandClaimEvent(claim, claiming, faction, player);
callEvent(forwardEvent);
if (forwardEvent.isCancelled()) {
iterator.remove();
}
}
}
Aggregations