From 9947e131211bab07a7b7d7bf816ba871e1fbb873 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 23 Oct 2020 21:04:27 +0100 Subject: [PATCH] Yank constants out of Enchantment base class --- src/item/enchantment/Enchantment.php | 65 ------------------ src/item/enchantment/EnchantmentIds.php | 69 ++++++++++++++++++++ src/item/enchantment/ItemFlags.php | 55 ++++++++++++++++ src/item/enchantment/Rarity.php | 35 ++++++++++ src/item/enchantment/VanillaEnchantments.php | 38 +++++------ 5 files changed, 178 insertions(+), 84 deletions(-) create mode 100644 src/item/enchantment/EnchantmentIds.php create mode 100644 src/item/enchantment/ItemFlags.php create mode 100644 src/item/enchantment/Rarity.php diff --git a/src/item/enchantment/Enchantment.php b/src/item/enchantment/Enchantment.php index 85c321d36..f2a9101da 100644 --- a/src/item/enchantment/Enchantment.php +++ b/src/item/enchantment/Enchantment.php @@ -30,71 +30,6 @@ use function constant; */ class Enchantment{ - public const PROTECTION = 0; - public const FIRE_PROTECTION = 1; - public const FEATHER_FALLING = 2; - public const BLAST_PROTECTION = 3; - public const PROJECTILE_PROTECTION = 4; - public const THORNS = 5; - public const RESPIRATION = 6; - public const DEPTH_STRIDER = 7; - public const AQUA_AFFINITY = 8; - public const SHARPNESS = 9; - public const SMITE = 10; - public const BANE_OF_ARTHROPODS = 11; - public const KNOCKBACK = 12; - public const FIRE_ASPECT = 13; - public const LOOTING = 14; - public const EFFICIENCY = 15; - public const SILK_TOUCH = 16; - public const UNBREAKING = 17; - public const FORTUNE = 18; - public const POWER = 19; - public const PUNCH = 20; - public const FLAME = 21; - public const INFINITY = 22; - public const LUCK_OF_THE_SEA = 23; - public const LURE = 24; - public const FROST_WALKER = 25; - public const MENDING = 26; - public const BINDING = 27; - public const VANISHING = 28; - public const IMPALING = 29; - public const RIPTIDE = 30; - public const LOYALTY = 31; - public const CHANNELING = 32; - public const MULTISHOT = 33; - public const PIERCING = 34; - public const QUICK_CHARGE = 35; - public const SOUL_SPEED = 36; - - public const RARITY_COMMON = 10; - public const RARITY_UNCOMMON = 5; - public const RARITY_RARE = 2; - public const RARITY_MYTHIC = 1; - - public const SLOT_NONE = 0x0; - public const SLOT_ALL = 0xffff; - public const SLOT_ARMOR = self::SLOT_HEAD | self::SLOT_TORSO | self::SLOT_LEGS | self::SLOT_FEET; - public const SLOT_HEAD = 0x1; - public const SLOT_TORSO = 0x2; - public const SLOT_LEGS = 0x4; - public const SLOT_FEET = 0x8; - public const SLOT_SWORD = 0x10; - public const SLOT_BOW = 0x20; - public const SLOT_TOOL = self::SLOT_HOE | self::SLOT_SHEARS | self::SLOT_FLINT_AND_STEEL; - public const SLOT_HOE = 0x40; - public const SLOT_SHEARS = 0x80; - public const SLOT_FLINT_AND_STEEL = 0x100; - public const SLOT_DIG = self::SLOT_AXE | self::SLOT_PICKAXE | self::SLOT_SHOVEL; - public const SLOT_AXE = 0x200; - public const SLOT_PICKAXE = 0x400; - public const SLOT_SHOVEL = 0x800; - public const SLOT_FISHING_ROD = 0x1000; - public const SLOT_CARROT_STICK = 0x2000; - public const SLOT_ELYTRA = 0x4000; - public const SLOT_TRIDENT = 0x8000; - /** @var int */ private $id; /** @var string */ diff --git a/src/item/enchantment/EnchantmentIds.php b/src/item/enchantment/EnchantmentIds.php new file mode 100644 index 000000000..cf64bb569 --- /dev/null +++ b/src/item/enchantment/EnchantmentIds.php @@ -0,0 +1,69 @@ +