Commit Graph

29 Commits

Author SHA1 Message Date
Dylan K. Taylor
ec332e3e60 Fill null UUIDs in CraftingDataPacket, remove all UUID things from CraftingRecipe
This allows deleting lots of code, and additionally provides a huge reduction in the compressed size of CraftingDataPacket. Since we don't care about these UUIDs (they are only used in CraftingEventPacket, which is broken and unused in PM) we fill them with zeros instead.
2018-03-29 12:05:23 +01:00
Dylan K. Taylor
a1090623a2 CraftingRecipe: added methods to allow recipes to derive outputs from inputs
this will be needed for special recipes like shulker-box and banner recipes.
2018-03-29 12:05:22 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
08c48d8145 CraftingRecipe: removed requiresCraftingTable()
the requirement for a crafting table is determined by the number of ingredients can fit on the grid (shapeless) or the max height and width (shaped). It's impossible to craft a big recipe with a small crafting table simply because you're not able to put the required resources into the grid.
2018-03-29 11:43:31 +01:00
Dylan K. Taylor
81ecb56095 ShapedRecipe: fixed bug in constructor 2018-03-29 11:32:39 +01:00
Dylan K. Taylor
c448f4a3b5 Added handling for reflected ShapedRecipe crafting, close #1415 2017-09-28 18:45:22 +01:00
Dylan K. Taylor
240cc3043a Rewritten crafting, fixed #45 2017-09-24 14:14:24 +01:00
Dylan K. Taylor
f01ce8e994 null and void typehints 2017-09-21 12:54:04 +01:00
Dylan K. Taylor
6aa9b081e9 Cleanup unused imports 2017-09-21 12:26:41 +01:00
Dylan K. Taylor
ee052f91d4 Fixed some air items with count 1 instead of 0 2017-09-21 10:30:14 +01:00
Dylan K. Taylor
7996a7b08c Testing handling multiple result items for ShapedRecipes
this doesn't work yet, I wanted to see how glitchy it is with cakes. The answer is: very glitchy.
2017-09-20 11:14:09 +01:00
Dylan K. Taylor
f0755d1659 Fixed handling of recipes that require a crafting table 2017-09-20 09:43:49 +01:00
Dylan K. Taylor
fd33a65e3b Small cleanup of recipe UUID handling (furnace recipes don't need UUIDs) 2017-09-20 09:34:00 +01:00
Dylan K. Taylor
8728547a11 Remove unused imports 2017-09-19 19:58:53 +01:00
Dylan K. Taylor
642c7733cd Cleaned up ShapedRecipe handling, ShapedRecipe API changes
use shapes from json instead of just generating maps
fix a ton of bugs
2017-09-17 11:45:16 +01:00
Dylan K. Taylor
876659cc73 Item factory refactor and added capability to register custom items 2017-08-21 17:49:26 +01:00
Dylan K. Taylor
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
Dylan K. Taylor
b9355387da fix some inspections related to crafting recipes 2017-07-14 08:53:37 +01:00
Dylan K. Taylor
2a7b736f18 Heap of bugfixes, cleanup and PHP 7 upgrades 2017-07-13 19:18:56 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
PEMapModder
1082e32fd7 Fixed ShapedRecipe constructor 2016-02-07 01:02:40 +08:00
Intyre
c7c78b1159 Read recipes from json 2016-01-25 20:40:26 +01:00
Shoghi Cervantes
1fa467eb58 Proper recipe ingredient matching, fixed crafting type resetting 2015-08-07 22:00:35 +02:00
Shoghi Cervantes
09720a2d90 Properly implemented Shaped recipes on Network and manager, no crafting! 2015-08-04 21:59:54 +02:00
Shoghi Cervantes
5621ab0c49 Updated some packets for 0.12, UUIDs, other stuff! 2015-08-02 01:22:36 +02:00
Shoghi Cervantes
8c4faa8622 Added extra Exceptions 2014-10-28 21:07:12 +01:00
Shoghi Cervantes
8d40f843cf MainLogger can now have debug level disabled 2014-05-29 00:08:02 +02:00
Shoghi Cervantes
6746987ce5 Added CraftItemEvent, Crafting system now uses Transactions 2014-05-27 17:49:22 +02:00
Shoghi Cervantes
6fcd5322d0 Implemented Transactions 2014-05-27 01:20:18 +02:00