flint and steel should destroy on serverside too now

This commit is contained in:
GameHerobrine 2023-04-03 22:56:04 +03:00
parent add7c2cafe
commit 4a58ac2ad8

View file

@ -9,9 +9,8 @@ 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); //TODO check
$player->setSlot($player->slot, new Item(AIR, 0, 0), false); //TODO check
}
if($block->getID() === AIR and ($target instanceof SolidBlock)){
$level->setBlock($block, new FireBlock(), true, false, true);
$block->level->scheduleBlockUpdate($block, Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
@ -21,11 +20,7 @@ class FlintSteelItem extends ItemTool{
}
public function useOn($object, $force = false){
if(($object instanceof Creeper) and $this->id === FLINT_STEEL){
$this->meta++;
return true;
}else{
return $force ? parent::useOn($object, $force) : $force;
}
++$this->meta;
return true;
}
}