mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 11:18:52 +00:00
Correct drops for Snow and Cake
This commit is contained in:
parent
28f6a964d4
commit
ab3fcfc148
@ -147,6 +147,23 @@ class Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function isShovel(){
|
||||||
|
switch($this->id){
|
||||||
|
case IRON_SHOVEL:
|
||||||
|
return 4;
|
||||||
|
case WOODEN_SHOVEL:
|
||||||
|
return 1;
|
||||||
|
case STONE_SHOVEL:
|
||||||
|
return 3;
|
||||||
|
case DIAMOND_SHOVEL:
|
||||||
|
return 5;
|
||||||
|
case GOLD_SHOVEL:
|
||||||
|
return 2;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function isHoe(){
|
public function isHoe(){
|
||||||
switch($this->id){
|
switch($this->id){
|
||||||
case IRON_HOE:
|
case IRON_HOE:
|
||||||
|
@ -33,6 +33,10 @@ class CakeBlock extends TransparentBlock{
|
|||||||
$this->meta = $meta & 0x07;
|
$this->meta = $meta & 0x07;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
public function onActivate(Item $item, Player $player){
|
public function onActivate(Item $item, Player $player){
|
||||||
if($player->entity->getHealth() < 20){
|
if($player->entity->getHealth() < 20){
|
||||||
++$this->meta;
|
++$this->meta;
|
||||||
|
@ -32,4 +32,11 @@ class SnowLayerBlock extends FlowableBlock{
|
|||||||
$this->isSolid = false;
|
$this->isSolid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
if($item->isShovel() !== false){
|
||||||
|
return array(
|
||||||
|
array(SNOWBALL, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -41,11 +41,11 @@ class BucketItem extends Item{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}elseif($this->meta === STILL_WATER){
|
}elseif($this->meta === STILL_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 === STILL_LAVA){
|
||||||
if($block->getID() === AIR){
|
if($block->getID() === AIR){
|
||||||
$level->setBlock($block, new StillLavaBlock());
|
$level->setBlock($block, new StillLavaBlock());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user