mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Basic implementation of Fire
This commit is contained in:
parent
2f6ddb6aa4
commit
2976db25c3
14 changed files with 73 additions and 5 deletions
|
|
@ -27,8 +27,7 @@ the Free Software Foundation, either version 3 of the License, or
|
|||
|
||||
class BucketItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(BUCKET, 0, $count, "Bucket");
|
||||
$this->meta = $meta;
|
||||
parent::__construct(BUCKET, $meta, $count, "Bucket");
|
||||
$this->isActivable = true;
|
||||
$this->maxStackSize = 1;
|
||||
}
|
||||
|
|
|
|||
44
src/material/item/tool/FlintSteel.php
Normal file
44
src/material/item/tool/FlintSteel.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class FlintSteelItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(FLINT_STEEL, $meta, $count, "Flint and Steel");
|
||||
$this->isActivable = true;
|
||||
$this->maxStackSize = 1;
|
||||
}
|
||||
|
||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($block->getID() === AIR){
|
||||
$level->setBlock($block, new FireBlock(), true, false, true);
|
||||
$block->level->scheduleBlockUpdate(new Position($block, 0, 0, $block->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
||||
return true;
|
||||
}
|
||||
$this->useOn($block);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue