Separate block break-info to a separate dynamic unit

This commit is contained in:
Dylan K. Taylor
2019-05-10 16:24:59 +01:00
parent 3be5de4570
commit 9e72bc91a2
155 changed files with 556 additions and 1295 deletions

View File

@ -1680,7 +1680,7 @@ class World implements ChunkManager, Metadatable{
if($player !== null){
$ev = new BlockBreakEvent($player, $target, $item, $player->isCreative(), $drops, $xpDrop);
if($target instanceof Air or ($player->isSurvival() and !$target->isBreakable($item)) or $player->isSpectator()){
if($target instanceof Air or ($player->isSurvival() and !$target->getBreakInfo()->isBreakable()) or $player->isSpectator()){
$ev->setCancelled();
}
@ -1710,7 +1710,7 @@ class World implements ChunkManager, Metadatable{
$drops = $ev->getDrops();
$xpDrop = $ev->getXpDropAmount();
}elseif(!$target->isBreakable($item)){
}elseif(!$target->getBreakInfo()->isBreakable()){
return false;
}