Commit Graph

996 Commits

Author SHA1 Message Date
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
Celtic Minstrel
aaea53c517 Implementation of richer playEffect methods. Addresses BUKKIT-857 2012-02-29 15:02:59 -05:00
EvilSeph
50bd232814 Fixed PlayerPortalEvent constructor. 2012-02-29 14:27:05 -05:00
James Clarke
09fa3a4c59 Added NETHER_PORTAL and END_PORTAL to the TeleportCause enum. Addresses BUKKIT-265
Added new NETHER_PORTAL and END_PORTAL values to the TeleportCause enum
and relevant constructor for PlayerPortalEvent.
2012-02-29 14:00:34 -05:00
Kevin
29fb7d9d88 Fixed null pointer exception in config.getMapList(). 2012-02-29 13:26:26 -05:00
TomyLobo
ac257ba8a8 Moved getVehicle, leaveVehicle and isInsideVehicle from LivingEntity to Entity. Addresses BUKKIT-811 2012-02-29 13:26:25 -05:00
rmichela
a2c69f9f51 [Bleeding] Added a Metadata framework for Entities, Blocks, and Worlds
This metadata implementation has the following features:

- All metadata is lazy. Metadata values are not actually computed until another plugin requests them. Memory and CPU are conserved by not computing and storing unnecessary metadata values.

- All metadata is cached. Once a metadata value is computed its value is cached in the metadata store to prevent further unnecessary computation. An invalidation mechanism is provided to flush the cache and force recompilation of metadata values.

- All metadata is stored in basic data types. Convenience methods in the MetadataValue class allow for the conversion of metadata data types when possible. Restricting metadata to basic data types prevents the accidental linking of large object graphs into metadata. Metadata is persistent across the lifetime of the application and adding large object graphs would damage garbage collector performance.

- Metadata access is thread safe. Care has been taken to protect the internal data structures and access them in a thread safe manner.

- Metadata is exposed for all objects that descend from Entity, Block, and World. All Entity and World metadata is stored at the Server  level and all Block metadata is stored at the World level.

- Metadata is NOT keyed on references to original objects - instead metadata is keyed off of unique fields within those objects. Doing this allows metadata to exist for blocks that are in chunks not currently in memory. Additionally, Player objects are keyed off of player name so that Player metadata remains consistent between logins.

- Metadata convenience methods have been added to all Entities, Players, Blocks, BlockStates, and World allowing direct access to an individual instance's metadata.

- Players and OfflinePlayers share a single metadata store, allowing player metadata to be manipulated regardless of the player's current online status.
2012-02-29 19:16:04 +01: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
Score_Under
145be1538d [Bleeding] Fixed file handle leak in /timings command. Addresses BUKKIT-853 2012-02-29 09:52:57 -05:00
Wesley Wolfe
a60a7b6bf7 [Bleeding] Fixes deadlock issue and generic usage. Fixes BUKKIT-844 and fixes BUKKIT-854 2012-02-29 09:50:03 -05:00
SpaceManiac
86e029a924 [Bleeding] Fixed MapPalette.imageToBytes to properly handle transparency. Addresses BUKKIT-852 2012-02-29 01:53:29 -05:00
TomyLobo
2e12e3ec8a Narrowed down the return type of most EntityEvent subclasses for convenience. Addresses BUKKIT-809 2012-02-28 21:57:17 -05:00
TomyLobo
6c7fb871c5 Event system optimizations. Addresses BUKKIT-813
- Made the handlers field a simple array instead of an array of arrays.
- Got rid of the "baked" field.
2012-02-28 21:57:16 -05:00
TomyLobo
7a48899d2d Reduced excessive exception handling in NumberConversions. Addresses BUKKIT-825
This also allows, for instance, to parse complex numbers with imaginary part=0, if the according toString method omits zero components.
This also saves some unboxing (Foo.valueOf returns a wrapper, while Foo.parseFoo returns a primitive)
2012-02-28 17:20:51 -05:00
TomyLobo
b0bb7aaa66 Added missing BlockState functions. Addresses BUKKIT-807 2012-02-27 17:52:44 -05:00
EdGruberman
cf2b0b5247 Adjust plugin enable/disable logging 2012-02-26 15:45:17 -05:00
Sam Wilson
884a2fe4c8 Add a CreateReason to PortalCreateEvent. Addresses BUKKIT-833 2012-02-26 15:19:29 -05:00
zml2008
e891176aa7 Added service register and unregister events. Addresses BUKKIT-816 2012-02-26 12:15:36 -05:00
Celtic Minstrel
c7508cd097 [Bleeding] Add constructor to BlockFromToEvent for dragon egg teleportation. Addresses BUKKIT-828 2012-02-25 19:10:28 -05:00
Celtic Minstrel
c69d99f0fa [Bleeding] Fixed potion tests. 2012-02-25 18:06:20 -05:00
Celtic Minstrel
9b5feab9c8 [Bleeding] Add missing methods to Bukkit class, fix non-static methods, and add a junit test to ensure both these problems will be caught in future. 2012-02-25 16:59:27 -05:00
Celtic Minstrel
27d98788cc [Bleeding] Add ability for the Potion class to represent no-effect
potions. Addresses BUKKIT-817

