Commit Graph

54 Commits

Author SHA1 Message Date
Wesley Wolfe
a0ebffc4e0 Add method to get defult leather color. Adds BUKKIT-3203
The default leather color is already used internally in place of null. The
javadocs were updated appropriately to indicate as such.
2012-12-27 13:03:14 -06:00
Wesley Wolfe
4769661a51 Add enchantment storage meta. Adds BUKKIT-3237
Books can 'store' enchantments that can be applied to other items later.
These enchantments exist seperately of enchantments that actually effect the
item, and are as stated 'stored' in the book instead of the book being
enchanted. The meta is generically named as the concept could be applied to
other item types later, such as a enchantment scroll.

All of the methods mimic those in the base meta, but instead specify
'stored' in each method name.
2012-12-21 10:36:17 -06:00
Wesley Wolfe
b119513428 Add FireworkEffect and respective item metas. Adds BUKKIT-3236
FireworkEffect is an immutable class that requires the builder pattern
to construct, to reduce ambiguity and help make code uses more readable.

FireworkMeta contains a list of effects, as well as a flight height.

FireworkEffectMeta contains a single effect for charges.
2012-12-21 10:36:07 -06:00
feildmaster
70b440e189 Update Bukkit to Minecraft 1.4.6 2012-12-20 11:26:32 -06:00
feildmaster
04e2483b71 Refactor get/setChestPlate to Chestplate. Addresses BUKKIT-3189
This method was inconsistent with previous methods.
2012-12-18 03:46:45 -06:00
Wesley Wolfe
7c15e71ef9 Clarify functionality in Inventory. Fixes BUKKIT-3097
Mainly javadoc changes to be specific in functionality and outcomes. This is
mixed with specifying that null Material should throw IllegalArgumentException
instead of the previous undefined NullPointerException.

Included is a clarification on how contains(ItemStack, int) works, and a new
method containsAtLeast(ItemStack, int) for counting the number of a specific
item.
2012-12-17 16:49:12 -06:00
Wesley Wolfe
a06f7b1b86 Add ItemMeta factory and interfaces. This adds BUKKIT-15
Included with ItemMeta is a new serializable class Color.

