Update for MC 1.17. Bump version

This commit is contained in:
PikaMug 2021-06-20 02:46:03 -04:00
parent cefe3367f5
commit a8412c948d
8 changed files with 75 additions and 30 deletions

2
dist/pom.xml vendored
View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>4.0.4</version> <version>4.0.5</version>
</parent> </parent>
<artifactId>quests-dist</artifactId> <artifactId>quests-dist</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>4.0.4</version> <version>4.0.5</version>
</parent> </parent>
<artifactId>quests-main</artifactId> <artifactId>quests-main</artifactId>
@ -119,7 +119,7 @@
<dependency> <dependency>
<groupId>com.alessiodp.parties</groupId> <groupId>com.alessiodp.parties</groupId>
<artifactId>parties-api</artifactId> <artifactId>parties-api</artifactId>
<version>3.0.2</version> <version>3.1.6</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -131,7 +131,7 @@
<dependency> <dependency>
<groupId>com.github.PikaMug</groupId> <groupId>com.github.PikaMug</groupId>
<artifactId>LocaleLib</artifactId> <artifactId>LocaleLib</artifactId>
<version>-SNAPSHOT</version> <version>398781f85e</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>

View File

@ -828,8 +828,15 @@ public class Quest implements Comparable<Quest> {
} }
} }
if (plugin.getSettings().canTranslateNames() && text.contains("<item>")) { if (plugin.getSettings().canTranslateNames() && text.contains("<item>")) {
plugin.getLocaleManager().sendMessage(p, text, i.getType(), i.getDurability(), if (!plugin.getLocaleManager().sendMessage(p, text, i.getType(), i.getDurability(),
i.getEnchantments()); i.getEnchantments())) {
for (final Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) {
text = text.replaceFirst("<enchantment>", ItemUtil.getPrettyEnchantmentName(
e.getKey()));
text = text.replaceFirst("<level>", RomanNumeral.getNumeral(e.getValue()));
}
quester.sendMessage(text.replace("<item>", ItemUtil.getName(i)));
}
} else { } else {
for (final Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) { for (final Entry<Enchantment, Integer> e : i.getEnchantments().entrySet()) {
text = text.replaceFirst("<enchantment>", ItemUtil.getPrettyEnchantmentName( text = text.replaceFirst("<enchantment>", ItemUtil.getPrettyEnchantmentName(

View File

@ -2812,7 +2812,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(increment))); sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
} }
@ -2826,7 +2828,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(increment))); sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
} }
@ -2840,7 +2844,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(increment))); sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
} }
@ -2854,7 +2860,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(increment))); sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
} }
@ -2868,7 +2876,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, increment.getType(), increment.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(increment))); sendMessage(message.replace("<item>", ItemUtil.getName(increment)));
} }
@ -2883,7 +2893,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(is))); sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
@ -2898,7 +2910,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(is))); sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
@ -2913,13 +2927,25 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) { if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
// Bukkit version is 1.9+ // Bukkit version is 1.9+
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(),
goal.getEnchantments(), goal.getItemMeta()); goal.getEnchantments(), goal.getItemMeta())) {
for (final Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) {
sendMessage(message.replace("<item>", ItemUtil.getName(is))
.replace("<enchantment>", ItemUtil.getPrettyEnchantmentName(e.getKey()))
.replace("<level>", RomanNumeral.getNumeral(e.getValue())));
}
}
} else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta() } else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta()
&& Material.getMaterial("LINGERING_POTION") == null) { && Material.getMaterial("LINGERING_POTION") == null) {
// Bukkit version is below 1.9 // Bukkit version is below 1.9
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(),
goal.getEnchantments()); goal.getEnchantments())) {
for (final Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) {
sendMessage(message.replace("<item>", ItemUtil.getName(is))
.replace("<enchantment>", ItemUtil.getPrettyEnchantmentName(e.getKey()))
.replace("<level>", RomanNumeral.getNumeral(e.getValue())));
}
}
} else { } else {
for (final Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) { for (final Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)) sendMessage(message.replace("<item>", ItemUtil.getName(is))
@ -2938,13 +2964,17 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) { if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
// Bukkit version is 1.9+ // Bukkit version is 1.9+
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(),
goal.getEnchantments(), goal.getItemMeta()); goal.getEnchantments(), goal.getItemMeta())) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta() } else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta()
&& Material.getMaterial("LINGERING_POTION") == null) { && Material.getMaterial("LINGERING_POTION") == null) {
// Bukkit version is below 1.9 // Bukkit version is below 1.9
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(),
goal.getEnchantments()); goal.getEnchantments())) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(is))); sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
@ -2960,7 +2990,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, goal.getType(), goal.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(is))); sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
@ -2978,7 +3010,9 @@ public class Quester implements Comparable<Quester> {
} }
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta() if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
&& !goal.getItemMeta().hasDisplayName()) { && !goal.getItemMeta().hasDisplayName()) {
plugin.getLocaleManager().sendMessage(p, message, is.getType(), is.getDurability(), null); if (!plugin.getLocaleManager().sendMessage(p, message, is.getType(), is.getDurability(), null)) {
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
}
} else { } else {
sendMessage(message.replace("<item>", ItemUtil.getName(is))); sendMessage(message.replace("<item>", ItemUtil.getName(is)));
} }
@ -3010,7 +3044,9 @@ public class Quester implements Comparable<Quester> {
+ goal.getAmount(); + goal.getAmount();
} }
if (plugin.getSettings().canTranslateNames()) { if (plugin.getSettings().canTranslateNames()) {
plugin.getLocaleManager().sendMessage(p, message, mob, extra); if (!plugin.getLocaleManager().sendMessage(p, message, mob, extra)) {
sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name())));
}
} else { } else {
sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name()))); sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name())));
} }
@ -3049,7 +3085,9 @@ public class Quester implements Comparable<Quester> {
message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount(); message += ChatColor.GREEN + ": " + goal.getAmount() + "/" + goal.getAmount();
} }
if (plugin.getSettings().canTranslateNames()) { if (plugin.getSettings().canTranslateNames()) {
plugin.getLocaleManager().sendMessage(p, message, mob, extra); if (!plugin.getLocaleManager().sendMessage(p, message, mob, extra)) {
sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name())));
}
} else { } else {
sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name()))); sendMessage(message.replace("<mob>", MiscUtil.snakeCaseToUpperCamelCase(mob.name())));
} }

View File

@ -6,12 +6,12 @@
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>4.0.4</version> <version>4.0.5</version>
<name>quests</name> <name>quests</name>
<url>https://github.com/PikaMug/Quests/</url> <url>https://github.com/PikaMug/Quests/</url>
<properties> <properties>
<revision>4.0.4</revision> <revision>4.0.5</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>4.0.4</version> <version>4.0.5</version>
</parent> </parent>
<properties> <properties>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>4.0.4</version> <version>4.0.5</version>
</parent> </parent>
<properties> <properties>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId> <artifactId>quests-parent</artifactId>
<version>4.0.4</version> <version>4.0.5</version>
</parent> </parent>
<properties> <properties>