本文整理汇总了PHP中pocketmine\utils\Config::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::remove方法的具体用法?PHP Config::remove怎么用?PHP Config::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\utils\Config
的用法示例。
在下文中一共展示了Config::remove方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setExempt
/**
* @param Player $player
* @param bool $value
*/
public function setExempt(Player $player, $value = true)
{
if ($value) {
$this->exempts->set(strtolower($player->getName()));
$this->exempts->save();
} else {
$this->exempts->remove(strtolower($player->getName()));
$this->exempts->save();
}
}
示例2: remove
public function remove($name)
{
$past = $this->config->get($name, null);
$this->config->remove($name);
$this->config->save();
return $past;
}
示例3: removeZone
public function removeZone(Zone $zone)
{
$this->zonesConfig->remove($zone->getName());
$permData = $this->permConfig->getAll(false);
foreach ($permData as $key => $value) {
if (array_key_exists($zone->getName(), $value)) {
unset($permData[$key][$zone->getName()]);
$this->permConfig->setAll($permData);
return true;
}
}
return false;
}
示例4: removeShop
public function removeShop($x, $y = 0, $z = 0, $level = null)
{
if ($x instanceof Position) {
$y = $x->getFloorY();
$z = $x->getFloorZ();
$level = $x->getLevel();
$x = $x->getFloorX();
}
if ($level instanceof Level) {
$level = $level->getFolderName();
}
if ($this->config->exists($x . ":" . $y . ":" . $z . ":" . $level)) {
$this->config->remove($x . ":" . $y . ":" . $z . ":" . $level);
return true;
}
return false;
}
示例5: removeWhitelist
/**
* @param string $name
*/
public function removeWhitelist($name)
{
$this->whitelist->remove(strtolower($name));
$this->whitelist->save();
}
示例6: onCommand
public function onCommand(CommandSender $sender, Command $command, $label, array $params)
{
switch (array_shift($params)) {
case "join":
if (!$sender instanceof Player) {
$sender->sendMessage("Please run this command in-game.");
}
if ($this->player->exists($sender->getName())) {
$sender->sendMessage("You already have joined job.");
} else {
$job = array_shift($params);
if (trim($job) === "") {
$sender->sendMessage("Usage: /job join <name>");
break;
}
if ($this->jobs->exists($job)) {
$this->player->set($sender->getName(), $job);
$sender->sendMessage("You have joined to the job \"{$job}\"");
} else {
$sender->sendMessage("There's no job named \"{$job}\"");
}
}
break;
case "retire":
if (!$sender instanceof Player) {
$sender->sendMessage("Please run this command in-game.");
}
if ($this->player->exists($sender->getName())) {
$job = $this->player->get($sender->getName());
$this->player->remove($sender->getName());
$sender->sendMessage("You have retired from the job \"{$job}\"");
} else {
$sender->sendMessage("You don't have job that you've joined");
}
break;
case "list":
$max = 0;
foreach ($this->jobs->getAll() as $d) {
$max += count($d);
}
$max = ceil($max / 5);
$page = array_shift($params);
$page = max(1, $page);
$page = min($max, $page);
$page = (int) $page;
$current = 1;
$n = 1;
$output = "Showing job list page {$page} of {$max} : \n";
foreach ($this->jobs->getAll() as $name => $job) {
$info = "";
foreach ($job as $id => $money) {
$cur = (int) ceil($n / 5);
if ($cur === $page) {
$info .= $name . " : " . $id . " | " . EconomyAPI::getInstance()->getMonetaryUnit() . "" . $money . "\n";
} elseif ($cur > $page) {
break;
}
++$n;
}
$output .= $info;
}
$sender->sendMessage($output);
break;
case "me":
if (!$sender instanceof Player) {
$sender->sendMessage("Please run this command in-game.");
}
if ($this->player->exists($sender->getName())) {
$sender->sendMessage("Your job : " . $this->player->get($sender->getName()));
} else {
$sender->sendMessage("You don't have any jobs you've joined.");
}
break;
default:
$sender->sendMessage($command->getUsage());
}
return true;
}
示例7: removeBackup
/**
* @param string $player
*/
public function removeBackup($player)
{
$this->backups->remove(strtolower($player));
$this->backups->save();
}
示例8: removeDonator
/**
* @param string $name
*/
public function removeDonator($name)
{
if ($this->donators->exists($name, true)) {
$this->donators->remove(strtolower($name));
}
}
示例9: removeSign
public function removeSign(Position $pos)
{
$this->signs->remove($this->posToString($pos));
$this->signs->save();
}
示例10: removeRocketPad
/**
* @param Block $block
*/
public function removeRocketPad(Block $block)
{
$this->pads->remove($block->getFloorX() . ":" . $block->getFloorY() . ":" . $block->getFloorZ() . ":" . strtolower($block->getLevel()->getName()));
$this->pads->save();
}