mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 06:38:56 +00:00
Fix Lore order when converting & 1.8 Regeneration
This commit is contained in:
@@ -304,15 +304,17 @@ public class BrewLore {
|
||||
*/
|
||||
public int addOrReplaceLore(Type type, String prefix, String line) {
|
||||
int index = type.findInLore(lore);
|
||||
if (index == -1) {
|
||||
index = BUtil.indexOfSubstring(lore, line);
|
||||
}
|
||||
if (index > -1) {
|
||||
lore.set(index, type.id + prefix + line);
|
||||
return index;
|
||||
} else {
|
||||
return addLore(type, prefix, line);
|
||||
}
|
||||
|
||||
// Could not find Lore by type, find and replace by substring
|
||||
index = BUtil.indexOfSubstring(lore, line);
|
||||
if (index > -1) {
|
||||
lore.remove(index);
|
||||
}
|
||||
return addLore(type, prefix, line);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.potion.PotionType;
|
||||
|
||||
public class PotionColor {
|
||||
@@ -75,6 +76,8 @@ public class PotionColor {
|
||||
}
|
||||
} else {
|
||||
potion.setDurability(getColorId(destillable));
|
||||
// To stop 1.8 from showing the potioneffect for the color id, add a dummy Effect
|
||||
meta.addCustomEffect(PotionEffectType.REGENERATION.createEffect(0, 0), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user