aboutsummaryrefslogtreecommitdiffstats
path: root/bukkit/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'bukkit/src/main/java')
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetterLatest.java11
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_1_13.java11
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_Late_1_8.java11
3 files changed, 12 insertions, 21 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetterLatest.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetterLatest.java
index d2515948..1c7331e1 100644
--- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetterLatest.java
+++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetterLatest.java
@@ -45,7 +45,7 @@ public class ItemGetterLatest implements ItemGetter {
}
List<Filter> filters = Arrays.asList(excludes);
- String cName = config.getString(path + "name", path + "name");
+ String cName = config.getString(path + "name");
String cType = config.getString(path + "item", config.getString(path + "type", path + "item"));
boolean hasCustomModelData = config.contains(path + "custommodeldata");
int customModelData = config.getInt(path + "custommodeldata", 0);
@@ -55,10 +55,6 @@ public class ItemGetterLatest implements ItemGetter {
boolean hasAttributeModifiers = config.contains(path + "attributemodifiers");
List<Map<?, ?>> cAttributeModifiers = config.getMapList(path + "attributemodifiers");
- String name;
- Material type = null;
- int data = 0;
-
// material
ItemStack is = getItemStack(cType);
ItemMeta ism = is.getItemMeta();
@@ -98,8 +94,9 @@ public class ItemGetterLatest implements ItemGetter {
// name
if (!filters.contains(Filter.DISPLAY_NAME)) {
- name = Chat.color(cName);
- ism.setDisplayName(name);
+ if (cName != null) {
+ ism.setDisplayName(Chat.color(cName));
+ }
}
// lore
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_1_13.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_1_13.java
index f9a488f2..60d93a74 100644
--- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_1_13.java
+++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_1_13.java
@@ -44,7 +44,7 @@ public class ItemGetter_1_13 implements ItemGetter {
}
List<Filter> filters = Arrays.asList(excludes);
- String cName = config.getString(path + "name", path + "name");
+ String cName = config.getString(path + "name");
String cType = config.getString(path + "item", config.getString(path + "type", path + "item"));
boolean unbreakable = config.getBoolean(path + "unbreakable", false);
List<String> cLore = config.getStringList(path + "lore");
@@ -52,10 +52,6 @@ public class ItemGetter_1_13 implements ItemGetter {
boolean hasAttributeModifiers = config.contains(path + "attributemodifiers");
List<Map<?, ?>> cAttributeModifiers = config.getMapList(path + "attributemodifiers");
- String name;
- Material type = null;
- int data = 0;
-
// material
ItemStack is = getItemStack(cType);
ItemMeta ism = is.getItemMeta();
@@ -95,8 +91,9 @@ public class ItemGetter_1_13 implements ItemGetter {
// name
if (!filters.contains(Filter.DISPLAY_NAME)) {
- name = Chat.color(cName);
- ism.setDisplayName(name);
+ if (cName != null) {
+ ism.setDisplayName(Chat.color(cName));
+ }
}
// lore
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_Late_1_8.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_Late_1_8.java
index 5e19f095..111415eb 100644
--- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_Late_1_8.java
+++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/itemgetter/ItemGetter_Late_1_8.java
@@ -41,15 +41,11 @@ public class ItemGetter_Late_1_8 implements ItemGetter {
List<Filter> filters = Arrays.asList(excludes);
- String cName = config.getString(path + "name", path + "name");
+ String cName = config.getString(path + "name");
String cType = config.getString(path + "item", config.getString(path + "type", path + "item"));
List<String> cLore = config.getStringList(path + "lore");
List<String> cItemFlags = config.getStringList(path + "itemflags");
- String name;
- Material type = null;
- int data = 0;
-
// material
ItemStack is = getItemStack(cType);
ItemMeta ism = is.getItemMeta();
@@ -96,8 +92,9 @@ public class ItemGetter_Late_1_8 implements ItemGetter {
// name
if (!filters.contains(Filter.DISPLAY_NAME)) {
- name = Chat.color(cName);
- ism.setDisplayName(name);
+ if (cName != null) {
+ ism.setDisplayName(Chat.color(cName));
+ }
}