mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Merge branch 'master' of github.com:pmmp/PocketMine-MP
This commit is contained in:
commit
82b5bca83e
@ -23,6 +23,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Item;
|
||||||
|
|
||||||
class Podzol extends Opaque{
|
class Podzol extends Opaque{
|
||||||
|
|
||||||
|
public function getDropsForCompatibleTool(Item $item) : array{
|
||||||
|
return [
|
||||||
|
VanillaBlocks::DIRT()->asItem()
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ use pocketmine\permission\DefaultPermissionNames;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\utils\TextFormat;
|
use pocketmine\utils\TextFormat;
|
||||||
use function count;
|
use function count;
|
||||||
use function round;
|
|
||||||
|
|
||||||
class SetWorldSpawnCommand extends VanillaCommand{
|
class SetWorldSpawnCommand extends VanillaCommand{
|
||||||
|
|
||||||
@ -54,7 +53,7 @@ class SetWorldSpawnCommand extends VanillaCommand{
|
|||||||
if($sender instanceof Player){
|
if($sender instanceof Player){
|
||||||
$location = $sender->getPosition();
|
$location = $sender->getPosition();
|
||||||
$world = $location->getWorld();
|
$world = $location->getWorld();
|
||||||
$pos = $location->asVector3()->round();
|
$pos = $location->asVector3()->floor();
|
||||||
}else{
|
}else{
|
||||||
$sender->sendMessage(TextFormat::RED . "You can only perform this command as a player");
|
$sender->sendMessage(TextFormat::RED . "You can only perform this command as a player");
|
||||||
|
|
||||||
@ -69,7 +68,7 @@ class SetWorldSpawnCommand extends VanillaCommand{
|
|||||||
|
|
||||||
$world->setSpawnLocation($pos);
|
$world->setSpawnLocation($pos);
|
||||||
|
|
||||||
Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_setworldspawn_success((string) round($pos->x, 2), (string) round($pos->y, 2), (string) round($pos->z, 2)));
|
Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_setworldspawn_success((string) $pos->x, (string) $pos->y, (string) $pos->z));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user