Remove duplicated item IDs in messages

This commit is contained in:
md678685 2019-01-05 16:28:53 +00:00
parent bd8ef2a25d
commit 417fe29e21
4 changed files with 11 additions and 5 deletions

View File

@ -33,10 +33,16 @@ public class Commanditemdb extends EssentialsCommand {
itemStack = ess.getItemDb().get(args[0]);
}
sender.sendMessage(tl("itemType", itemStack.getType().toString()));
String itemId = "none";
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_13_0_R01)) {
final String itemId = itemStack.getType().getId() + ":" + itemStack.getDurability();
itemId = itemStack.getType().getId() + ":" + itemStack.getDurability();
}
sender.sendMessage(tl("itemType", itemStack.getType().toString(), itemId));
// Don't send IDs twice
if (!tl("itemType").contains("{1}") && !itemId.equals("none")) {
sender.sendMessage(tl("itemId", itemId));
}

View File

@ -224,7 +224,7 @@ itemsNotConverted=\u00a74Du hast keine Items, die in Bl\u00f6cke konvertiert wer
itemSold=\u00a7aVerkauft f\u00fcr \u00a7c{0}\u00a7a ({1} {2} Einheiten je {3})
itemSoldConsole=\u00a7a{0} $averkauft {1} f\u00fcr \u00a7a{2} \u00a7a({3} Einheiten je {4})
itemSpawn=\u00a76Du gibst dir\u00a7c {0}\u00a76x\u00a7c {1}
itemType=\u00a76Gegenstand\:\u00a7c {0} \u00a76-\u00a7c {1}
itemType=\u00a76Gegenstand\:\u00a7c {0} \u00a76
jailAlreadyIncarcerated=\u00a74Spieler ist bereits im Gef\u00e4ngnis\:\u00a7c {0}
jailList=\u00a76Jails\:\u00a7r {0}
jailMessage=\u00a74Du hast ein Verbrechen begangen, also musst du deine Zeit absitzen.

View File

@ -224,7 +224,7 @@ itemsNotConverted=\u00a74You have no items that can be converted into blocks.
itemSold=\u00a7aSold for \u00a7c{0} \u00a7a({1} {2} at {3} each).
itemSoldConsole=\u00a7a{0} \u00a7asold {1} for \u00a7a{2} \u00a7a({3} items at {4} each).
itemSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1}
itemType=\u00a76Item\:\u00a7c {0} \u00a76-\u00a7c {1}
itemType=\u00a76Item\:\u00a7c {0} \u00a76
jailAlreadyIncarcerated=\u00a74Person is already in jail\:\u00a7c {0}
jailList=\u00a76Jails\:\u00a7r {0}
jailMessage=\u00a74You do the crime, you do the time.

View File

@ -224,7 +224,7 @@ itemsNotConverted=\u00a74Sul pole esemeid, mida saaks plokkideks konverteerida.
itemSold=\u00a7aM\u00fc\u00fcdud hinnaga \u00a7c{0} \u00a7a({1} {2} hinnaga {3} t\u00fckk).
itemSoldConsole=\u00a7aM\u00e4ngija {0} \u00a7am\u00fc\u00fcs {1} hinnaga \u00a7a{2} \u00a7a({3} eset hinnaga {4} t\u00fckk).
itemSpawn=\u00a76Annan m\u00e4ngijale\u00a7c {0} {1}
itemType=\u00a76Ese\:\u00a7c {0} \u00a76-\u00a7c {1}
itemType=\u00a76Ese\:\u00a7c {0} \u00a76
jailAlreadyIncarcerated=\u00a74M\u00e4ngija on juba vanglas\:\u00a7c {0}
jailList=\u00a76Vanglad\:\u00a7r {0}
jailMessage=\u00a74Sooritasid kuriteo, istud oma aja \u00e4ra.