mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
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[]
This commit is contained in:
@ -133,7 +133,7 @@ class CraftingDataPacket extends DataPacket{
|
||||
$stream->putSlot($item);
|
||||
}
|
||||
|
||||
$results = $recipe->getAllResults();
|
||||
$results = $recipe->getResults();
|
||||
$stream->putUnsignedVarInt(count($results));
|
||||
foreach($results as $item){
|
||||
$stream->putSlot($item);
|
||||
@ -154,7 +154,7 @@ class CraftingDataPacket extends DataPacket{
|
||||
}
|
||||
}
|
||||
|
||||
$results = $recipe->getAllResults();
|
||||
$results = $recipe->getResults();
|
||||
$stream->putUnsignedVarInt(count($results));
|
||||
foreach($results as $item){
|
||||
$stream->putSlot($item);
|
||||
|
Reference in New Issue
Block a user