aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2021-04-02 14:33:41 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2021-04-02 14:33:41 +0100
commitad998b35da4bb70b6564d08a02b71feedf8e6f7e (patch)
treea6edc41488a438054b6d3b2f37b19962fd0cfa09 /src/main/java
parent3bc61fa1b1fe0697ac0a33265e5fd05b2ceca381 (diff)
Fix enchantment for 1.8
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/leonardobishop/quests/commands/CommandQuests.java16
-rw-r--r--src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_1_13.java1
-rw-r--r--src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_Late_1_8.java2
3 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java b/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java
index 178f0390..742b5592 100644
--- a/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java
+++ b/src/main/java/com/leonardobishop/quests/commands/CommandQuests.java
@@ -98,6 +98,21 @@ public class CommandQuests implements TabExecutor {
} else if (args[1].equalsIgnoreCase("config")) {
showProblems(sender);
return true;
+ //TODO
+// } else if (args[1].equalsIgnoreCase("itemstack")) {
+// if (!(sender instanceof Player)) {
+// sender.sendMessage("You must be a player to use this command.");
+// return true;
+// }
+// Player player = (Player) sender;
+// ItemStack is = player.getItemInHand();
+// if (is == null || is.getType() == Material.AIR) {
+// sender.sendMessage(ChatColor.GRAY + "There is no information about this ItemStack.");
+// return true;
+// }
+// sender.sendMessage(ToStringBuilder.reflectionToString(is));
+// sender.sendMessage(ToStringBuilder.reflectionToString(is.getItemMeta()));
+// return true;
} else if (args[1].equalsIgnoreCase("types")) {
sender.sendMessage(ChatColor.GRAY + "Registered task types:");
for (TaskType taskType : plugin.getTaskTypeManager().getTaskTypes()) {
@@ -553,6 +568,7 @@ public class CommandQuests implements TabExecutor {
sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a info [quest]" + ChatColor.DARK_GRAY + ": see information about loaded quests");
sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a reload " + ChatColor.DARK_GRAY + ": reload Quests configuration");
sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a config " + ChatColor.DARK_GRAY + ": see detected problems in config");
+ sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a itemstack " + ChatColor.DARK_GRAY + ": print information about the current held ItemStack");
sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a update " + ChatColor.DARK_GRAY + ": check for updates");
sender.sendMessage(ChatColor.DARK_GRAY + " * " + ChatColor.RED + "/quests a wiki " + ChatColor.DARK_GRAY + ": get a link to the Quests wiki");
}
diff --git a/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_1_13.java b/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_1_13.java
index c3234a7f..446bd1f5 100644
--- a/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_1_13.java
+++ b/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_1_13.java
@@ -156,7 +156,6 @@ public class ItemGetter_1_13 implements ItemGetter {
}
}
-
// unbreakable
if (!filters.contains(Filter.UNBREAKABLE)) {
ism.setUnbreakable(unbreakable);
diff --git a/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_Late_1_8.java b/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_Late_1_8.java
index f3523b70..07ff0456 100644
--- a/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_Late_1_8.java
+++ b/src/main/java/com/leonardobishop/quests/hooks/itemgetter/ItemGetter_Late_1_8.java
@@ -105,7 +105,7 @@ public class ItemGetter_Late_1_8 implements ItemGetter {
level = 1;
}
- is.addUnsafeEnchantment(enchantment, level);
+ ism.addEnchant(enchantment, level, true);
}
}
}