Bucket: Added sounds for bucket fill/empty

This commit is contained in:
Dylan K. Taylor
2018-01-03 14:27:41 +00:00
parent 33352638a9
commit 5f48433c95
4 changed files with 25 additions and 0 deletions

View File

@ -29,6 +29,7 @@ use pocketmine\event\entity\EntityDamageByBlockEvent;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\Player;
use pocketmine\Server;
@ -56,6 +57,14 @@ class Lava extends Liquid{
return BlockFactory::get(Block::FLOWING_LAVA, $this->meta);
}
public function getBucketFillSound() : int{
return LevelSoundEventPacket::SOUND_BUCKET_FILL_LAVA;
}
public function getBucketEmptySound() : int{
return LevelSoundEventPacket::SOUND_BUCKET_EMPTY_LAVA;
}
public function tickRate() : int{
return 30;
}

View File

@ -80,6 +80,10 @@ abstract class Liquid extends Transparent{
abstract public function getFlowingForm() : Block;
abstract public function getBucketFillSound() : int;
abstract public function getBucketEmptySound() : int;
public function getFluidHeightPercent(){
$d = $this->meta;
if($d >= 8){

View File

@ -26,6 +26,7 @@ namespace pocketmine\block;
use pocketmine\entity\Entity;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\Player;
class Water extends Liquid{
@ -52,6 +53,14 @@ class Water extends Liquid{
return BlockFactory::get(Block::FLOWING_WATER, $this->meta);
}
public function getBucketFillSound() : int{
return LevelSoundEventPacket::SOUND_BUCKET_FILL_WATER;
}
public function getBucketEmptySound() : int{
return LevelSoundEventPacket::SOUND_BUCKET_EMPTY_WATER;
}
public function tickRate() : int{
return 5;
}