AlttdGriefPrevention/src/main/java/me/ryanhamshire/GriefPrevention/events/MultiClaimEvent.java
Adam 3562a238dd
Clean up events for add-ons (#1706)
* Restructure and document events
2021-12-10 12:14:40 -08:00

42 lines
873 B
Java

package me.ryanhamshire.GriefPrevention.events;
import me.ryanhamshire.GriefPrevention.Claim;
import org.bukkit.event.Event;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.HashSet;
/**
* An {@link Event} involving multiple {@link Claim Claims}.
*/
public abstract class MultiClaimEvent extends Event
{
private final @NotNull Collection<Claim> claims;
public MultiClaimEvent(@Nullable Collection<Claim> claims)
{
if (claims == null)
{
this.claims = new HashSet<>();
}
else
{
this.claims = new HashSet<>(claims);
}
}
/**
* Get all affected claims.
*
* @return the affected claims
*/
public @NotNull Collection<Claim> getClaims()
{
return claims;
}
}