mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Enchantment: Simplify getEnchantment() with null coalesce
This is made possible by 0e538ee51dc543e97994899bbf7a73f288fb33a6.
This commit is contained in:
parent
6490d99ac2
commit
c2b0f6af22
@ -107,10 +107,7 @@ class Enchantment{
|
|||||||
* @return Enchantment|null
|
* @return Enchantment|null
|
||||||
*/
|
*/
|
||||||
public static function getEnchantment(int $id){
|
public static function getEnchantment(int $id){
|
||||||
if(isset(self::$enchantments[$id])){
|
return self::$enchantments[$id] ?? null;
|
||||||
return self::$enchantments[$id];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user