172 Commits

Author SHA1 Message Date
Travis Watkins
2ea133bb99 Provide a faster way to get a location. Adds BUKKIT-3120
Currently when a plugin wants to get the location of something it calls
getLocation() which returns a new Location object. In some scenarios this
can cause enough object creation/destruction churn to be a significant
overhead. For this cases we add a method that updates a provided Location
object so there is no object creation done. This allows well written code
to work on several locations with only a single Location object getting
created.

Providing a more efficient way to set a location was also looked at but
the current solution is the fastest we can provide. You are not required
to create a new Location object every time you want to set something's
location so, with proper design, you can set locations with only a single
Location object being created.
2012-12-07 21:18:31 -06:00
feildmaster
7aa2a077b6 Add API to get and set collar colors of wolves 2012-12-05 18:03:24 -06:00
Travis Watkins
ccf33ccdfb Add API for controlling mob despawn away from players. Adds BUKKIT-2986 2012-12-04 21:30:44 -06:00
James Clarke
bc5e54d904 Add API for getting and setting Skeleton and Zombie types. Fixes BUKKIT-2818 2012-11-17 10:05:53 -06:00
h31ix
d982f94d8c Add API for ItemFrames. Adds BUKKIT-2668
As well as adding methods for ItemFrames, this moves some methods
previously contained in Painting to Hanging, as they are shared by both
classes.

An enum was added that represents rotations, similar to a clock-face.
This is needed as a contrast to cardinal direction based rotations.
2012-10-31 01:19:33 -05:00
EvilSeph
8b5440766c Update ExpCommand with levels support. Fixes BUKKIT-2683 and partially fixes BUKKIT-2671 2012-10-29 23:18:18 -04:00
feildmaster
2c8199c1f3 Revert FIREBALL being renamed to LARGE_FIREBALL 2012-10-29 19:59:53 -05:00
EvilSeph
8d77e844f7 Expose setBedSpawnLocation with force option. Adds BUKKIT-2709 2012-10-29 04:58:51 -04:00
Travis Watkins
a446bb7e8f Update Bukkit for Minecraft 1.4(.2) changes. 2012-10-27 22:15:59 -04:00
feildmaster
5cc04e5398 Add API for Sound, and playing the sounds for Worlds and Players. Adds BUKKIT-1430, BUKKIT-1226 and BUKKIT-2019 2012-08-21 17:15:48 -05:00
feildmaster
b8d2882de6 Add API to retrieve a players EnderChest. Adds BUKKIT-2016 2012-08-20 16:01:35 -05:00
feildmaster
11fd4acb56 Add interface for spawning FallingBlocks and correctly spawn a FallingBlock with the spawn(Location, FallingBlock.class) method. Adds BUKKIT-2282
Also add FallingBlock and methods.

Deprecated FallingSand to emphasize FallingBlock.
2012-08-14 07:39:44 -05:00
Wesley Wolfe
c72b55f12e Add API to set and get movement modifiers. Addresses BUKKIT-2205 2012-08-10 00:19:21 -05:00
feildmaster
77bdf88cd6 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
16d0694dcf Add an isValid() method to Entity. Addresses BUKKIT-810 2012-06-28 19:33:33 -05:00
TomyLobo
d3bf76da9d Add LivingEntity.hasLineOfSight. Addresses BUKKIT-1255 2012-06-23 10:58:01 -05:00
feildmaster
062a3df78d Javadoc updates
Fixes BUKKIT-1653, Fixes BUKKIT-1383 and Fixes BUKKIT-1644
2012-06-03 05:40:54 -05:00
Wesley Wolfe
eb8f92c83a Add getName() to AnimalTamer 2012-05-24 22:33:45 -05:00
Nathan Adams
4a3a177ddd 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
3bd599f8ab [Bleeding] Added Ageable interface for Villagers and Animals to extend. Addresses BUKKIT-1232 2012-03-21 15:43:19 -04:00
aPunch
c74338d550 [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
668c369ecc [Bleeding] Added Player.isBlocking(). Addresses BUKKIT-858 2012-03-13 19:41:33 -04:00
EvilSeph
101756dcc1 Made Ocelot implement isSitting() and setSitting(). Fixes BUKKIT-993 2012-03-09 15:01:28 -05:00
Celtic Minstrel
ae64bc3da3 Fix incorrect entity ID for iron golem. Addresses BUKKIT-1088 2012-03-08 15:11:27 -05:00
Nathan Adams
bfe455e1b6 Added Villager API for getting/setting Profession. This adds BUKKIT-887 2012-03-03 01:58:30 +00:00
Nathan Adams
0a9cf32d3a Fixed Ocelot.Type lookup - this fixes BUKKIT-952 2012-03-03 00:46:27 +00:00
Nathan Adams
039088e974 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
463856b8a0 [Bleeding] Added Conversations API. Addresses BUKKIT-864 2012-03-01 03:52:18 -05:00
Celtic Minstrel
ac51658471 Adding/expanding documentation 2012-02-29 21:31:33 -05:00
Celtic Minstrel
d839b6d639 Fix javadoc errors/warnings 2012-02-29 21:31:28 -05:00
EvilSeph
953dad94c2 Re-added launchProjectile lost due to incorrect conflict resolution. 2012-02-29 18:31:20 -05:00
Celtic Minstrel
8a458ca273 [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
0db822f609 Implementation of richer playEffect methods. Addresses BUKKIT-857 2012-02-29 15:02:59 -05:00
TomyLobo
0b50669c8b Moved getVehicle, leaveVehicle and isInsideVehicle from LivingEntity to Entity. Addresses BUKKIT-811 2012-02-29 13:26:25 -05:00
rmichela
cd732ee3f7 [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
e0fc150d8f [Bleeding] Fixed EntityType errors. Fixes BUKKIT-800 2012-02-23 16:10:07 -05:00
aPunch
697e67f3e6 [Bleeding] Added launchProjectile.
Use launchProjectile in place of individual throwSnowball, throwEgg, and shootArrow methods
2012-02-23 05:54:16 -05:00
Celtic Minstrel
ce4a390b00 [Bleeding] Added EntityType to replace CreatureType. 2012-02-22 22:06:19 -05:00
Erik Broes
049a7cc1d0 Deprecation cleanup. 2012-02-18 13:05:58 -05:00
fullwall
d99c95f6d1 [Bleeding] Added Potions API. Fixes BUKKIT-389 2012-02-10 17:26:38 -05:00
Travis Watkins
5e6125e01b [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
8d2637ee0d Added entity type IDs as per vanilla spec. 2012-02-03 02:07:05 -05:00
Aidan Matzko
26a6a1edf4 [Bleeding] Added Sheep, Shear and EntityChangeBlock API. Thanks tips48! Closes BUKKIT-512 2012-01-23 18:57:37 -05:00
Nathan Adams
c29a93a8c1 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
95e3f07b69 Add Player.setBedSpawnLocation(Location). Thanks md_5 2012-01-17 22:43:16 +01:00
Erik Broes
ef63530432 [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
88c17a7f86 Generic cleaning 2012-01-15 14:37:43 +01:00
Nathan Adams
96b3a075af Added Player set/getAllowFlight methods. Thanks to Qala for the PR. 2012-01-15 10:55:33 +00:00
Nathan Adams
65cf915a15 Fixed documentation of getNearbyEntities in Entity. Thanks to epuidokas for the PR. 2012-01-15 07:38:14 +00:00
Nathan Adams
2c1cd77cdc 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