Dispatch item translation messages from console per #575

This commit is contained in:
BuildTools 2018-12-21 20:36:31 -05:00
parent 31527c70f1
commit 4c00d0f766
2 changed files with 3 additions and 7 deletions

View File

@ -1895,7 +1895,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
String serial = sbegin.substring(0, sbegin.indexOf(ChatColor.GREEN.toString()));
Stage stage = quester.getCurrentStage(quest);
System.out.println("obj= " + obj);
if (obj.contains(Lang.get(quester.getPlayer(), "break"))) {
for (ItemStack is : stage.blocksToBreak) {
if (Material.matchMaterial(serial) != null) {
@ -1944,14 +1943,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
//TODO find a better way to detect a deliver objective
else if (obj.contains(Lang.get(quester.getPlayer(), "deliver").split(" ")[0])) {
System.out.println("1");
for (ItemStack is : stage.itemsToDeliver) {
if (Material.matchMaterial(serial) != null) {
if (Material.matchMaterial(serial).equals(is.getType())) {
System.out.println("2");
String enchant = "";
if (!is.getEnchantments().isEmpty()) {
System.out.println("3");
//TODO parse multiple enchantments?
query.sendMessage(quester.getPlayer(), obj.replace(serial, "<item>").replace(enchant, "<enchantment>"),
is.getType(), is.getDurability(), is.getEnchantments().entrySet().iterator().next().getKey());

View File

@ -62,7 +62,7 @@ public class LocaleQuery {
}
}
String msg = message.replace("<item>", "\",{\"translate\":\"" + key + "\"},\"");
player.chat("/tellraw " + player.getName() + " [\"" + msg + "\"]");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + player.getName() + " [\"" + msg + "\"]");
return;
}
}
@ -100,7 +100,7 @@ public class LocaleQuery {
if (!key2.equals("")) {
String msg = message.replace("<item>", "\",{\"translate\":\"" + key + "\"},\"")
.replace("<enchantment>", "\",{\"translate\":\"" + key2 + "\"},\"");
player.chat("/tellraw " + player.getName() + " [\"" + msg + "\"]");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + player.getName() + " [\"" + msg + "\"]");
return;
}
}
@ -120,7 +120,7 @@ public class LocaleQuery {
}
if (!key.equals("")) {
String msg = message.replace("<mob>", "\",{\"translate\":\"" + key + "\"},\"");
player.chat("/tellraw " + player.getName() + " [\"" + msg + "\"]");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + player.getName() + " [\"" + msg + "\"]");
return;
}
}