1
0
mirror of https://e.coding.net/circlecloud/SimpleEssential.git synced 2024-11-17 01:18:47 +00:00

清理代码 去除无效else...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-12-12 11:56:27 +08:00
parent c2b6f00bc2
commit 0ed4c8cd41

View File

@ -31,16 +31,15 @@ public class CommandHat extends BaseCommand {
if (p.getItemInHand() == null) {
sender.sendMessage(I18n.p("Hat.empty"));
return;
} else {
final ItemStack hand = p.getItemInHand();
p.setItemInHand(null);
final ItemStack helmet = p.getInventory().getHelmet();
if (!(helmet == null)) {
p.getInventory().addItem(helmet);
}
p.getInventory().setHelmet(hand);
sender.sendMessage(I18n.p("Hat.enjoy"));
}
final ItemStack hand = p.getItemInHand();
p.setItemInHand(null);
final ItemStack helmet = p.getInventory().getHelmet();
if (!(helmet == null)) {
p.getInventory().addItem(helmet);
}
p.getInventory().setHelmet(hand);
sender.sendMessage(I18n.p("Hat.enjoy"));
}
}