Commit Graph

23 Commits

Author SHA1 Message Date
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
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
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
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
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
c47f1f572c Added API method Item->pop() 2017-09-27 10:56:04 +01:00
240cc3043a Rewritten crafting, fixed #45 2017-09-24 14:14:24 +01:00
f01ce8e994 null and void typehints 2017-09-21 12:54:04 +01:00
6aa9b081e9 Cleanup unused imports 2017-09-21 12:26:41 +01:00
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
f0755d1659 Fixed handling of recipes that require a crafting table 2017-09-20 09:43:49 +01:00
fd33a65e3b Small cleanup of recipe UUID handling (furnace recipes don't need UUIDs) 2017-09-20 09:34:00 +01:00
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
b9355387da fix some inspections related to crafting recipes 2017-07-14 08:53:37 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
5443b10257 Use -1 for anydamage and empty string for null NBT, closes #146 2016-12-21 14:45:34 +00:00
091d0b3ff9 Added compound tag checking for Item->equals() 2015-08-06 20:25:22 +02:00
5621ab0c49 Updated some packets for 0.12, UUIDs, other stuff! 2015-08-02 01:22:36 +02:00
8c4faa8622 Added extra Exceptions 2014-10-28 21:07:12 +01:00
8d40f843cf MainLogger can now have debug level disabled 2014-05-29 00:08:02 +02:00
3ac60f9860 Added Normal and Big crafting recipes, fixed CraftingTransactionGroup count 2014-05-27 23:26:07 +02:00
6746987ce5 Added CraftItemEvent, Crafting system now uses Transactions 2014-05-27 17:49:22 +02:00
6fcd5322d0 Implemented Transactions 2014-05-27 01:20:18 +02:00