Skip to content

Commit

Permalink
UndineMailer v1.9.1 : Refined ItemConfigUtility.
Browse files Browse the repository at this point in the history
  • Loading branch information
ucchyocean committed Jul 13, 2019
1 parent 67f226b commit 5f187bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/bitbucket/ucchy/undine/MailData.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ protected static MailData loadFromConfigSection(ConfigurationSection section) {
ConfigurationSection sub = section.getConfigurationSection("attachments." + name);
try {
ItemStack item = ItemConfigParser.getItemFromSection(sub);
data.attachments.add(item);
if (item != null) data.attachments.add(item);
} catch (ItemConfigParseException e) {
e.printStackTrace();
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/bitbucket/ucchy/undine/MailManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,7 @@ private int getIndexOfMailList(int index, ArrayList<MailData> list) {
* @return 文字列表現
*/
private String getItemDesc(ItemStack item, boolean forDescription) {
if (item == null) return "null";
String desc = item.getDurability() == 0 ? item.getType().toString() :
item.getType().toString() + ":" + item.getDurability();
if ( item.getAmount() == 1 ) return desc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ public void runCommand(CommandSender sender, String label, String[] args) {

// 情報表示
String description = UndineCommandUtil.getItemDesc(hand);
// String isTradable = TradableMaterial.isTradable(hand.getType())
// ? Messages.get("Yes") : Messages.get("No");
String isTradable = Messages.get("Yes");
sender.sendMessage(Messages.get("InformationItemDetail",
new String[]{"%desc", "%tradable"},
new String[]{description, Messages.get("Yes")}));
new String[]{description, isTradable}));
}

/**
Expand Down

0 comments on commit 5f187bb

Please sign in to comment.