mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
added nullsafe function, time should be set instantly after player joined, some php8 fixes
This commit is contained in:
parent
695f9f1484
commit
a66176b75d
5 changed files with 41 additions and 22 deletions
|
|
@ -293,10 +293,10 @@ class BlockAPI{
|
|||
}
|
||||
break;
|
||||
case "give":
|
||||
$player = $this->server->api->player->get($args[0]);
|
||||
$player = $this->server->api->player->get(nullsafe($args[0], ""));
|
||||
|
||||
if($player instanceof Player){
|
||||
$item = self::fromString($args[1]);
|
||||
$item = self::fromString(nullsafe($args[1], ""));
|
||||
if(($player->gamemode & 0x01) === 0x01){
|
||||
$output .= "Player is in creative mode.";
|
||||
break;
|
||||
|
|
@ -316,7 +316,7 @@ class BlockAPI{
|
|||
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username;
|
||||
break;
|
||||
}else{
|
||||
$item = self::fromString($args[0]);
|
||||
$item = self::fromString(nullsafe($args[0], ""));
|
||||
if(!($issuer instanceof Player)){
|
||||
return "You cant give an item to a non-player.";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue