php5 is dead, reverted some teleport tweaks, nullsafe is deprecated, cactus hitbox is fixed

This commit is contained in:
GameHerobrine 2023-08-21 01:34:44 +03:00
parent 2e374fb09c
commit 0c8b56e22b
11 changed files with 35 additions and 58 deletions

View file

@ -293,10 +293,10 @@ class BlockAPI{
}
break;
case "give":
$player = $this->server->api->player->get(nullsafe($args[0], ""));
$player = $this->server->api->player->get($args[0] ?? "");
if($player instanceof Player){
$item = self::fromString(nullsafe($args[1], ""));
$item = self::fromString($args[1] ?? "");
if(($player->gamemode & 0x01) === 0x01){
return "Player is in creative mode.";
}
@ -314,7 +314,7 @@ class BlockAPI{
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username;
break;
}else{
$item = self::fromString(nullsafe($args[0], ""));
$item = self::fromString($args[0] ?? "");
if(!($issuer instanceof Player)){
return "You cant give an item to a non-player.";
}