Compare commits
2 Commits
8ed46fdd32
...
8536837ec9
Author | SHA1 | Date |
---|---|---|
Matteo Planchet | 8536837ec9 | |
Matteo Planchet | 900946cbff |
|
@ -11,6 +11,8 @@ import com.dre.brewery.recipe.RecipeItem;
|
|||
import com.dre.brewery.recipe.PotionColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -132,6 +134,9 @@ public class BIngredients {
|
|||
cookRecipe.getColor().colorBrew(potionMeta, potion, false);
|
||||
brew.updateCustomModelData(potionMeta);
|
||||
|
||||
if (cookRecipe.hasGlint()) {
|
||||
potionMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
}
|
||||
} else {
|
||||
// new base potion
|
||||
brew = new Brew(this);
|
||||
|
@ -179,6 +184,9 @@ public class BIngredients {
|
|||
}
|
||||
brew.save(potionMeta);
|
||||
potion.setItemMeta(potionMeta);
|
||||
if (cookRecipe != null && cookRecipe.hasGlint()) {
|
||||
potion.addUnsafeEnchantment(Enchantment.LURE, 1);
|
||||
}
|
||||
P.p.stats.metricsForCreate(false);
|
||||
|
||||
return potion;
|
||||
|
|
|
@ -710,6 +710,10 @@ public class Brew implements Cloneable {
|
|||
lore.addOrReplaceEffects(getEffects(), quality);
|
||||
potionMeta.setDisplayName(P.p.color("&f" + recipe.getName(quality)));
|
||||
recipe.getColor().colorBrew(potionMeta, item, canDistill());
|
||||
|
||||
if (recipe.hasGlint()) {
|
||||
potionMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
}
|
||||
} else {
|
||||
quality = 0;
|
||||
lore.convertLore(false);
|
||||
|
@ -749,6 +753,9 @@ public class Brew implements Cloneable {
|
|||
}
|
||||
save(potionMeta);
|
||||
item.setItemMeta(potionMeta);
|
||||
if (currentRecipe != null && currentRecipe.hasGlint()) {
|
||||
item.addUnsafeEnchantment(Enchantment.LURE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -806,8 +813,8 @@ public class Brew implements Cloneable {
|
|||
|
||||
recipe.getColor().colorBrew(potionMeta, potion, false);
|
||||
updateCustomModelData(potionMeta);
|
||||
|
||||
potionMeta.setDisplayName(P.p.color("&f" + recipe.getName(quality)));
|
||||
|
||||
potionMeta.setDisplayName(P.p.color("&f" + recipe.getName(quality)));
|
||||
|
||||
if (recipe.hasGlint()) {
|
||||
potionMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
|
|
Loading…
Reference in New Issue