From 0ed4c8cd4180cd593a46a3111bb500d33b1b832b Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sat, 12 Dec 2015 11:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A0=E6=95=88else...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../SimpleEssential/command/CommandHat.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/citycraft/SimpleEssential/command/CommandHat.java b/src/main/java/cn/citycraft/SimpleEssential/command/CommandHat.java index 6e9dd9e..cf49644 100644 --- a/src/main/java/cn/citycraft/SimpleEssential/command/CommandHat.java +++ b/src/main/java/cn/citycraft/SimpleEssential/command/CommandHat.java @@ -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")); } }