Skip to content

Commit

Permalink
Account for Villager without Profession. Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaMug committed Jan 29, 2021
1 parent a9277f3 commit f21dde4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>me.pikamug.localelib</groupId>
<artifactId>LocaleLib</artifactId>
<version>1.8</version>
<version>1.9</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/me/pikamug/localelib/LocaleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ public boolean sendMessage(final Player player, final String message, final Enti
}
String key = "";
if (oldVersion) {
if (type.name().equals("VILLAGER") && Profession.valueOf(extra) != null) {
key = oldEntities.get(type.name() + "." + Profession.valueOf(extra).name());
if (type.name().equals("VILLAGER")) {
if (extra != null && Profession.valueOf(extra) != null) {
key = oldEntities.get(type.name() + "." + Profession.valueOf(extra).name());
} else {
key = oldEntities.get(type.name());
}
} else if (type.name().equals("OCELOT") && Ocelot.Type.valueOf(extra) != null) {
key = oldEntities.get(type.name() + "." + Ocelot.Type.valueOf(extra).name());
} else if (type.name().equals("RABBIT") && Rabbit.Type.valueOf(extra) != null
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: LocaleLib
main: me.pikamug.localelib.LocaleLib
version: 1.8
version: 1.9
api-version: 1.13
description: Show translated names of items, entities & more in client's language
website: https://www.spigotmc.org/resources/quests.3711/
Expand Down

0 comments on commit f21dde4

Please sign in to comment.