src/main/java/me/hyfe/simplespigot/item/SpigotItem.java
/**
         * Adds an enchant to the item in the builder using its name.
         *
         * @param enchant The name of the enchant (could be :level as well).
         * @return The builder.
         */
Adds an enchant to the item in the builder using its name.
@param enchant The name of the enchant (could be :level as well).
@return The builder.
Adds an enchant to the item in the builder using its name . @param enchant The name of the enchant ( could be : level as well ) . @return The builder .
public Builder enchant(String enchant) {
            String[] enchantSplit = enchant.split(":");
            if (enchantSplit.length == 2) {
                Enchantment enchantment = Enchantment.getByName(enchantSplit[0]);
                int level = Integer.parseInt(enchantSplit[1]);
                if (enchantment == null) {
                    return this;
                }
                this.enchants.put(enchantment, level);
            }
            return this;
        }
public Builder enchant ( String enchant ) { String [ ] enchantSplit = enchant . split ( ":" ) ; if ( enchantSplit . length == 2 ) { Enchantment enchantment = Enchantment . getByName ( enchantSplit [ 0 ] ) ; int level = Integer . parseInt ( enchantSplit [ 1 ] ) ; if ( enchantment == null ) { return this ; } this . enchants . put ( enchantment , level ) ; } return this ; }
Adds an enchant to the item in the builder using its name.
Adds an enchant to the item in the builder using its name .