Interface ItemRestriction
-
public interface ItemRestriction
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAllowed(PlayerProfile profile, Player p, SlimefunItem item, ItemStack itemstack)
This method represents a check.void
warnPlayer(PlayerProfile profile, Player p, SlimefunItem item, ItemStack itemstack)
This method is executed if an ItemRestriction took affect.
-
-
-
Method Detail
-
isAllowed
boolean isAllowed(PlayerProfile profile, Player p, SlimefunItem item, ItemStack itemstack)
This method represents a check. The returned boolean will decide whether to allow the action.- Parameters:
profile
- The Player's profilep
- The Player itselfitem
- The SlimefunItem that theItemStack
representsitemstack
- The ItemStack that is being tested.- Returns:
- Whether the action was allowed
-
warnPlayer
void warnPlayer(PlayerProfile profile, Player p, SlimefunItem item, ItemStack itemstack)
This method is executed if an ItemRestriction took affect. Override it to send a message to the Player telling them they cannot use that item, or do something else in there.- Parameters:
profile
- The Player's profilep
- The Player to warnitem
- The SlimefunItem that theItemStack
representsitemstack
- The ItemStack that was prevented from being used
-
-