mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
flint and steel should destroy on serverside too now
This commit is contained in:
parent
add7c2cafe
commit
4a58ac2ad8
1 changed files with 3 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue