mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 15:36:08 +00:00
Move enchanting seed generation to EnchantmentHelper
This commit is contained in:
@@ -28,6 +28,7 @@ use pocketmine\item\enchantment\AvailableEnchantmentRegistry as EnchantmentRegis
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemTypeIds;
|
||||
use pocketmine\item\VanillaItems as Items;
|
||||
use pocketmine\utils\Limits;
|
||||
use pocketmine\utils\Random;
|
||||
use pocketmine\world\Position;
|
||||
use function abs;
|
||||
@@ -37,6 +38,7 @@ use function count;
|
||||
use function floor;
|
||||
use function max;
|
||||
use function min;
|
||||
use function mt_rand;
|
||||
use function ord;
|
||||
use function round;
|
||||
|
||||
@@ -47,6 +49,13 @@ final class EnchantmentHelper{
|
||||
//NOOP
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a new random seed for enchant option randomization.
|
||||
*/
|
||||
public static function generateSeed() : int{
|
||||
return mt_rand(Limits::INT32_MIN, Limits::INT32_MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EnchantmentInstance[] $enchantments
|
||||
*/
|
||||
|
Reference in New Issue
Block a user