PotionEffects are now serializable.
2012-12-17 01:16:28 -06:00
feildmaster
5d6592e5d2 Add EntityEquipment API. Adds BUKKIT-3103 2012-12-10 19:09:58 -06:00
EvilSeph
781b77ce52 Add clear inventory API to PlayerInventory with a successful count return. Adds BUKKIT-2745 2012-10-30 04:52:43 -04:00
Travis Watkins
d5d1b41c02 Update Bukkit for Minecraft 1.4(.2) changes. 2012-10-27 22:15:59 -04:00
feildmaster
110ad8c196 Update Bukkit for 1.3.1 changes 2012-08-02 04:54:21 -05:00
feildmaster
537138e9b2 Javadoc updates
Fixes BUKKIT-1653, Fixes BUKKIT-1383 and Fixes BUKKIT-1644
2012-06-03 05:40:54 -05:00
Celtic Minstrel
4d61e585fa [Bleeding] Add iterator() with starting index. Addresses BUKKIT-1246 2012-03-20 19:49:39 -04:00
Celtic Minstrel
a03fe6b74f [Bleeding] Add Inventory.{get,set}MaxStackSize(). Addresses BUKKIT-1076 2012-03-15 22:33:15 -04:00
Celtic Minstrel
f5ac6fc319 [Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default. 2012-03-15 22:24:23 -04:00
Celtic Minstrel
adacb4dbab [Bleeding] Made ItemStack constructors not default to an amount of 0. Fixes BUKKIT-610 2012-03-15 22:16:35 -04:00
Celtic Minstrel
aead3745f2 [Bleeding] Added DoubleChest wrapper so that DoubleChestInventory can return something other than null. Addresses BUKKIT-995 2012-03-15 22:12:43 -04:00
Wesley Wolfe
3d928b7d44 [Bleeding] Fixed crafting enchanted items, fixes BUKKIT-602 2012-03-02 21:01:41 -05:00
Celtic Minstrel
0b77483c2f [Bleeding] Inventory framework and events. Addresses BUKKIT-856
New events:
- InventoryOpenEvent
- InventoryClickEvent - detects any clicks on a slot or outside the window
  - In the creative inventory view, only clicks on the quickbar are detected
- InventoryCloseEvent
- BrewEvent - when a potion finishes brewing
- CraftItemEvent (a subevent of InventoryClickEvent) - fired when taking the crafted item
- PrepareItemCraftEvent - fired just before updating the result slot
Changes to existing events:
- EnchantItemEvent extends InventoryEvent and also has a new whichButton() method
- PrepareItemEnchantEvent also extends InventoryEvent
- FurnaceBurnEvent and FurnaceSmeltEvent now extend BlockEvent (as does BrewEvent)
- PlayerInventoryEvent is deprecated (though it never did anything anyway)
New subclasses of Inventory:
- BrewerInventory
- CraftingInventory
- DoubleChestInventory
- EnchantingInventory
- FurnaceInventory
New methods in Inventory:
- getViewers()
- getTitle()
- getType()
- getHolder()
- iterator() - Yes, inventories are now iterable!
  - The iterator is a ListIterator that does not support add or remove
New methods in Player:
- getOpenInventory()
- openInventory()
- openWorkbench()
- openEnchanting()
- closeInventory()
- setWindowProperty()
- getItemOnCursor()
- setItemOnCursor()
Other changes:
- createInventory() methods in Server to make inventories not linked to an object
- ContainerBlock is deprecated in favour of InventoryHolder
- New InventoryView class gives direct access to an inventory window!
- Removed the Slot class which did nothing and was used nowhere

Some small credit goes to Afforess (initial conception of openInventory() methods) and Drakia (initial conception of InventoryOpenEvent and InventoryCloseEvent).
2012-02-29 15:18:56 -05:00
Wesley Wolfe
7db0e50da7 [Bleeding] Cleaned up unsafe casts. Addresses BUKKIT-844
Removed internal collection leaks from PluginDescriptionFile
BREAKING: PluginDescriptionFile.getAuthors() now returns List instead of
ArrayList

Various places with unsafe generics, notably List<Object> getList() in
Configurations are now referenced as <?>. This is nonbreaking, but
sourcecode will need to be revised when compiled.
2012-02-29 10:23:16 -05:00
Wesley Wolfe
24d0df5830 [Bleeding] Fix deserialization for unsafe enchantments. Fixes BUKKIT-793 2012-02-23 07:12:44 -05:00
Celtic Minstrel
3604da1f55 [Bleeding] Add ways to retrieve and delete crafting recipes and fixed some issues with the existing recipe API.
- New recipe iterator which enables deleting specific recipes
- Functions to delete all recipes or revert to vanilla recipe set
- Fixed the recipes API; you should now be able to define recipes that take brewed potions!
- Fetch all recipes that result in a specific item
2012-02-21 04:11:58 -05:00
Wesley Wolfe
870d10b077 [Bleeding] Cleanup clone methods. 2012-02-20 05:47:03 -05:00
Wesley Wolfe
2131f6966e [Bleeding] Fixed class cast in ItemStack deserialization. Fixes BUKKIT-777 2012-02-19 01:22:07 -05:00
mushroomhostage
c634d7acdb Allow cloning ItemStacks with unsafe enchantments. Fixes BUKKIT-621
Prevents "IllegalArgumentException: Specified enchantment cannot be applied to this itemstack").
2012-02-13 00:46:34 -05:00
starrynte
46284565a7 Fixed casting in ItemStack.deserialize. 2012-02-03 01:54:00 -05:00
Erik Broes
eb9dc64493 Generic cleaning 2012-01-15 14:37:43 +01:00
Nathan Adams
0023c705eb Configurations now properly support lists of serializable objects, and ItemStack is properly serializable. Big thanks to GICodeWarrior for the PR. This fixes BUKKIT-425 2012-01-15 11:15:58 +00:00
Nathan Adams
dae33a62c9 ItemStack.getMaxStackSize no longer incorrectly returns -1 when not backed by an NMS instance. Thanks to feildmaster for the PR. This fixes BUKKIT-530 2012-01-15 10:00:27 +00:00
EvilSeph
f131151325 Fixed NPE in ItemStack. Thanks jascotty2! 2012-01-07 19:58:26 -05:00
Erik Broes
dce83b6ce4 Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Nathan Adams
2d430c131b BREAKING: ItemStack no longer implements Serializable 2011-12-12 23:19:03 +00:00
Nathan Adams
4c8622a306 Fixed issue adding mass enchantments to items 2011-11-27 03:58:12 +00:00
Nathan Adams
514c79f42d Added utility methods to ItemStack to allow mass adding of enchantments 2011-11-27 02:45:08 +00:00
Nathan Adams
755b63ee0f Made ItemStack .equals take into account data and enchantments 2011-11-27 02:25:12 +00:00
Nathan Adams
4a005a0849 Added Enchantment API 2011-11-27 01:35:47 +00:00
Dinnerbone
55f405f4a8 Added new Configuration classes 2011-10-10 21:06:34 +01:00
Dinnerbone
e6c273e8b0 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Erik Broes
c4d444ce98 Whitespace + general cleanup 2011-05-15 14:06:02 +02:00
sk89q
2406a4496d Added dispenser event. 2011-05-08 02:57:26 -07:00
Raphfrk
f96a416785 Added setArmorContents as a method for PlayerInventory. 2011-05-02 02:08:06 -04:00
Celtic Minstrel
2b408e236a Add recipe classes and an addRecipe method in the server interface. 2011-05-01 23:40:15 -04:00
Erik Broes
d94fce59ff Updated README for line-ending demands, also fixed line-endigs. 2011-04-25 13:24:32 +02:00
EvilSeph
4ffc9a6d57 Fixed getData() not returning the correct values. 2011-04-25 07:17:12 -04:00
VictorD
cd490d826b Added a few null pointer checks and performed minor touchups (tried improving a few equals, clone and hashCode methods). 2011-03-05 12:27:51 +01:00
Limb
6460e3fdec Implemented Inventory.contains with a minimum amount of item required. As per feature request #187 2011-02-04 04:06:04 +08:00
Erik Broes
8039c05c9f General cleanup (deprecated+whitespace) 2011-02-02 00:28:41 +01:00
Dinnerbone
8ccfad9456 Renamed ItemStack.set/getDamage to durability, which is now a short. Added Material.getMaxDurability 2011-01-31 01:06:53 +00:00
Tahg
b274a7faec fixed storage of data field 2011-01-17 17:39:27 -05:00
Erik Broes
1f94399da6 Updated Inventory with proper generics, fixed ItemStack to have data as 'Byte' so we can put in nulls when not having data. 2011-01-17 01:50:33 +01:00