mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Removed redundant count parameter from item constructors, added some documentation and tightened safety checks
the count parameter is useless since Item ctor should now only be used for constructing item _types_, not actual items. All item creations for inventories etc, should go through the ItemFactory.
This commit is contained in:
@ -117,7 +117,10 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
* @param int $meta
|
||||
*/
|
||||
final public function setDamage(int $meta){
|
||||
$this->meta = $meta & 0x0f;
|
||||
if($meta < 0 or $meta > 0xf){
|
||||
throw new \InvalidArgumentException("Block damage values must be 0-15, not $meta");
|
||||
}
|
||||
$this->meta = $meta;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user