mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Enchantment: Simplify getEnchantment() with null coalesce
This is made possible by 0e538ee51d
.
This commit is contained in:
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user