Package com.vk2gpz.maxstack
Class MaxStack
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.vk2gpz.maxstack.MaxStack
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
,org.bukkit.command.TabExecutor
,org.bukkit.plugin.Plugin
public class MaxStack
extends org.bukkit.plugin.java.JavaPlugin
-
Constructor Summary
Constructors Constructor Description MaxStack()
-
Method Summary
Modifier and Type Method Description static org.bukkit.entity.Item
dropItem(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemstack, int amount)
This method will drop an item at the specified location.static org.bukkit.entity.Item
dropItemNaturally(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemstack, int amount)
This method will drop an item at the specified location in natural fashion.static int
getAmount(org.bukkit.entity.Item item)
This method will return the amount of ItemStack objects represented by this item.static org.bukkit.inventory.ItemStack[]
getStacks(org.bukkit.entity.Item item)
This method will return an array of ItemStack objects represented by the specified item.static boolean
isMaxStack(org.bukkit.entity.Item item)
This method will return true if the specified item is associated with ItemStack object, which represents more than max stack size.void
onDisable()
void
onEnable()
static org.bukkit.entity.Item
pickup(org.bukkit.entity.Item item, org.bukkit.inventory.Inventory inv)
This method will pickup as many itemstack objects as it can into the specified inventory.Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
-
Constructor Details
-
MaxStack
public MaxStack()
-
-
Method Details
-
onDisable
public void onDisable()- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
onEnable
public void onEnable()- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
isMaxStack
public static boolean isMaxStack(org.bukkit.entity.Item item)This method will return true if the specified item is associated with ItemStack object, which represents more than max stack size.- Parameters:
item
- The item object to be examined.- Returns:
- true if the specified item is associated with ItemStack object, which represents more than max stack size.
-
getAmount
public static int getAmount(org.bukkit.entity.Item item)This method will return the amount of ItemStack objects represented by this item.- Parameters:
item
- The item to be examined.- Returns:
- the amount of ItemStack objects represented by this item.
-
getStacks
public static org.bukkit.inventory.ItemStack[] getStacks(org.bukkit.entity.Item item)This method will return an array of ItemStack objects represented by the specified item.- Parameters:
item
- The item to be examined.- Returns:
- An array of ItemStack objects represented by the specified item.
-
pickup
public static org.bukkit.entity.Item pickup(org.bukkit.entity.Item item, org.bukkit.inventory.Inventory inv)This method will pickup as many itemstack objects as it can into the specified inventory. Whatever left over will remain in the specifed item object.- Parameters:
item
- The item to be pickedup.inv
- The inventory to which the item stack objects are picked up.- Returns:
- Item object to be left on the ground if all ItemStack objects were not picked up, otherwise null.
-
dropItemNaturally
public static org.bukkit.entity.Item dropItemNaturally(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemstack, int amount)This method will drop an item at the specified location in natural fashion. If the amount is greater than itemstack's max stack size, the dropped item will be a max stack item representing more than max stack size ItemStack objects,- Parameters:
location
- The location to be dropped atitemstack
- The base ItemStack object to drop.amount
- The total number of ItemStack object to be dropped.- Returns:
- The spawned (dropped) item representing the specifed amount of ItemStack objects.
-
dropItem
public static org.bukkit.entity.Item dropItem(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemstack, int amount)This method will drop an item at the specified location. If the amount is greater than itemstack's max stack size, the dropped item will be a max stack item representing more than max stack size ItemStack objects,- Parameters:
location
- The location to be dropped atitemstack
- The base ItemStack object to drop.amount
- The total number of ItemStack object to be dropped.- Returns:
- The spawned (dropped) item representing the specifed amount of ItemStack objects.
-