Commit Graph

40 Commits

Author SHA1 Message Date
c4793241f5 Mass removal of useless @param/@return PHPDoc annotations, pass 1 2020-01-21 15:10:18 +00:00
45c9caa38c Fixup some formatting issues 2018-10-21 18:15:25 +01:00
eb0276d459 Apply nullable and void typehints to events namespace 2018-06-11 13:49:16 +01:00
05af87e1d4 Strip empty lines at the end of classes 2018-06-11 13:19:23 +01:00
8ce0fab8cc Remove unused imports 2018-04-02 12:26:13 +01:00
8572e9e560 Crafting: nuke
This commit brings in a much-needed rewrite of crafting transaction handling.

The following classes have been removed:
- CraftingTransferMaterialAction
- CraftingTakeResultAction

The following classes have significant changes:
- CraftingTransaction
	- All API methods have been removed and are now handled in CraftItemEvent
- CraftItemEvent
	- added the following:
		- getInputs()
		- getOutputs()
		- getRepetitions() (tells how many times a recipe was crafted in this event)
- Recipe interface:
	- Removed getResult() (individual recipes may handle this differently)
- CraftingRecipe interface
	- removed the following:
		- matchItems()
		- getExtraResults()
		- getAllResults()
	- added the following
		- getResults()
		- getIngredientList() : Item[], which must return a 1D array of items that should be consumed (wildcards accepted).
		- matchesCraftingGrid(CraftingGrid)
- ShapedRecipe
	- constructor now accepts string[], Item[], Item[]
- ShapelessRecipe
	- constructor now accepts Item[], Item[]
2018-03-29 12:05:22 +01:00
a4c50d3204 Remove unused imports 2018-03-24 11:59:15 +00:00
49fbbea7bf Implemented event handler inheritance, allow registering handlers for any valid event (#1792)
* Event handlers always handle subclass events. public static $handlerList no longer required.
* Removed $handlerList declarations
* HandlerList cleanup: Removed HandlerList->handlers and related bake methods
* Removed obsolete Event->getHandlers()
* EventPriority: Added fromString()
* PluginManager: throw exceptions on registering handlers with invalid priorities

This allows specifying a handler of `EntityDamageEvent` which will handle any instanceof it (as per current behaviour), AND also now allows specifying a handler specifically for `EntityDamageByEntityEvent`, which only handles `EntityDamageEvent`.

This was not previously possible due to limitations in the way handlers were registered.

Abstract events may not be handled unless they declare the `@allowHandle` PhpDoc tag.
2018-03-20 17:05:09 +00:00
b39bbffdc5 Entity: Moved and renamed entity\Item to entity\object\ItemEntity 2018-03-10 12:36:46 +00:00
f0535df96d Remove deprecated things 2018-02-27 11:59:16 +00:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
584810780a Moved projectile-related classes to their own namespace 2017-10-19 12:27:44 +01:00
240cc3043a Rewritten crafting, fixed #45 2017-09-24 14:14:24 +01:00
8958b3c51c Many many changes related to inventory transactions, fixed item dropping, fixed creative menu 2017-08-11 19:57:30 +01:00
dbb92096e4 More typehints, documentation fixes and static analysis cleanup 2017-07-15 12:12:06 +01:00
6cd4d2c5a2 Added typehints and PhpDoc for events API
excluded blocks and entities events API to avoid merge conflicts
2017-07-05 16:42:06 +01:00
a73c6f1861 Fixed some unnecessary FQNs in docs 2017-06-25 12:43:04 +01:00
846be84324 Fixed all file headers 2017-06-16 16:18:16 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
7eb9530346 Fix CraftItemEvent not return inputs 2016-11-21 17:43:04 +00:00
58ff381557 PhpStorm automated formatting (#11)
* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
2016-10-03 19:05:48 +08:00
fe2957c315 Fixed imports 2016-02-18 01:43:42 +08:00
6273875a22 Added Player to CraftItemEvent 2015-09-19 23:08:57 +02:00
d026e2ecf0 Implemented new crafting mechanism 2015-08-07 21:26:12 +02:00
7d406066a7 Added outdated event static properties 2015-01-11 19:37:21 +01:00
022a978ffb Added InventoryPickupArrowEvent 2014-10-29 16:29:00 +01:00
78f8d0280d Removed unused imports 2014-10-29 01:14:09 +01:00
f772391866 Fixed InventoryPickupItemEvent 2014-10-28 22:05:54 +01:00
350cee3d41 Added Event allocation pool, updated SPL with Class::onClassLoaded() 2014-10-28 10:47:40 +01:00
7abf52e615 Implemented Vector3 List and AxisAlignedBB Pool to decrease object allocation 2014-10-27 15:39:20 +01:00
b2ac959083 Added FurnaceSmeltEvent 2014-10-09 12:47:42 +02:00
c67d4dae7b Added FurnaceBurnEvent 2014-10-09 12:36:57 +02:00
db7222976e Code cleanup 2014-08-21 17:26:41 +02:00
e8e825322b Update InventoryTransactionEvent.php 2014-07-20 15:28:53 -04:00
8d40f843cf MainLogger can now have debug level disabled 2014-05-29 00:08:02 +02:00
6746987ce5 Added CraftItemEvent, Crafting system now uses Transactions 2014-05-27 17:49:22 +02:00
5e97da2e11 Added InventoryTransactionEvent 2014-05-27 01:56:25 +02:00
d92c5332da Added InventoryOpenEvent and InventoryPickupItemEvent 2014-05-27 01:44:56 +02:00
e1ccd7f9ea Added InventoryCloseEvent 2014-05-27 01:30:24 +02:00
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00