mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
Buckets
This commit is contained in:
parent
ab3fcfc148
commit
7970b8aeed
1 changed files with 7 additions and 7 deletions
|
|
@ -35,18 +35,18 @@ class BucketItem extends Item{
|
||||||
|
|
||||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
if($this->meta === AIR){
|
if($this->meta === AIR){
|
||||||
if($block->getID() === STILL_WATER or $block->getID() === STILL_LAVA){
|
if($target instanceof LiquidBlock){
|
||||||
$level->setBlock($block, new AirBlock());
|
$level->setBlock($target, new AirBlock());
|
||||||
$this->meta = $block->getID();
|
$this->meta = ($target instanceof WaterBlock) ? WATER:LAVA;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}elseif($this->meta === STILL_WATER){
|
}elseif($this->meta === WATER){
|
||||||
//if($block->getID() === AIR){
|
if($block->getID() === AIR){
|
||||||
$level->setBlock($block, new StillWaterBLock());
|
$level->setBlock($block, new StillWaterBLock());
|
||||||
$this->meta = 0;
|
$this->meta = 0;
|
||||||
return true;
|
return true;
|
||||||
//}
|
}
|
||||||
}elseif($this->meta === STILL_LAVA){
|
}elseif($this->meta === LAVA){
|
||||||
if($block->getID() === AIR){
|
if($block->getID() === AIR){
|
||||||
$level->setBlock($block, new StillLavaBlock());
|
$level->setBlock($block, new StillLavaBlock());
|
||||||
$this->meta = 0;
|
$this->meta = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue