mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Unhackify Registry member cloning, fixes #3519
This commit is contained in:
@ -23,8 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\utils\CloningRegistryTrait;
|
||||
use pocketmine\utils\RegistryTrait;
|
||||
use pocketmine\utils\Utils;
|
||||
use function assert;
|
||||
|
||||
/**
|
||||
@ -665,7 +665,7 @@ use function assert;
|
||||
* @method static Wool YELLOW_WOOL()
|
||||
*/
|
||||
final class VanillaBlocks{
|
||||
use RegistryTrait;
|
||||
use CloningRegistryTrait;
|
||||
|
||||
private function __construct(){
|
||||
//NOOP
|
||||
@ -678,14 +678,14 @@ final class VanillaBlocks{
|
||||
public static function fromString(string $name) : Block{
|
||||
$result = self::_registryFromString($name);
|
||||
assert($result instanceof Block);
|
||||
return clone $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block[]
|
||||
*/
|
||||
public static function getAll() : array{
|
||||
return Utils::cloneObjectArray(self::_registryGetAll());
|
||||
return self::_registryGetAll();
|
||||
}
|
||||
|
||||
protected static function setup() : void{
|
||||
|
Reference in New Issue
Block a user