mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +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
|
||||
*/
|
||||
public static function getEnchantment(int $id){
|
||||
if(isset(self::$enchantments[$id])){
|
||||
return self::$enchantments[$id];
|
||||
}
|
||||
return null;
|
||||
return self::$enchantments[$id] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user