Package de.themoep.ShowItem.api
Interface ShowItem
public interface ShowItem
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The types of different targets a message can have -
Method Summary
Modifier and TypeMethodDescriptioncacheEnder
(org.bukkit.entity.Player player) Cache an enderchest of a player.Cache an inventorycacheInv
(org.bukkit.entity.Player player) Cache an inventory of a player.org.bukkit.inventory.ItemStack
filterInItem
(org.bukkit.inventory.ItemStack item) Filter strings in an item's display name and loreGet a all commands in which to replace the chat variable toGet all configured chat variables to show the enderchestGet all configured chat variables to show the inventoryDeprecated.Get all configured chat variablesint
getCooldown
(ShowItem.MessageTarget target) Get the cooldown setting for a specific targetint
Get the default radius in which to show the item when run without a commandGet the plugin's resource pack icon mappingGet the ItemConverter utilGet the item matcher for blocking itemsint
Get the maximum length of an item's display name after which ellipses are addedint
Get the maximum amount of chat variables a player can put into a chat messageWhat should variables be replaced with when they exceed the maximum amountgetShownInv
(String id) Get a shown inventory by its id from the cacheboolean
Get whether or not this is a spigot server.boolean
openInvData
(org.bukkit.entity.Player target, Data invData) Open a GUI to show the inventory data to a playerboolean
shouldShowIcon
(org.bukkit.entity.Player player) Check whether or not we should show a text icon to a certain playerboolean
Get whether or not the plugin should allow showing with an empty handvoid
showInvInRadius
(org.bukkit.entity.Player sender, Data invData, int radius) Show an inventory to everyone around the playervoid
showInvToAll
(org.bukkit.entity.Player sender, Data invData) Show an inventory to every online playervoid
showInvToPlayer
(org.bukkit.entity.Player sender, org.bukkit.entity.Player target, Data invData) Show an inventory to another playervoid
showInvToWorld
(org.bukkit.entity.Player sender, Data invData) Show an inventory to all players in the same worldvoid
showItemInRadius
(org.bukkit.entity.Player sender, org.bukkit.inventory.ItemStack item, int radius) Show an item to everyone around the playervoid
showItemToAll
(org.bukkit.entity.Player sender, org.bukkit.inventory.ItemStack item) Show an item to every online playervoid
showItemToPlayer
(org.bukkit.entity.Player sender, org.bukkit.entity.Player target, org.bukkit.inventory.ItemStack item) Show an item to another playervoid
showItemToWorld
(org.bukkit.entity.Player sender, org.bukkit.inventory.ItemStack item) Show an item to all players in the same worldboolean
Get whether or not the plugin should try to strip spaces from the start and end of an item's nameboolean
Get whether or not we should try to display icons for items in chatboolean
Get whether or not the plugin should try to automatically get the color of named items to color the brackets withboolean
Whether or not to use a plugin name prefix in click component eventsboolean
Should the plugin show the real or the display/nick name of a playerboolean
Get whether or not to use the manual translation mapping in transmapping.yml
-
Method Details
-
useIconRp
boolean useIconRp()Get whether or not we should try to display icons for items in chat- Returns:
- Whether or not to display chat icons
-
useTranslationMapping
boolean useTranslationMapping()Get whether or not to use the manual translation mapping in transmapping.yml- Returns:
- Whether to use transmapping.yml or not
-
useNameColorForBrackets
boolean useNameColorForBrackets()Get whether or not the plugin should try to automatically get the color of named items to color the brackets with- Returns:
- Whether or not named item colors will be used for the brackets
-
trimItemName
boolean trimItemName()Get whether or not the plugin should try to strip spaces from the start and end of an item's name- Returns:
- Whether or not spaces get stripped from item display names
-
getItemNameLength
int getItemNameLength()Get the maximum length of an item's display name after which ellipses are added- Returns:
- The maximum length or -1 if there should be no max length
-
getItemMatcher
ItemMatcher getItemMatcher()Get the item matcher for blocking items- Returns:
- the plugin's matcher for blocking items
-
getIconRpMap
IconRpMapping getIconRpMap()Get the plugin's resource pack icon mapping- Returns:
- The icon mapping utility
-
isServerSpigot
boolean isServerSpigot()Get whether or not this is a spigot server. This helps when deciding whether or not the Bungee chat component API should be used.- Returns:
- Whether or not this is a Spigot server
-
useNickName
boolean useNickName()Should the plugin show the real or the display/nick name of a player- Returns:
- Whether or not to show the display name
-
getDefaultRadius
int getDefaultRadius()Get the default radius in which to show the item when run without a command- Returns:
- The default radius, -1 for whole world, -2 for whole server
-
getCooldown
Get the cooldown setting for a specific target- Parameters:
target
- The target of which the cooldown should be get- Returns:
- The configured cooldown of the target or 0 if there is none
-
getItemConverter
ItemConverter getItemConverter()Get the ItemConverter util- Returns:
- The instance of the ItemConvert util
-
getChatVar
Deprecated.UsegetChatVars()
Get the the chat variable. If there are multiple it will get the first one.- Returns:
- The configured chat variable
-
useNamespacedCommands
boolean useNamespacedCommands()Whether or not to use a plugin name prefix in click component events- Returns:
- true if the command should be prefixed with he plugin's name, false if not
-
getChatVars
Get all configured chat variables- Returns:
- A set of all configured chat variables
-
getChatInvVars
Get all configured chat variables to show the inventory- Returns:
- A set of all configured inventory chat variables
-
getChatEnderVars
Get all configured chat variables to show the enderchest- Returns:
- A set of all configured enderchest chat variables
-
getChatCommands
Get a all commands in which to replace the chat variable to- Returns:
- A set of all configured chat variables. If it contains "*" it means that all commands should be allowed.
-
getMaxChatVars
int getMaxChatVars()Get the maximum amount of chat variables a player can put into a chat message- Returns:
- The maximum amount of chat variables that can be used in one message
-
getOverflowDisplay
String getOverflowDisplay()What should variables be replaced with when they exceed the maximum amount- Returns:
- The String to replace the exceeding variables with
-
showEmptyHand
boolean showEmptyHand()Get whether or not the plugin should allow showing with an empty hand- Returns:
- Whether or not to allow showing with an empty hand
-
getShownInv
Get a shown inventory by its id from the cache- Parameters:
id
- The id of the cache entry- Returns:
- The inventory or null if non-existent/expired
-
cacheInv
Cache an inventory of a player. Whether or not it will be a live inventory depends on the plugin config.- Parameters:
player
- The player to cache the inventory for- Returns:
- the id of the cached inventory
-
cacheEnder
Cache an enderchest of a player. Whether or not it will be a live enderchest depends on the plugin config.- Parameters:
player
- The player to cache the enderchest for- Returns:
- the id of the cached enderchest
-
cacheInv
Cache an inventory- Parameters:
invData
- The data of the inventory- Returns:
- The id of the cached inventory
-
shouldShowIcon
boolean shouldShowIcon(org.bukkit.entity.Player player) Check whether or not we should show a text icon to a certain player- Parameters:
player
- The player to check- Returns:
true
if useIconRp is true and FRP is not installed or the player is null or the pack list is empty or he has a pack that contains the icons;false
if useIconRP is false or the player does not have a pack with the icons
-
filterInItem
org.bukkit.inventory.ItemStack filterInItem(org.bukkit.inventory.ItemStack item) Filter strings in an item's display name and lore- Parameters:
item
- The item to filter (will modify the item directly)- Returns:
- The filtered item
-
showItemToAll
void showItemToAll(org.bukkit.entity.Player sender, org.bukkit.inventory.ItemStack item) Show an item to every online player- Parameters:
sender
- The Player who should show the itemitem
- The ItemStack to show
-
showItemToWorld
void showItemToWorld(org.bukkit.entity.Player sender, org.bukkit.inventory.ItemStack item) Show an item to all players in the same world- Parameters:
sender
- The Player who should show the itemitem
- The ItemStack to show
-
showItemInRadius
void showItemInRadius(org.bukkit.entity.Player sender, org.bukkit.inventory.ItemStack item, int radius) Show an item to everyone around the player- Parameters:
sender
- The Player who should show the itemitem
- The ItemStack to showradius
- The radius to show the item in
-
showItemToPlayer
void showItemToPlayer(org.bukkit.entity.Player sender, org.bukkit.entity.Player target, org.bukkit.inventory.ItemStack item) Show an item to another player- Parameters:
sender
- The Player who should show the itemtarget
- The Player to show the item toitem
- The ItemStack to show
-
showInvToAll
Show an inventory to every online player- Parameters:
sender
- The Player who should show the inventoryinvData
- The inventory data
-
showInvToWorld
Show an inventory to all players in the same world- Parameters:
sender
- The Player who should show the inventoryinvData
- The inventory data
-
showInvInRadius
Show an inventory to everyone around the player- Parameters:
sender
- The Player who should show the inventoryinvData
- The inventory dataradius
- The radius to show the inventory in
-
showInvToPlayer
void showInvToPlayer(org.bukkit.entity.Player sender, org.bukkit.entity.Player target, Data invData) Show an inventory to another player- Parameters:
sender
- The Player who should show the inventorytarget
- The Player to show the inventory toinvData
- The inventory data
-
openInvData
Open a GUI to show the inventory data to a player- Parameters:
target
- The target playerinvData
- The data to show- Returns:
- Whether or no the data was valid and could be opened
-
getChatVars()