mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 15:36:08 +00:00
Use 'enchanting' terminology
'enchant' just didn't feel right, being a verb. All these things pertain to the act of enchanting. This is now also consistent with CraftingTransaction etc. The ship already sailed on EnchantInventory, which will have to be renamed at a later datte. However, that was already inconsistent with 'enchanting table', so that's the odd one out here.
This commit is contained in:
@@ -45,7 +45,7 @@ use function round;
|
||||
/**
|
||||
* Helper methods used for enchanting using the enchanting table.
|
||||
*/
|
||||
final class EnchantHelper{
|
||||
final class EnchantingHelper{
|
||||
private const MAX_BOOKSHELF_COUNT = 15;
|
||||
|
||||
private function __construct(){
|
||||
@@ -73,7 +73,7 @@ final class EnchantHelper{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return EnchantOption[]
|
||||
* @return EnchantingOption[]
|
||||
*/
|
||||
public static function generateOptions(Position $tablePos, Item $input, int $seed) : array{
|
||||
if($input->isNull() || $input->hasEnchantments()){
|
||||
@@ -89,9 +89,9 @@ final class EnchantHelper{
|
||||
$bottomRequiredLevel = max($baseRequiredLevel, $bookshelfCount * 2);
|
||||
|
||||
return [
|
||||
self::createEnchantOption($random, $input, $topRequiredLevel),
|
||||
self::createEnchantOption($random, $input, $middleRequiredLevel),
|
||||
self::createEnchantOption($random, $input, $bottomRequiredLevel),
|
||||
self::createOption($random, $input, $topRequiredLevel),
|
||||
self::createOption($random, $input, $middleRequiredLevel),
|
||||
self::createOption($random, $input, $bottomRequiredLevel),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ final class EnchantHelper{
|
||||
return $bookshelfCount;
|
||||
}
|
||||
|
||||
private static function createEnchantOption(Random $random, Item $inputItem, int $requiredXpLevel) : EnchantOption{
|
||||
private static function createOption(Random $random, Item $inputItem, int $requiredXpLevel) : EnchantingOption{
|
||||
$enchantingPower = $requiredXpLevel;
|
||||
|
||||
$enchantability = $inputItem->getEnchantability();
|
||||
@@ -171,7 +171,7 @@ final class EnchantHelper{
|
||||
}
|
||||
}
|
||||
|
||||
return new EnchantOption($requiredXpLevel, self::getRandomOptionName($random), $resultEnchantments);
|
||||
return new EnchantingOption($requiredXpLevel, self::getRandomOptionName($random), $resultEnchantments);
|
||||
}
|
||||
|
||||
/**
|
@@ -27,7 +27,7 @@ namespace pocketmine\item\enchantment;
|
||||
* Represents an option on the enchanting table menu.
|
||||
* If selected, all the enchantments in the option will be applied to the item.
|
||||
*/
|
||||
class EnchantOption{
|
||||
class EnchantingOption{
|
||||
|
||||
/**
|
||||
* @param EnchantmentInstance[] $enchantments
|
Reference in New Issue
Block a user