Interface ItemRestriction



  • public interface ItemRestriction
    • 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 profile
        p - The Player itself
        item - The SlimefunItem that the ItemStack represents
        itemstack - 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 profile
        p - The Player to warn
        item - The SlimefunItem that the ItemStack represents
        itemstack - The ItemStack that was prevented from being used