- Potion's type can be null
- Add Potion.setType()
- New Potion constructors which do not take a PotionType parameter
- Potion constructor chainers splash() and extend() added
- Add PotionType.getMaxLevel() and PotionType.isInstant()
- Add PotionType.WATER which is a very special case
- Make PotionType.getDamageValue() public
2012-02-25 02:49:21 -05:00
Celtic Minstrel
66edb2e5f7 [Bleeding] Deprecate the pointless Potion.Tier enum in favour of a numeric level. Addresses BUKKIT-818 2012-02-25 02:49:04 -05:00
EvilSeph
fc9a43c6e4 Updated README.md with more coding and pull request conventions and tips to get your pull request accepted. 2012-02-24 00:09:28 -05:00
Feildmaster
4ed32f8c67 [Bleeding] Fixed EntityType errors. Fixes BUKKIT-800 2012-02-23 16:10:07 -05:00
Wesley Wolfe
24d0df5830 [Bleeding] Fix deserialization for unsafe enchantments. Fixes BUKKIT-793 2012-02-23 07:12:44 -05:00
aPunch
c0e2ade335 [Bleeding] Added launchProjectile.
Use launchProjectile in place of individual throwSnowball, throwEgg, and shootArrow methods
2012-02-23 05:54:16 -05:00
Celtic Minstrel
cbb9bc0fa3 [Bleeding] Added EntityType to replace CreatureType. 2012-02-22 22:06:19 -05:00
Feildmaster
4b9f306913 [Bleeding] Added BlockGrowEvent. Addresses BUKKIT-104 2012-02-22 21:46:15 -05:00
Feildmaster
c568f49c24 [Bleeding] getHandlers() is now abstract. 2012-02-21 14:26:14 -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
Feildmaster
eace91d627 Improved readability for /whitelist list. Addresses BUKKIT-772 2012-02-19 10:29:14 -05:00
Feildmaster
ca71be0228 [Bleeding] Event no longer implements Serializable. 2012-02-19 04:10:07 -05:00
Feildmaster
219d005e1d [Bleeding] Remove deprecated events (EndermanPickup/Place). 2012-02-19 04:10:06 -05:00
Feildmaster
b09c56d57d [Bleeding] Specify event name in exception. Addresses BUKKIT-778 2012-02-19 04:10:06 -05:00
Wesley Wolfe
08eed206b1 [Bleeding] Added Enchantment and misc tests to ItemStack (de)serialization 2012-02-19 04:10:05 -05:00
Wesley Wolfe
fa31bf889c [Bleeding] Added Enchantment and misc tests to ItemStack (de)serialization 2012-02-19 01:24:42 -05:00
Wesley Wolfe
2131f6966e [Bleeding] Fixed class cast in ItemStack deserialization. Fixes BUKKIT-777 2012-02-19 01:22:07 -05:00
Wesley Wolfe
a294e9c246 [Bleeding] Exception cleanup. Addresses BUKKIT-774 2012-02-18 23:55:35 -05:00
Wesley Wolfe
f8804423bf [Bleeding] Skip InvocationTargetException. Addresses BUKKIT-774 2012-02-18 23:54:57 -05:00
SpaceManiac
45833c282d [Bleeding] Added ability to unregister listeners, updated javadoc and
renamed allLists. Addresses BUKKIT-773
2012-02-18 21:36:06 -05:00
Mike Primm
bdfe249fd7 Add getEntitiesByClass(Class<T>) and getEntitiesByClasses(Class<?>...), deprecate getEntitiesByClass(Class<T>...) 2012-02-18 21:36:06 -05:00
EvilSeph
9a80e7630a Fixed Validate message. 2012-02-18 15:28:33 -05:00
EvilSeph
2b137c5a9b Updated EntityTeleportEvent in line with deprecation cleanup. 2012-02-18 13:13:50 -05:00
Erik Broes
7a06777e19 Deprecation cleanup. 2012-02-18 13:05:58 -05:00
Erik Broes
52822729b0 Added RemoteServerCommandEvent. 2012-02-18 12:53:30 -05:00
fullwall
9e669d7d3d [Bleeding] Made PotionEffectTypes final, added reasons for deprecation.
Fixes BUKKIT-768 and BUKKIT-769
2012-02-18 10:48:19 -05:00
EvilSeph
594400d5ed Updated version to 1.1-R5-SNAPSHOT for development towards next release. 2012-02-13 14:29:32 -05:00
EvilSeph
7a0d4cbd1d Updated version to 1.1-R4 in pom.xml for RB. 2012-02-13 11:31:29 -05:00