mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-02 11:21:20 +01:00
Add weapon level as crafting requirement
Format is 'mmoitem <ITEM_TYPE> <ITEM_ID> <amount> <gui_display_name> [item level]' please add this to your crafting-stations.yml lang file ingredient: mmoitem: positive: '&8✔ &7#amount# lvl.#level# #item#' negative: '&c✖ &7#amount# lvl.#level# #item#'
This commit is contained in:
parent
f7e3894fff
commit
1ad446d1a1
@ -64,7 +64,7 @@ public class MMOItemIngredient extends Ingredient {
|
||||
|
||||
@Override
|
||||
public String formatDisplay(String string) {
|
||||
return string.replace("#item#", getName()).replace("#level#", getLevel() != 0 ? "lvl." + getLevel() : "").replace("#amount#", "" + getAmount());
|
||||
return string.replace("#item#", getName()).replace("#level#", getLevel() != 0 ? "" + getLevel() : "").replace("#amount#", "" + getAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +62,7 @@ public class UpgradingRecipe extends Recipe {
|
||||
}
|
||||
|
||||
UpgradingRecipeInfo recipe = (UpgradingRecipeInfo) uncastRecipe;
|
||||
if (!(recipe.mmoitem = new MMOItem(MMOLib.plugin.getNMS().getNBTItem(inv.getIngredient(ingredient, false).getFirstItem()))).hasData(ItemStat.UPGRADE))
|
||||
if (!(recipe.mmoitem = new MMOItem(MMOLib.plugin.getNMS().getNBTItem(inv.getIngredient(ingredient, true).getFirstItem()))).hasData(ItemStat.UPGRADE))
|
||||
return false;
|
||||
|
||||
if (!(recipe.upgradeData = (UpgradeData) recipe.getMMOItem().getData(ItemStat.UPGRADE)).canLevelUp()) {
|
||||
|
@ -41,7 +41,7 @@ recipes:
|
||||
- 'perms mmoitems.recipe.steel-sword mmoitems.recipe.station.steel'
|
||||
|
||||
# Ingredients needed for the recipe
|
||||
# Format 1: 'mmoitem <ITEM_TYPE> <ITEM_ID> <amount> <gui_display_name>'
|
||||
# Format 1: 'mmoitem <ITEM_TYPE> <ITEM_ID> <amount> <gui_display_name> [item level]'
|
||||
# Format 2: 'vanilla <MATERIAL> <display_name> <amount> <gui_display_name>'
|
||||
ingredients:
|
||||
- 'mmoitem MATERIAL STEEL_INGOT 4 Steel_Ingot'
|
||||
@ -63,7 +63,7 @@ recipes:
|
||||
conditions:
|
||||
- 'level 8'
|
||||
ingredients:
|
||||
- 'mmoitem MATERIAL STEEL_INGOT 8 Steel_Ingot'
|
||||
- 'mmoitem SWORD STEEL_SWORD 1 Steel_Sword 5'
|
||||
- 'vanilla STICK . 4 Wooden_Stick'
|
||||
katana:
|
||||
output:
|
||||
|
Loading…
Reference in New Issue
Block a user