pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.25k stars 1.53k forks source link

Cannot craft - "Undefined offset: 0" #994

Closed ghost closed 7 years ago

ghost commented 7 years ago

Issue description

The error happen when player crafted blocks or items. however it did not happen on MinecraftPE or Minecraft Win10 in "PocketGui".

Maybe this error is happened at "Classic" only.

Steps to reproduce the issue

Craft blocks or items on MinecraftPE or Minecraft Win10 in "Classic".

OS and versions

Crashdump, backtrace or other files

ErrorException: "Undefined offset: 0" (EXCEPTION) in "/src/pocketmine/Player" at line 3020

Code: src/pocketmine/Player [3016] if($recipe instanceof ShapedRecipe){ [3017] for($x = 0; $x < 3 and $canCraft; ++$x){ [3018] for($y = 0; $y < 3; ++$y){ [3019] /* @var Item $item / [3020] $item = $packet->input[$y * 3 + $x]; [3021] $ingredient = $recipe->getIngredient($x, $y); [3022] if($item->getCount() > 0){ [3023] if($ingredient === null or !$ingredient->equals($item, !$ingredient->hasAnyDamageValue(), $ingredient->hasCompoundTag())){ [3024] $canCraft = false; [3025] break; [3026] } [3027] } [3028] } [3029] } [3030] }elseif($recipe instanceof ShapelessRecipe){

jojoe77777 commented 7 years ago

https://github.com/pmmp/PocketMine-MP/issues/45

ghost commented 7 years ago

Sorry, overlook that... Thank you for answering!