public final class ContainerDedication
extends org.bukkit.plugin.java.JavaPlugin
implements org.bukkit.event.Listener
| Constructor and Description |
|---|
ContainerDedication() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowedCheck(org.bukkit.inventory.ItemStack stk,
org.bukkit.inventory.InventoryHolder destHolder)
Check to see if a stack of items is allowed inside the destination container.
|
boolean |
allowInventoryAdd(org.bukkit.Material itemType,
org.bukkit.inventory.Inventory destInvent)
Check if an inventory move is allowed when only given the destination inventory and an item being
put into it.
|
void |
blockDestroyHandler(org.bukkit.event.block.BlockBreakEvent event)
Event handler to watch whenever a block is destroyed.
|
void |
blockPlaceHandler(org.bukkit.event.block.BlockPlaceEvent event)
An event handler to watch for whenever a container block is placed.
|
void |
clearContainerConfig(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
boolean report)
Reset a container back to being un-dedicated again, deleting any configuration
information this plugin has for it.
|
void |
clearNextContainerPut(org.bukkit.entity.Player doPlayer)
Set things so that the next container block this player places
will NOT be a Dedicated container.
|
org.bukkit.inventory.InventoryHolder |
convertToLeftSingle(org.bukkit.inventory.InventoryHolder ih)
Given an inventory holder which MIGHT be a doublechest or might not, return
the lefthand side inventory holder if it's a double, else just return itself
again if its a single.
|
org.bukkit.configuration.ConfigurationSection |
getContainerSection(java.lang.String cId)
Get the section in the config that corresponds to the given container id.
|
org.bukkit.block.BlockState |
getDoubleChestPartner(org.bukkit.block.BlockState bs)
If the block passed in is a part of a double chest, then return the blockstate
for the other half of the chest.
|
void |
infoDumpFor(org.bukkit.command.CommandSender sender,
org.bukkit.block.BlockState bs)
Execute a "/dedicate info" command.
|
void |
inventoryClickEventHandler(org.bukkit.event.inventory.InventoryClickEvent event)
Event handler called whenever a player clicks on a slot somewhere on a gui
screen inventory transfer window (this means when moving items into a chest, or
into a furnace, etc).
|
void |
inventoryDragEventHandler(org.bukkit.event.inventory.InventoryDragEvent event)
Event handler called whenever a player drags across several slots on a gui
screen inventory transfer window (this means when moving items into a chest, or
into a furnace, etc).
|
void |
inventoryMoveHandler(org.bukkit.event.inventory.InventoryMoveItemEvent event)
Event handler to watch whenever a container tries to move an item to another container.
|
void |
inventoryPickupItemEventHandler(org.bukkit.event.inventory.InventoryPickupItemEvent event)
Event handler called whenever a floating item icon is sucked into an inventory,
such as when a player walks across an item and it "pops" into the player, or when
an item hovering over a hopper is sucked up by the hopper.
|
java.lang.String |
makeContainerId(org.bukkit.block.BlockState bs)
Construct a string ID to be used to identify the section in the YAML
file that stores the data about the dedicated container being passed in.
|
void |
newContainerConfig(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
boolean defVal)
Cause a new Dedicated Container to exist by writing its default starting config out.
|
boolean |
nextToDedicatedSingleChest(org.bukkit.Location here)
Check to see if the location passed in is adjacent to an existing single chest that is
already a dedicated container.
|
boolean |
onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command cmd,
java.lang.String label,
java.lang.String[] args)
Standard Bukkit plugin onCommand - responds to the things players type at the / command prompt
|
void |
onDisable()
Standard Bukkit plugin onDisable stuff - write the config out one last time just to be sure.
|
void |
onEnable()
Standard Bukkit plugin onEnable stuff - read the config and register the event handlers.
|
void |
setAllow(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
org.bukkit.inventory.ItemStack doStack,
boolean allow)
Add an item type to the list of exceptions for a Dedicated container.
|
void |
setDefault(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
boolean defVal)
Change the nature of a dedicated container from whitelist to blacklist, or visa versa
|
void |
setNextContainerPut(org.bukkit.entity.Player doPlayer,
boolean bVal)
Set things so that the next container block this player places
will be a Dedicated container.
|
getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getLogger, getPluginLoader, getResource, getServer, isEnabled, isInitialized, isNaggable, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setNaggable, toStringpublic void onEnable()
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginpublic void onDisable()
onDisable in interface org.bukkit.plugin.PluginonDisable in class org.bukkit.plugin.java.JavaPluginpublic boolean onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command cmd,
java.lang.String label,
java.lang.String[] args)
onCommand in interface org.bukkit.command.CommandExecutoronCommand in class org.bukkit.plugin.java.JavaPluginsender - Player (or console) who gave the commandcmd - command - the first whitespace-separated term on the command linelabel - no idea what this is, actuallyargs - all other whitespace-separated terms on the command line after the firstpublic java.lang.String makeContainerId(org.bukkit.block.BlockState bs)
bs - the blockstate for a block somewhere in the world.public org.bukkit.block.BlockState getDoubleChestPartner(org.bukkit.block.BlockState bs)
bs - the block being checked to see if it is part of a double chestpublic org.bukkit.inventory.InventoryHolder convertToLeftSingle(org.bukkit.inventory.InventoryHolder ih)
ih - an inventory which may or may not be a doublechestpublic boolean nextToDedicatedSingleChest(org.bukkit.Location here)
here - place being checked forpublic org.bukkit.configuration.ConfigurationSection getContainerSection(java.lang.String cId)
cId - the container ID to look for (caller should have generated it with makeContainerId() )makeContainerIdpublic void infoDumpFor(org.bukkit.command.CommandSender sender,
org.bukkit.block.BlockState bs)
sender - person who issued the command (and will see the results)bs - the target block that the command was issued upon.public void newContainerConfig(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
boolean defVal)
doPlayer - player who issued the commandbs - container being made into a dedicated containerdefVal - true if the container should allow all items except those
that are explicitly given exception rules (a blacklist) or false if the container should
deny all items by default except those explicitly given exception rules (a whitelist).public void clearContainerConfig(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
boolean report)
doPlayer - player who's doing itbs - container being affectedreport - true if a message should be shown to the player acknowledging that it happened.public void setDefault(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
boolean defVal)
doPlayer - player who's doing itbs - container being affecteddefVal - true if setting it to accept items not explicitly disallowed (blacklist), or
false if setting it to deny items not explicitly allowed (whitelist).public void setNextContainerPut(org.bukkit.entity.Player doPlayer,
boolean bVal)
doPlayer - player to do it forbVal - whether the pending future dedicated container will be whitelist or blacklist
(true=blacklist, false=whitelist).clearNextContainerPutpublic void clearNextContainerPut(org.bukkit.entity.Player doPlayer)
doPlayer - setNextContainerPutpublic void setAllow(org.bukkit.entity.Player doPlayer,
org.bukkit.block.BlockState bs,
org.bukkit.inventory.ItemStack doStack,
boolean allow)
doPlayer - the player doing itbs - the container being configureddoStack - an example showing what is the type of item being given a ruleallow - true to set the container to allow items of this type, or false to
set the container to disallow items of this typepublic boolean allowedCheck(org.bukkit.inventory.ItemStack stk,
org.bukkit.inventory.InventoryHolder destHolder)
stk - a stack of items being tested to see if it's allowed in the container.destHolder - the containerpublic void blockPlaceHandler(org.bukkit.event.block.BlockPlaceEvent event)
event - data about the event given by the systemsetNextContainerPutpublic void blockDestroyHandler(org.bukkit.event.block.BlockBreakEvent event)
event - data about the event given by the systempublic void inventoryMoveHandler(org.bukkit.event.inventory.InventoryMoveItemEvent event)
event - data about the event given by the systempublic void inventoryClickEventHandler(org.bukkit.event.inventory.InventoryClickEvent event)
event - public void inventoryDragEventHandler(org.bukkit.event.inventory.InventoryDragEvent event)
event - public void inventoryPickupItemEventHandler(org.bukkit.event.inventory.InventoryPickupItemEvent event)
event - public boolean allowInventoryAdd(org.bukkit.Material itemType,
org.bukkit.inventory.Inventory destInvent)
itemType - kind of item being sucked in.destInvent - place it's going.