Skip to content

Commit 88cf3eb

Browse files
committed
[Fixes #19] Actually show durability for /getemc things
1 parent 7384739 commit 88cf3eb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/pw/chew/transmuteit/GetEMCCommand.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
6565
inventoryAmount += inventoryItemsThanks[i].getAmount();
6666
}
6767
maxDurability = type.getMaxDurability();
68-
if(currentDurability > maxDurability) {
69-
currentDurability = maxDurability;
70-
}
71-
if(arg) {
68+
if(currentDurability > maxDurability || args.length > 0) {
7269
currentDurability = maxDurability;
7370
}
7471
String name = type.toString();
@@ -83,7 +80,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
8380
try {
8481
int emc = TransmuteIt.json.getInt(type.toString());
8582
int normal_emc = emc;
86-
if(maxDurability > 0) {
83+
if(maxDurability > 0 && !arg) {
8784
emc = (int)((double)emc * (((double)maxDurability-(double)currentDurability)/(double)maxDurability));
8885
}
8986
sender.sendMessage(ChatColor.YELLOW + "Single EMC Value: " + ChatColor.GREEN + NumberFormat.getInstance().format(emc));

0 commit comments

Comments
 (0)