mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added CanDestroy and Lock tag
This commit is contained in:
@ -1562,6 +1562,24 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
$tag = $item->getNamedTagEntry("CanDestroy");
|
||||
if($tag instanceof Enum){
|
||||
$canBreak = false;
|
||||
foreach($tag as $v){
|
||||
if($v instanceof String){
|
||||
$entry = Item::fromString($v->getValue());
|
||||
if($entry->getId() > 0 and $entry->getBlock() !== null and $entry->getBlock()->getId() === $target->getId()){
|
||||
$canBreak = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$canBreak){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if($createParticles){
|
||||
$players = $this->getChunkPlayers($target->x >> 4, $target->z >> 4);
|
||||
if($player !== null){
|
||||
|
Reference in New Issue
Block a user