mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-10 01:21:30 +01:00
Ignore specified enchantment cannot be applied to itemstack, fixes #1483
This commit is contained in:
parent
58f6fb0da0
commit
f06a15a3ec
@ -160,7 +160,7 @@ public class ItemStackPrompt extends QuestsEditorNumericPrompt {
|
||||
if (context.getSessionData("tempName") != null) {
|
||||
final String stackData = getItemData(context);
|
||||
if (stackData != null) {
|
||||
text += stackData;
|
||||
text += "\n" + stackData;
|
||||
if (context.getSessionData("tempMeta") != null) {
|
||||
final LinkedHashMap<String, Object> map
|
||||
= (LinkedHashMap<String, Object>) context.getSessionData("tempMeta");
|
||||
|
@ -83,8 +83,13 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return ChatColor.BLUE;
|
||||
case 5:
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
return ChatColor.BLUE;
|
||||
} else {
|
||||
return ChatColor.GRAY;
|
||||
}
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
return ChatColor.BLUE;
|
||||
@ -131,9 +136,9 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
}
|
||||
case 5:
|
||||
if (context.getForWhom() instanceof Player) {
|
||||
return ChatColor.GRAY + Lang.get("questEditorBlockStart");
|
||||
} else {
|
||||
return ChatColor.YELLOW + Lang.get("questEditorBlockStart");
|
||||
} else {
|
||||
return ChatColor.GRAY + Lang.get("questEditorBlockStart");
|
||||
}
|
||||
case 6:
|
||||
if (plugin.getDependencies().getWorldGuardApi() != null) {
|
||||
|
@ -132,7 +132,11 @@ public class ItemListener implements Listener {
|
||||
if (plugin.canUseQuests(evt.getEnchanter().getUniqueId())) {
|
||||
final ItemStack enchantedItem = evt.getItem().clone();
|
||||
enchantedItem.setAmount(1);
|
||||
enchantedItem.addEnchantments(evt.getEnchantsToAdd());
|
||||
try {
|
||||
enchantedItem.addEnchantments(evt.getEnchantsToAdd());
|
||||
} catch (final IllegalArgumentException e) {
|
||||
// Ignore
|
||||
}
|
||||
final Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
|
||||
for (final Quest quest : plugin.getQuests()) {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
|
Loading…
Reference in New Issue
Block a user