mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
More changes!
This commit is contained in:
@ -155,6 +155,8 @@ class Enchantment{
|
||||
|
||||
public function setLevel($level){
|
||||
$this->level = (int) $level;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
55
src/pocketmine/item/enchantment/EnchantmentEntry.php
Normal file
55
src/pocketmine/item/enchantment/EnchantmentEntry.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\item\enchantment;
|
||||
|
||||
|
||||
class EnchantmentEntry{
|
||||
|
||||
/** @var Enchantment[] */
|
||||
private $enchantments;
|
||||
private $cost;
|
||||
private $randomName;
|
||||
|
||||
/**
|
||||
* @param Enchantment[] $enchantments
|
||||
* @param $cost
|
||||
* @param $randomName
|
||||
*/
|
||||
public function __construct(array $enchantments, $cost, $randomName){
|
||||
$this->enchantments = $enchantments;
|
||||
$this->cost = (int) $cost;
|
||||
$this->randomName = $randomName;
|
||||
}
|
||||
|
||||
public function getEnchantments(){
|
||||
return $this->enchantments;
|
||||
}
|
||||
|
||||
public function getCost(){
|
||||
return $this->cost;
|
||||
}
|
||||
|
||||
public function getRandomName(){
|
||||
return $this->randomName;
|
||||
}
|
||||
|
||||
}
|
54
src/pocketmine/item/enchantment/EnchantmentList.php
Normal file
54
src/pocketmine/item/enchantment/EnchantmentList.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\item\enchantment;
|
||||
|
||||
|
||||
class EnchantmentList{
|
||||
|
||||
/** @var EnchantmentEntry[] */
|
||||
private $enchantments;
|
||||
|
||||
public function __construct($size){
|
||||
$this->enchantments = new \SplFixedArray($size);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $slot
|
||||
* @param EnchantmentEntry $entry
|
||||
*/
|
||||
public function setSlot($slot, EnchantmentEntry $entry){
|
||||
$this->enchantments[$slot] = $entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $slot
|
||||
* @return EnchantmentEntry
|
||||
*/
|
||||
public function getSlot($slot){
|
||||
return $this->enchantments[$slot];
|
||||
}
|
||||
|
||||
public function getSize(){
|
||||
return $this->enchantments->getSize();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user