phpdoc armageddon for master, pass 1

This commit is contained in:
Dylan K. Taylor
2020-01-22 11:55:03 +00:00
parent 4bae3baa74
commit 67bcc1c0fb
397 changed files with 0 additions and 5391 deletions

View File

@ -220,27 +220,15 @@ class Enchantment{
/**
* Registers an enchantment type.
*
* @param Enchantment $enchantment
*/
public static function register(Enchantment $enchantment) : void{
self::$enchantments[$enchantment->getId()] = clone $enchantment;
}
/**
* @param int $id
*
* @return Enchantment|null
*/
public static function get(int $id) : ?Enchantment{
return self::$enchantments[$id] ?? null;
}
/**
* @param string $name
*
* @return Enchantment|null
*/
public static function fromString(string $name) : ?Enchantment{
$const = Enchantment::class . "::" . strtoupper($name);
if(defined($const)){
@ -262,14 +250,6 @@ class Enchantment{
/** @var int */
private $maxLevel;
/**
* @param int $id
* @param string $name
* @param int $rarity
* @param int $primaryItemFlags
* @param int $secondaryItemFlags
* @param int $maxLevel
*/
public function __construct(int $id, string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel){
$this->id = $id;
$this->name = $name;
@ -281,7 +261,6 @@ class Enchantment{
/**
* Returns the ID of this enchantment as per Minecraft PE
* @return int
*/
public function getId() : int{
return $this->id;
@ -289,7 +268,6 @@ class Enchantment{
/**
* Returns a translation key for this enchantment's name.
* @return string
*/
public function getName() : string{
return $this->name;
@ -297,7 +275,6 @@ class Enchantment{
/**
* Returns an int constant indicating how rare this enchantment type is.
* @return int
*/
public function getRarity() : int{
return $this->rarity;
@ -305,8 +282,6 @@ class Enchantment{
/**
* Returns a bitset indicating what item types can have this item applied from an enchanting table.
*
* @return int
*/
public function getPrimaryItemFlags() : int{
return $this->primaryItemFlags;
@ -315,8 +290,6 @@ class Enchantment{
/**
* Returns a bitset indicating what item types cannot have this item applied from an enchanting table, but can from
* an anvil.
*
* @return int
*/
public function getSecondaryItemFlags() : int{
return $this->secondaryItemFlags;
@ -324,10 +297,6 @@ class Enchantment{
/**
* Returns whether this enchantment can apply to the item type from an enchanting table.
*
* @param int $flag
*
* @return bool
*/
public function hasPrimaryItemType(int $flag) : bool{
return ($this->primaryItemFlags & $flag) !== 0;
@ -335,10 +304,6 @@ class Enchantment{
/**
* Returns whether this enchantment can apply to the item type from an anvil, if it is not a primary item.
*
* @param int $flag
*
* @return bool
*/
public function hasSecondaryItemType(int $flag) : bool{
return ($this->secondaryItemFlags & $flag) !== 0;
@ -346,7 +311,6 @@ class Enchantment{
/**
* Returns the maximum level of this enchantment that can be found on an enchantment table.
* @return int
*/
public function getMaxLevel() : int{
return $this->maxLevel;