mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
fixed Protection enchantments being dropped from items, closes #3066
This commit is contained in:
parent
296061d25d
commit
28c9a2c0cd
@ -297,9 +297,9 @@ class Item implements \JsonSerializable{
|
||||
if($enchantments !== null and $enchantments->getTagType() === NBT::TAG_Compound){
|
||||
/** @var CompoundTag $enchantment */
|
||||
foreach($enchantments as $enchantment){
|
||||
$magicNumber = $enchantment->getShort("id", 0, true);
|
||||
$magicNumber = $enchantment->getShort("id", -1, true);
|
||||
$level = $enchantment->getShort("lvl", 0, true);
|
||||
if($magicNumber <= 0 or $level <= 0){
|
||||
if($level <= 0){
|
||||
continue;
|
||||
}
|
||||
$type = Enchantment::get($magicNumber);
|
||||
|
Loading…
x
Reference in New Issue
Block a user