From 9afeae7774d0ff7014afaee25bb6f7040b06cefc Mon Sep 17 00:00:00 2001 From: Sn0wStorm Date: Fri, 13 Dec 2019 11:43:37 +0100 Subject: [PATCH] Fix Lore order when converting & 1.8 Regeneration --- pom.xml | 31 +-------------------- resources/config/v13/de/config.yml | 1 + resources/config/v13/en/config.yml | 1 + resources/config/v13/fr/config.yml | 1 + resources/config/v13/it/config.yml | 1 + resources/config/v13/zh/config.yml | 1 + src/com/dre/brewery/lore/BrewLore.java | 12 ++++---- src/com/dre/brewery/recipe/PotionColor.java | 3 ++ 8 files changed, 16 insertions(+), 35 deletions(-) diff --git a/pom.xml b/pom.xml index f6b4965..4a1340d 100644 --- a/pom.xml +++ b/pom.xml @@ -97,11 +97,6 @@ brewery-repo https://zebradrive.de/maven/ - - - devoted-repo - https://build.devotedmc.com/plugin/repository/everything/ - CodeMC @@ -113,7 +108,7 @@ org.bukkit bukkit - 1.14.4-R0.1-SNAPSHOT + 1.15-R0.1-SNAPSHOT provided @@ -132,30 +127,6 @@ 1.6 provided - - vg.civcraft.mc.citadel - Citadel - 3.9.1 - provided - - - * - * - - - - - vg.civcraft.mc.civmodcore - CivModCore - 1.6.0 - provided - - - * - * - - - com.sk89q worldguard diff --git a/resources/config/v13/de/config.yml b/resources/config/v13/de/config.yml index c05fa1d..a4afb6d 100644 --- a/resources/config/v13/de/config.yml +++ b/resources/config/v13/de/config.yml @@ -510,6 +510,7 @@ recipes: alcohol: 14 lore: - + &8Viel zu sauer + - +++ Guter Apfelschnaps whiskey: name: Unschöner Whiskey/Whiskey/Scotch Whiskey diff --git a/resources/config/v13/en/config.yml b/resources/config/v13/en/config.yml index c019a0b..84b82c7 100644 --- a/resources/config/v13/en/config.yml +++ b/resources/config/v13/en/config.yml @@ -509,6 +509,7 @@ recipes: alcohol: 14 lore: - +Sour like Acid + - +++ Good Apple Liquor whiskey: name: Unsightly Whiskey/Whiskey/Scotch Whiskey diff --git a/resources/config/v13/fr/config.yml b/resources/config/v13/fr/config.yml index d170454..1c0602f 100644 --- a/resources/config/v13/fr/config.yml +++ b/resources/config/v13/fr/config.yml @@ -516,6 +516,7 @@ recipes: alcohol: 14 lore: - +Sour like Acid + - +++ Good Apple Liquor whiskey: name: Whisky disgracieux/Whiskey/Scotch Whiskey diff --git a/resources/config/v13/it/config.yml b/resources/config/v13/it/config.yml index 9da7751..c2a206f 100644 --- a/resources/config/v13/it/config.yml +++ b/resources/config/v13/it/config.yml @@ -509,6 +509,7 @@ recipes: alcohol: 14 lore: - +Sour like Acid + - +++ Good Apple Liquor whiskey: name: Unsightly Whiskey/Whiskey/Scotch Whiskey diff --git a/resources/config/v13/zh/config.yml b/resources/config/v13/zh/config.yml index 11f0ec7..4342df9 100644 --- a/resources/config/v13/zh/config.yml +++ b/resources/config/v13/zh/config.yml @@ -513,6 +513,7 @@ recipes: alcohol: 14 lore: - +Sour like Acid + - +++ Good Apple Liquor whiskey: name: Unsightly Whiskey/Whiskey/Scotch Whiskey diff --git a/src/com/dre/brewery/lore/BrewLore.java b/src/com/dre/brewery/lore/BrewLore.java index 7288381..8dba914 100644 --- a/src/com/dre/brewery/lore/BrewLore.java +++ b/src/com/dre/brewery/lore/BrewLore.java @@ -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); } /** diff --git a/src/com/dre/brewery/recipe/PotionColor.java b/src/com/dre/brewery/recipe/PotionColor.java index 448ec5c..203ed31 100644 --- a/src/com/dre/brewery/recipe/PotionColor.java +++ b/src/com/dre/brewery/recipe/PotionColor.java @@ -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); } }