mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 03:16:35 +00:00
Removed redundant checks from ItemFactory::init() and BlockFactory::init()
These are never called accidentally, or at least it's highly unlikely to do so. It might be reasonable to throw exceptions for this, but for the meantime they are redundant - extra indentation for no good reason. This also removes the $force parameter from BlockFactory::init().
This commit is contained in:
parent
456987e212
commit
af2435f199
@ -53,11 +53,8 @@ class BlockFactory{
|
|||||||
/**
|
/**
|
||||||
* Initializes the block factory. By default this is called only once on server start, however you may wish to use
|
* Initializes the block factory. By default this is called only once on server start, however you may wish to use
|
||||||
* this if you need to reset the block factory back to its original defaults for whatever reason.
|
* this if you need to reset the block factory back to its original defaults for whatever reason.
|
||||||
*
|
|
||||||
* @param bool $force
|
|
||||||
*/
|
*/
|
||||||
public static function init(bool $force = false) : void{
|
public static function init() : void{
|
||||||
if(self::$list === null or $force){
|
|
||||||
self::$list = new \SplFixedArray(256);
|
self::$list = new \SplFixedArray(256);
|
||||||
self::$fullList = new \SplFixedArray(4096);
|
self::$fullList = new \SplFixedArray(4096);
|
||||||
|
|
||||||
@ -326,7 +323,6 @@ class BlockFactory{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a block type into the index. Plugins may use this method to register new block types or override
|
* Registers a block type into the index. Plugins may use this method to register new block types or override
|
||||||
|
@ -36,7 +36,6 @@ class ItemFactory{
|
|||||||
private static $list = null;
|
private static $list = null;
|
||||||
|
|
||||||
public static function init(){
|
public static function init(){
|
||||||
if(self::$list === null){
|
|
||||||
self::$list = new \SplFixedArray(65536);
|
self::$list = new \SplFixedArray(65536);
|
||||||
|
|
||||||
self::registerItem(new Shovel(Item::IRON_SHOVEL, 0, "Iron Shovel", TieredTool::TIER_IRON));
|
self::registerItem(new Shovel(Item::IRON_SHOVEL, 0, "Iron Shovel", TieredTool::TIER_IRON));
|
||||||
@ -254,7 +253,6 @@ class ItemFactory{
|
|||||||
//TODO: RECORD_11
|
//TODO: RECORD_11
|
||||||
//TODO: RECORD_WAIT
|
//TODO: RECORD_WAIT
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an item type into the index. Plugins may use this method to register new item types or override existing
|
* Registers an item type into the index. Plugins may use this method to register new item types or override existing
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit cc9a6402efa486e5dd7c39732f81702af1569707
|
Subproject commit b41d9836e4edec015cb92e3a4b42cfdaa566b34b
|
Loading…
x
Reference in New Issue
Block a user