mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed bucket
This commit is contained in:
parent
f227daa1e0
commit
1ce30f1061
1 changed files with 6 additions and 2 deletions
|
|
@ -16,10 +16,14 @@ class BucketItem extends Item{
|
|||
|
||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($this->meta === AIR){
|
||||
if($block instanceof LiquidBlock){
|
||||
if($target instanceof LiquidBlock && $target->getMetadata() == 0){
|
||||
$level->setBlock($target, new AirBlock(), true, false, true);
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$this->meta = ($target instanceof WaterBlock) ? WATER : LAVA;
|
||||
$this->meta = match($target->getID()){
|
||||
WATER, STILL_WATER => WATER,
|
||||
LAVA, STILL_LAVA => LAVA,
|
||||
default => 0
|
||||
};
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue