Commit Graph

209 Commits

Author SHA1 Message Date
feildmaster
ec51c24641 Add API to get a players experience to level (getExpToLevel). Implements BUKKIT-1906
This is the total experience one needs to gain a level.
2012-07-11 17:12:26 -05:00
TomyLobo
945ff9eebb Add an isValid() method to Entity. Addresses BUKKIT-810 2012-06-28 19:33:33 -05:00
TomyLobo
6525a30e74 Add LivingEntity.hasLineOfSight. Addresses BUKKIT-1255 2012-06-23 10:58:01 -05:00
feildmaster
537138e9b2 Javadoc updates
Fixes BUKKIT-1653, Fixes BUKKIT-1383 and Fixes BUKKIT-1644
2012-06-03 05:40:54 -05:00
Wesley Wolfe
5630ae217c Add getName() to AnimalTamer 2012-05-24 22:33:45 -05:00
Nathan Adams
153168d8bd Added player.isFlying|setFlying to check if a player is flying, or make them fly/not. This implements BUKKIT-1281. 2012-03-22 22:03:47 +00:00
aPunch
ff9aecf4be [Bleeding] Added Ageable interface for Villagers and Animals to extend. Addresses BUKKIT-1232 2012-03-21 15:43:19 -04:00
aPunch
12a411afb1 [Bleeding] Added way to get/set if an Iron Golem was player created. Addresses BUKKIT-1229 2012-03-20 05:13:22 -04:00
Celtic Minstrel
e783a03aa3 [Bleeding] Added Player.isBlocking(). Addresses BUKKIT-858 2012-03-13 19:41:33 -04:00
EvilSeph
4c2068702a Made Ocelot implement isSitting() and setSitting(). Fixes BUKKIT-993 2012-03-09 15:01:28 -05:00
Celtic Minstrel
99e1a92191 Fix incorrect entity ID for iron golem. Addresses BUKKIT-1088 2012-03-08 15:11:27 -05:00
Nathan Adams
94a61cc3a5 Added Villager API for getting/setting Profession. This adds BUKKIT-887 2012-03-03 01:58:30 +00:00
Nathan Adams
23aaa912a4 Fixed Ocelot.Type lookup - this fixes BUKKIT-952 2012-03-03 00:46:27 +00:00
Nathan Adams
25f303ccde Added a bunch of new 1.2 entities; this partially resolves BUKKIT-872 and BUKKIT-885. 2012-03-01 18:01:40 +00:00
rmichela
49c34510e3 [Bleeding] Added Conversations API. Addresses BUKKIT-864 2012-03-01 03:52:18 -05:00
Celtic Minstrel
18a4a25c8b Adding/expanding documentation 2012-02-29 21:31:33 -05:00
Celtic Minstrel
17403d617a Fix javadoc errors/warnings 2012-02-29 21:31:28 -05:00
EvilSeph
de1a89f90f Re-added launchProjectile lost due to incorrect conflict resolution. 2012-02-29 18:31:20 -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
Celtic Minstrel
aaea53c517 Implementation of richer playEffect methods. Addresses BUKKIT-857 2012-02-29 15:02:59 -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
Feildmaster
4ed32f8c67 [Bleeding] Fixed EntityType errors. Fixes BUKKIT-800 2012-02-23 16:10:07 -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
Erik Broes
7a06777e19 Deprecation cleanup. 2012-02-18 13:05:58 -05:00
fullwall
f229d6fe83 [Bleeding] Added Potions API. Fixes BUKKIT-389 2012-02-10 17:26:38 -05:00
Travis Watkins
103ead4346 [Bleeding] Added Vanish API for hiding players from each other.
Adds Player.hidePlayer, Player.showPlayer, and Player.canSee for managing
what players are hidden from a player. When someone is hidden from a player
the player cannot see them in the user list or /list and they cannot /tell
them so they appear to be completely gone from the server.
2012-02-03 03:32:21 -05:00
Jeremy Wood
4e92f59d4c Added entity type IDs as per vanilla spec. 2012-02-03 02:07:05 -05:00
Aidan Matzko
3a7c82f7cd [Bleeding] Added Sheep, Shear and EntityChangeBlock API. Thanks tips48! Closes BUKKIT-512 2012-01-23 18:57:37 -05:00
Nathan Adams
d83c2e17ec Player.setPlayerListName no longer ignores colour length in size limit. This relates to BUKKIT-571 2012-01-19 15:10:14 +00:00
Erik Broes
a210df5d52 Add Player.setBedSpawnLocation(Location). Thanks md_5 2012-01-17 22:43:16 +01:00
Erik Broes
992fa6d039 [Bleeding] Add Animals: setAgeLock(bool), bool getAgeLock, void setBaby, void setAdult, void setBreed(bool), bool canBreed and bool isAdult. 2012-01-17 19:44:18 +01:00
Erik Broes
eb9dc64493 Generic cleaning 2012-01-15 14:37:43 +01:00
Nathan Adams
c84c5a2132 Added Player set/getAllowFlight methods. Thanks to Qala for the PR. 2012-01-15 10:55:33 +00:00
Nathan Adams
3a89a0b643 Fixed documentation of getNearbyEntities in Entity. Thanks to epuidokas for the PR. 2012-01-15 07:38:14 +00:00
Nathan Adams
589f528f7f Updated javadocs of Player.setPlayerListName to reflect that the char limit is based on length without colours 2012-01-14 17:42:57 +00:00
Nathan Adams
e03e2cc1c2 Added entity.playEffect, thanks to main-- in an (unfortunately old) PR. 2012-01-14 17:35:52 +00:00
Nathan Adams
55cc8722c8 Implemented new Plugin Message API - see http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ 2012-01-13 08:53:14 +00:00
Erik Broes
dce83b6ce4 Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Tahg
23e3fbaa07 Fixed some naming issues for creature types. Fix for BUKKIT-367 2011-12-20 18:01:44 -05:00
Nathan Adams
0d41282a7f Added getKiller() method to LivingEntity, to determine the killer of an entity 2011-12-11 16:04:37 +00:00
Nathan Adams
19a96434b3 Added cause to PlayerTeleportEvent 2011-12-04 11:03:32 +00:00
Nathan Adams
6ea784f58c Deprecated player methods: getExperience setExperience due to new float value. Added giveExp, setExp, getExp 2011-11-30 22:30:47 +00:00
Andrew Ardill
b9862ea779 Extend EntityCombustEvent to allow setting combustion duration.
Also extend with two new events that track the entity or block that caused
the combustion.
2011-11-29 20:56:08 +11:00
Andrew Ardill
e1410a61c5 Add MagmaCube interface.
Also, add MagmaCube to CreatureType Enum, as per BUKKIT-57. Thanks snowleo!
2011-11-28 11:12:08 +11:00
Andrew Ardill
14bdefcaa1 BUKKIT-57 Add Snowman to CreatureType Enum. Thanks snowleo! 2011-11-28 10:48:02 +11:00
Nathan Adams
b2e91c6cc4 Added new set/get age methods to Animals 2011-11-24 20:16:16 +00:00
Nathan Adams
884d7daa9f Added EnderCrystal entity 2011-11-21 22:37:37 +00:00
Nathan Adams
bac82e018b Added various new 1.9 entities, blocks and items 2011-11-19 20:23:27 -08:00