59 Commits

Author SHA1 Message Date
meiskam
c633a472db Add Skull BlockState and Type enum. Adds BUKKIT-3258 2012-12-21 22:24:50 -06:00
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
1a5998a5d5 [BREAKING] Update BlockFace directions. Fixes BUKKIT-1567, BUKKIT-3069
If you use BlockFace in any way, to compensate the directionals being incorrect, you can still have backwards compatibility if you add in the handling in your plugin:
boolean legacyBlockFace = BlockFace.NORTH().getModX() == -1; (and then handle it accordingly)

If you didn't special case your directions to fix what's being fixed here... Hurray! Your plugin should now work.
2012-12-01 01:06:29 -06:00
Wesley Wolfe
b626fb894a Purge outdated biomes. Fixes BUKKIT-1087 2012-08-07 01:55:48 -05:00
feildmaster
062a3df78d Javadoc updates
Fixes BUKKIT-1653, Fixes BUKKIT-1383 and Fixes BUKKIT-1644
2012-06-03 05:40:54 -05:00
Celtic Minstrel
132ee04542 [Bleeding] Add Chest.getBlockInventory() for convenience; this always returns a single chest inventory. Addresses BUKKIT-1247 2012-03-20 19:49:40 -04:00
Celtic Minstrel
8b67cad4cc [Bleeding] Added DoubleChest wrapper so that DoubleChestInventory can return something other than null. Addresses BUKKIT-995 2012-03-15 22:12:43 -04:00
Mike Primm
1bf2a25506 [Bleeding] Add APIs for editing biome data. Addresses BUKKIT-1075 2012-03-08 01:52:01 -05:00
Nathan Adams
d6625f693c Updated Bukkit API for 1.2 2012-03-01 14:25:51 +00: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
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
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
TomyLobo
7d51bc7834 Added missing BlockState functions. Addresses BUKKIT-807 2012-02-27 17:52:44 -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
Erik Broes
c2e82a68c1 [Bleeding] Add BrewingStand API. Thanks N3X15 & md_5 2012-01-17 19:50:23 +01:00
Zeerix
d384da1e7c [Bleeding] Added Block.breakNaturally and Block.getDrops 2012-01-17 19:48:36 +01:00
Mike Primm
64a8e06102 [Bleeding] Added Block.getLightFromSky and getLightFromBlocks 2012-01-17 19:45:47 +01:00
Erik Broes
88c17a7f86 Generic cleaning 2012-01-15 14:37:43 +01:00
Nathan Adams
682988ca75 Added 5 new biomes as included in MC 1.1 as part of #BUKKIT-496 2012-01-14 13:13:25 +00:00
Erik Broes
b9fca3c04d Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Nathan Adams
f8544fc93a Added new biome enum values 2011-11-22 21:21:09 +00:00
Nathan Adams
c89a0dbe99 Few more style cleanups 2011-10-11 02:16:44 +01:00
Nathan Adams
4485364e17 Small javadoc cleanup 2011-10-10 21:58:44 +01:00
Celtic Minstrel
1002e546a4 Remove Jukebox MaterialData in favour of Jukebox BlockState 2011-09-25 03:51:09 +01:00
Dinnerbone
fe4f4c5f58 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Dinnerbone
8bb761eff2 Ok, so we need this. *shifty eyes* 2011-09-15 01:42:07 +01:00
EvilSeph
714eb939c6 Added missing Note getNote(). 2011-07-28 01:29:04 -04:00
EvilSeph
f3fcc6f81f Removed deprecated methods.
getNote() that returns a byte has been replaced by getRawNote().
teleportTo(Location) has been replaced by teleport(location).
teleportTo(Entity) has been replaced by teleport(Entity).
SnowForm event has been replaced by BlockForm event.
2011-07-27 23:18:33 -04:00
Erik Broes
9b0dbed88e Deprecated Block.getFace(Face) and Block.getFace(Face,int); use getRelative() 2011-07-17 17:02:37 +02:00
Erik Broes
36d901c6b1 Added Block.getPistonMoveReaction, BlockPistonExtend and BlockPistonRetractEvent 2011-07-17 17:02:37 +02:00
sunkid
6bcad55b31 Added additional BlockFace enum members and fixed Sign class. 2011-07-14 11:36:27 -04:00
Dinnerbone
4c36e7903e Added helper methods World.getHighestBlockAt, Block.isEmpty, Block.isLiquid. Added methods to safely retrieve biome/temperature/humidity data for a block without generating the block. 2011-07-13 10:39:41 +01:00
EvilSeph
b57cec115f Added Sky biome for the Skylands. Thanks robin0van0der0v! 2011-06-21 15:41:47 -04:00
EvilSeph
293a4d9ae2 Added Instrument enum, Note class and get/setNote functions. Thanks xZise! 2011-06-17 03:13:34 -04:00
Erik Broes
992f1f2bf3 Whitespace + general cleanup 2011-05-15 14:06:02 +02:00
sk89q
d9e8461bbb Added NoteBlock.play(instrument, note). 2011-05-02 11:31:29 -07:00
Erik Broes
b39503de71 Updated README for line-ending demands, also fixed line-endigs. 2011-04-25 13:24:32 +02:00
sunkid
36df268478 added the MaterialData subclass Door 2011-03-25 23:07:34 +01:00
Erik Broes
d6341293e7 Reworked BlockDamageEvent to match with the latest Mojang client/server changes. 2011-03-23 16:58:43 +01:00
Tahg
941f25f4c9 added methods for getting redstone power 2011-03-10 13:23:54 -05:00
Dinnerbone
1de6f5bef8 Purged deprecated MobType and MobSpawner 2011-03-07 16:29:03 +00:00
Dinnerbone
6f07fa7291 You shouldn't be here, little method. We already have a getData. 2011-03-04 14:10:55 +00:00
Tahg
dbab772ca8 refactor Items 2011-02-21 19:57:06 -05:00
EvilSeph
050f21b2f0 When deprecating, the alternative should be provided. 2011-02-19 06:00:55 -05:00
Andrew Ardill
ac68b8594e Renamed MobType->CreatureType and MobSpawner->CreatureSpawner.
This is to bring the names in line with the rest of bukkit.

Deprecated code has been left in to ensure nothing breaks as
a result of refactoring MobType.
This will be removed after 1 week, to give plugin devs time to
migrate
2011-02-17 18:01:25 +11:00
Erik Broes
01988e8f6b General cleanup (deprecated+whitespace) 2011-02-02 00:28:41 +01:00
Dinnerbone
27b75075d6 Added NoteBlock.play, Dispenser.dispense 2011-02-01 23:21:53 +00:00
sk89q
85827e3614 Added Block.isBlockPowered(), block.isBlockIndirectlyPowered(). 2011-01-28 10:25:13 -08:00