mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 19:55:33 +00:00
Merge pull request #950 from InusualZ/test
Fixed #332. Temporary Silk Touch fix. Replace this system with class-based silk touch variable.
This commit is contained in:
commit
0e9458fafc
@ -791,6 +791,7 @@ class Player{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($res)){
|
if(is_array($res)){
|
||||||
|
|
||||||
if($this->server->api->dhandle("player.craft", array("player" => $this, "recipe" => $recipe, "craft" => $craft, "type" => $type)) === false){
|
if($this->server->api->dhandle("player.craft", array("player" => $this, "recipe" => $recipe, "craft" => $craft, "type" => $type)) === false){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -840,6 +841,9 @@ class Player{
|
|||||||
case DIAMOND:
|
case DIAMOND:
|
||||||
AchievementAPI::grantAchievement($this, "diamond");
|
AchievementAPI::grantAchievement($this, "diamond");
|
||||||
break;
|
break;
|
||||||
|
case CAKE:
|
||||||
|
$this->addItem(BUCKET, 0, 3, false);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,28 @@ class Explosion{
|
|||||||
$e = $server->api->entity->add($this->level, ENTITY_OBJECT, OBJECT_PRIMEDTNT, $data);
|
$e = $server->api->entity->add($this->level, ENTITY_OBJECT, OBJECT_PRIMEDTNT, $data);
|
||||||
$server->api->entity->spawnToAll($e);
|
$server->api->entity->spawnToAll($e);
|
||||||
}elseif(mt_rand(0, 10000) < ((1/$this->size) * 10000)){
|
}elseif(mt_rand(0, 10000) < ((1/$this->size) * 10000)){
|
||||||
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), BlockAPI::getItem($block->getID(), $this->level->level->getBlockDamage($block->x, $block->y, $block->z)));
|
switch ($block->getID()) {
|
||||||
|
|
||||||
|
case GRASS:
|
||||||
|
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), BlockAPI::getItem(DIRT, $this->level->level->getBlockDamage($block->x, $block->y, $block->z)));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case STONE:
|
||||||
|
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), BlockAPI::getItem(COBBLESTONE, $this->level->level->getBlockDamage($block->x, $block->y, $block->z)));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case COAL_ORE:
|
||||||
|
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), new CoalItem());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DIAMOND_ORE:
|
||||||
|
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), new DiamondItem());
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$server->api->entity->drop(new Position($block->x + 0.5, $block->y, $block->z + 0.5, $this->level), BlockAPI::getItem($block->getID(), $this->level->level->getBlockDamage($block->x, $block->y, $block->z)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->level->level->setBlockID($block->x, $block->y, $block->z, 0);
|
$this->level->level->setBlockID($block->x, $block->y, $block->z, 0);
|
||||||
$send[] = new Vector3($block->x - $source->x, $block->y - $source->y, $block->z - $source->z);
|
$send[] = new Vector3($block->x - $source->x, $block->y - $source->y, $block->z - $source->z);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user