mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-14 10:45:23 +01:00
Allow null as item
This commit is contained in:
parent
f1bdcbb71e
commit
c78bd6d7cc
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>Minepacks-API</artifactId>
|
||||
<version>2.1-ALPHA-SNAPSHOTS</version>
|
||||
<version>2.2-SNAPSHOT</version>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
||||
|
@ -19,15 +19,19 @@
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface ItemFilter
|
||||
{
|
||||
/**
|
||||
* @param item The item that should be checked.
|
||||
* @return True if the item is not allowed. False if the item is allowed.
|
||||
*/
|
||||
boolean isItemBlocked(@NotNull ItemStack item);
|
||||
@Contract("null->false")
|
||||
boolean isItemBlocked(@Nullable ItemStack item);
|
||||
|
||||
/**
|
||||
* @param player The player that should receive the message that the item is not allowed.
|
||||
@ -40,7 +44,7 @@ public interface ItemFilter
|
||||
* @param itemStack The item that should be checked.
|
||||
* @return True if the item is not allowed. False if the item is allowed.
|
||||
*/
|
||||
default boolean checkIsBlockedAndShowMessage(@NotNull Player player, @NotNull ItemStack itemStack)
|
||||
default boolean checkIsBlockedAndShowMessage(@NotNull Player player, @Nullable ItemStack itemStack)
|
||||
{
|
||||
if(isItemBlocked(itemStack))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user