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
bc836aaec1
Make CraftingManager::sort() more cool with spaceship operators 😎
2018-03-29 11:45:12 +01:00
145a4fad0f
CraftingManager: Make sort() static
...
this doesn't need access to $this
2018-03-29 11:45:06 +01:00
a6d7365a28
Moved CraftingManager init to its own function
...
this allows the crafting manager to be re-initialized on the fly without recreating it.
2018-03-29 11:32:22 +01:00
73e09392b6
Timings: Clean up some terrible code, move namespaces
2018-03-19 19:05:51 +00:00
dfc2d1dfe6
Stop hardcoding src/pocketmine/resources everywhere
2017-12-11 19:52:49 +00:00
b7cd8dbfa9
Fixed CraftingManager->cloneItemMap() being utterly useless
2017-10-31 19:01:03 +00:00
1486b5aa71
make more properties in CraftingManager protected
2017-10-31 18:49:49 +00:00
f79e4237df
Cache a compressed CraftingDataPacket to reduce workload on player join
...
this saves only a couple of ms per player join, but still worth it.
2017-10-29 09:57:55 +00: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
0262465a26
Fixed dupe cake glitch
...
this is what happens when you try to be clever when not properly awake
2017-09-20 11:19:15 +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
fd33a65e3b
Small cleanup of recipe UUID handling (furnace recipes don't need UUIDs)
2017-09-20 09:34:00 +01:00
ca23864e4c
CraftingManager: use null coalesce for matching furnace recipes
2017-09-19 20:03:21 +01:00
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
76acb1da7b
New crafting recipe data format, more readable & more compact
2017-08-24 12:05:35 +01:00
876659cc73
Item factory refactor and added capability to register custom items
2017-08-21 17:49:26 +01:00
e4a5cb6021
Changed NBT representation in JSON to hex, fix encoding problems with UTF-8
2017-08-06 14:50:18 +01:00
24bdf330d5
Merge branch 'moar-typehints'
2017-07-15 09:43:43 +01:00
6de8415c79
Merge network refactors
2017-07-14 13:04:02 +01:00
c3b8be3f60
and more typehints
2017-07-14 10:56:51 +01:00
2a7b736f18
Heap of bugfixes, cleanup and PHP 7 upgrades
2017-07-13 19:18:56 +01:00
3a214b7ce6
Cleaned up isEncoded mess
2017-07-13 12:21:26 +01:00
a365c831a8
Fixed some doc problems
2017-06-25 12:07:28 +01:00
e18a3ac933
Fixed UUID-related issues
2017-06-07 13:11:03 +01:00
51b0673b4b
Bite the bullet and enable strict types on everything
2017-06-07 12:53:16 +01:00
c7fdbea0f0
Merge branch 'master' into api3/network
2017-03-08 20:35:41 +00:00
56990eb28b
MCPE protocol gets its own namespace
2017-03-08 20:28:39 +00:00
663cb514e2
Fixed missing Cake recipe
...
TODO: add support for multiple crafting recipe result items
2017-03-04 15:03:53 +00:00
9c36e0cd1c
Added crafting data packet cache, reduces on-join lag spikes, close #248 ( #269 )
2017-01-23 11:03:46 +00:00
5443b10257
Use -1 for anydamage and empty string for null NBT, closes #146
2016-12-21 14:45:34 +00:00
ea7313779e
Update crafting recipes
2016-11-09 14:20:24 +00:00
06f8390b30
Fix furnaces and wrong smelting data recipe encoding
2016-10-28 21:46:20 +01: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
e913b16804
Fixed some lines indented with 4 spaces rather than tabs
2016-10-03 00:58:34 +08:00
6fc435da0e
Imports rearrangement
2016-10-03 00:43:46 +08:00
80250aa78e
Resolved 1️⃣ in #3961
2016-02-19 18:33:21 +08:00
d5f3c19054
Fix crafting not taking item from inventory
2016-01-25 23:10:18 +01:00
c7c78b1159
Read recipes from json
2016-01-25 20:40:26 +01:00
734736492a
Added some creative items and removed nether reactor
2015-11-23 21:56:38 +01:00
85dc136631
Crafting recipes, and packet fix
2015-09-29 00:45:57 +02:00
0b9ef5b856
Update of the stonecutter recipes
...
Added the shaped recipes and removed the shapeless ones.
2015-09-18 22:18:14 +02:00
a9ead5567b
Improved NBT json parsing, attribute base
2015-08-08 22:39:43 +02:00
1fa467eb58
Proper recipe ingredient matching, fixed crafting type resetting
2015-08-07 22:00:35 +02:00
d026e2ecf0
Implemented new crafting mechanism
2015-08-07 21:26:12 +02:00
091d0b3ff9
Added compound tag checking for Item->equals()
2015-08-06 20:25:22 +02:00
09720a2d90
Properly implemented Shaped recipes on Network and manager, no crafting!
2015-08-04 21:59:54 +02:00
5621ab0c49
Updated some packets for 0.12, UUIDs, other stuff!
2015-08-02 01:22:36 +02:00
f490ff8074
Added mossy stone brick recipe, added chiseled stone brick recipe, added cracked stone brick furnace recipe, fixed crafting stone bricks, fixed crafting stone brick slabs, closes #3161 , fixes #3160
2015-06-13 13:45:05 +02:00