slot should be always sent on interact now

This commit is contained in:
GameHerobrine 2023-01-11 12:50:14 +03:00
parent 21d0530d39
commit 5c153ac5da
3 changed files with 16 additions and 13 deletions

View file

@ -9,12 +9,12 @@ class FlintSteelItem extends ItemTool{
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if(($player->gamemode & 0x01) === 0 and $this->useOn($block) and $this->getMetadata() >= $this->getMaxDurability()){
$player->setSlot($player->slot, new Item(AIR, 0, 0), false);
$player->setSlot($player->slot, new Item(AIR, 0, 0), true); //TODO check
}
if($block->getID() === AIR and ($target instanceof SolidBlock)){
$level->setBlock($block, new FireBlock(), true, false, true);
$block->level->scheduleBlockUpdate(new Position($block, 0, 0, $block->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
$block->level->scheduleBlockUpdate($block, Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
return false;