mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Merge branch 'next-minor'
This commit is contained in:
commit
5d3b4f23a3
@ -54,6 +54,7 @@ class CraftingManager{
|
||||
public function init() : void{
|
||||
$recipes = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "recipes.json"), true);
|
||||
|
||||
$itemDeserializerFunc = \Closure::fromCallable([Item::class, 'jsonDeserialize']);
|
||||
foreach($recipes as $recipe){
|
||||
switch($recipe["type"]){
|
||||
case "shapeless":
|
||||
@ -61,8 +62,8 @@ class CraftingManager{
|
||||
break;
|
||||
}
|
||||
$this->registerShapelessRecipe(new ShapelessRecipe(
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["input"]),
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["output"])
|
||||
array_map($itemDeserializerFunc, $recipe["input"]),
|
||||
array_map($itemDeserializerFunc, $recipe["output"])
|
||||
));
|
||||
break;
|
||||
case "shaped":
|
||||
@ -71,8 +72,8 @@ class CraftingManager{
|
||||
}
|
||||
$this->registerShapedRecipe(new ShapedRecipe(
|
||||
$recipe["shape"],
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["input"]),
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["output"])
|
||||
array_map($itemDeserializerFunc, $recipe["input"]),
|
||||
array_map($itemDeserializerFunc, $recipe["output"])
|
||||
));
|
||||
break;
|
||||
case "smelting":
|
||||
|
@ -28,12 +28,16 @@ use pocketmine\utils\UUID;
|
||||
class MultiRecipe{
|
||||
public const TYPE_REPAIR_ITEM = "00000000-0000-0000-0000-000000000001";
|
||||
public const TYPE_MAP_EXTENDING = "D392B075-4BA1-40AE-8789-AF868D56F6CE";
|
||||
public const TYPE_MAP_EXTENDING_CARTOGRAPHY = "8B36268C-1829-483C-A0F1-993B7156A8F2";
|
||||
public const TYPE_MAP_CLONING = "85939755-BA10-4D9D-A4CC-EFB7A8E943C4";
|
||||
public const TYPE_MAP_CLONING_CARTOGRAPHY = "442D85ED-8272-4543-A6F1-418F90DED05D";
|
||||
public const TYPE_MAP_UPGRADING = "AECD2294-4B94-434B-8667-4499BB2C9327";
|
||||
public const TYPE_MAP_UPGRADING_CARTOGRAPHY = "98C84B38-1085-46BD-B1CE-DD38C159E6CC";
|
||||
public const TYPE_BOOK_CLONING = "D1CA6B84-338E-4F2F-9C6B-76CC8B4BD98D";
|
||||
public const TYPE_BANNER_DUPLICATE = "B5C5D105-75A2-4076-AF2B-923EA2BF4BF0";
|
||||
public const TYPE_BANNER_ADD_PATTERN = "D81AAEAF-E172-4440-9225-868DF030D27B";
|
||||
public const TYPE_FIREWORKS = "00000000-0000-0000-0000-000000000002";
|
||||
public const TYPE_MAP_LOCKING_CARTOGRAPHY = "602234E4-CAC1-4353-8BB7-B1EBFF70024B";
|
||||
|
||||
private $uuid;
|
||||
|
||||
|
@ -22,7 +22,8 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
#Run PHPUnit tests
|
||||
curl https://phar.phpunit.de/phpunit-7.phar --silent --location -o phpunit.phar
|
||||
#7.5.12 introduces changes that set the build on fire because we don't ship libxml - TODO FIX
|
||||
curl https://phar.phpunit.de/phpunit-7.5.11.phar --silent --location -o phpunit.phar
|
||||
"$PHP_BINARY" phpunit.phar --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit || exit 1
|
||||
|
||||
#Run-the-server tests
|
||||
|
Loading…
x
Reference in New Issue
Block a user