mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Fixed null Items with id < 256 not working correctly
This commit is contained in:
parent
f66560ccd4
commit
dafa4f1b1c
@ -390,6 +390,7 @@ class CraftingManager{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count($checkInput) === 0){
|
||||
$hasRecipe = $recipe;
|
||||
break;
|
||||
|
@ -33,7 +33,7 @@ class Block extends Item{
|
||||
}
|
||||
|
||||
public function setDamage($meta){
|
||||
$this->meta = $meta & 0x0F;
|
||||
$this->meta = $meta !== null ? $meta & 0xFF : null;
|
||||
$this->block->setDamage($this->meta);
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,10 @@ namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\inventory\Fuel;
|
||||
use pocketmine\item\Block as ItemBlock;
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\recipes\Fuel;
|
||||
|
||||
class Item{
|
||||
//All Block IDs are here too
|
||||
@ -440,7 +440,6 @@ class Item{
|
||||
}else{
|
||||
$item = new Item($id, $meta, $count);
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
@ -587,7 +586,7 @@ class Item{
|
||||
}
|
||||
|
||||
final public function __toString(){
|
||||
return "Item " . $this->name . " (" . $this->id . ":" . $this->meta . ")";
|
||||
return "Item " . $this->name . " (" . $this->id . ":" . ($this->meta === null ? "?" : $this->meta) . ")";
|
||||
}
|
||||
|
||||
public function getDestroySpeed(Block $block, Player $player){
|
||||
|
Loading…
x
Reference in New Issue
Block a user