Skip to content

Commit

Permalink
Add More Corporation Events
Browse files Browse the repository at this point in the history
  • Loading branch information
gmitch215 committed Dec 8, 2023
1 parent 5f8fc27 commit 3541be8
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package us.teaminceptus.novaconomy.api.events.corporation;

import org.bukkit.event.Cancellable;
import org.jetbrains.annotations.NotNull;
import us.teaminceptus.novaconomy.api.business.Business;
import us.teaminceptus.novaconomy.api.corporation.Corporation;

/**
* Called before a Corporation bans a member.
*/
public class CorporationBanEvent extends CorporationEvent implements Cancellable {

private final Business banned;
private boolean cancelled;

public CorporationBanEvent(@NotNull Corporation corporation, @NotNull Business banned) {
super(corporation);
if (banned == null) throw new IllegalArgumentException("banned cannot be null");
this.banned = banned;
}

/**
* Gets the business that was banned.
* @return The business that was banned.
*/
@NotNull
public Business getBanned() {
return banned;
}

@Override
public boolean isCancelled() {
return cancelled;
}

@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package us.teaminceptus.novaconomy.api.events.corporation;

import org.bukkit.event.Cancellable;
import org.jetbrains.annotations.NotNull;
import us.teaminceptus.novaconomy.api.business.Business;
import us.teaminceptus.novaconomy.api.corporation.Corporation;

/**
* Called before a Business is kicked from a Corporation. This is also called if the Business leaves on its own.
*/
public class CorporationKickEvent extends CorporationEvent implements Cancellable {

private final Business kicked;
private boolean cancelled;

public CorporationKickEvent(@NotNull Corporation corporation, @NotNull Business kicked) {
super(corporation);
if (kicked == null) throw new IllegalArgumentException("kicked cannot be null");
this.kicked = kicked;
}

/**
* Gets the business that was kicked.
* @return The business that was kicked.
*/
@NotNull
public Business getKicked() {
return kicked;
}

@Override
public boolean isCancelled() {
return cancelled;
}

@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package us.teaminceptus.novaconomy.api.events.corporation;

import org.bukkit.event.Cancellable;
import org.jetbrains.annotations.NotNull;
import us.teaminceptus.novaconomy.api.business.Business;
import us.teaminceptus.novaconomy.api.corporation.Corporation;

/**
* Called before a Business is unbanned from a Corporation.
*/
public class CorporationUnbanEvent extends CorporationEvent implements Cancellable {

private final Business unbanned;
private boolean cancelled;

public CorporationUnbanEvent(@NotNull Corporation corporation, @NotNull Business unbanned) {
super(corporation);
if (unbanned == null) throw new IllegalArgumentException("unbanned cannot be null");
this.unbanned = unbanned;
}

/**
* Gets the business that was banned.
* @return The business that was banned.
*/
@NotNull
public Business getUnbanned() {
return unbanned;
}

@Override
public boolean isCancelled() {
return cancelled;
}

@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}

}

0 comments on commit 3541be8

Please sign in to comment.