From 092c7b8d458caa60f06f992f27ef375b7909ff2b Mon Sep 17 00:00:00 2001 From: Tomachi <8929706+book000@users.noreply.github.com> Date: Wed, 8 Jun 2022 17:36:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20#846=20body,=20legs,=20boots=E3=81=8C?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E3=81=AB=E5=8B=95=E4=BD=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E4=B8=8D=E5=85=B7=E5=90=88=E4=BF=AE=E6=AD=A3=20(#847)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jaoafa/mymaid4/command/Cmd_Body.java | 12 ++++++------ .../java/com/jaoafa/mymaid4/command/Cmd_Boots.java | 12 ++++++------ .../java/com/jaoafa/mymaid4/command/Cmd_Legs.java | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/jaoafa/mymaid4/command/Cmd_Body.java b/src/main/java/com/jaoafa/mymaid4/command/Cmd_Body.java index 1145f1710..1a21e9b72 100644 --- a/src/main/java/com/jaoafa/mymaid4/command/Cmd_Body.java +++ b/src/main/java/com/jaoafa/mymaid4/command/Cmd_Body.java @@ -50,14 +50,14 @@ void setItemBody(CommandContext context) { SendMessage(player, details(), "手にブロックを持ってください。"); return; } - ItemStack head = inv.getHelmet(); - if (head != null) { - if (head.getType() != Material.AIR) { - inv.removeItem(head); + ItemStack chestplate = inv.getChestplate(); + if (chestplate != null) { + if (chestplate.getType() != Material.AIR) { + inv.removeItem(chestplate); } } - inv.setHelmet(hand); - player.getInventory().setChestplate(head); + inv.setChestplate(hand); + player.getInventory().setItemInMainHand(chestplate); SendMessage(player, details(), "持っていたブロックを背中に付けました。"); } } diff --git a/src/main/java/com/jaoafa/mymaid4/command/Cmd_Boots.java b/src/main/java/com/jaoafa/mymaid4/command/Cmd_Boots.java index 7fee2a5d7..b7c7dcfad 100644 --- a/src/main/java/com/jaoafa/mymaid4/command/Cmd_Boots.java +++ b/src/main/java/com/jaoafa/mymaid4/command/Cmd_Boots.java @@ -50,14 +50,14 @@ void setItemBoots(CommandContext context) { SendMessage(player, details(), "手にブロックを持ってください。"); return; } - ItemStack head = inv.getHelmet(); - if (head != null) { - if (head.getType() != Material.AIR) { - inv.removeItem(head); + ItemStack boots = inv.getBoots(); + if (boots != null) { + if (boots.getType() != Material.AIR) { + inv.removeItem(boots); } } - inv.setHelmet(hand); - player.getInventory().setBoots(head); + inv.setBoots(hand); + player.getInventory().setItemInMainHand(boots); SendMessage(player, details(), "持っていたブロックを足に付けました。"); } } diff --git a/src/main/java/com/jaoafa/mymaid4/command/Cmd_Legs.java b/src/main/java/com/jaoafa/mymaid4/command/Cmd_Legs.java index cf2f71410..b21216317 100644 --- a/src/main/java/com/jaoafa/mymaid4/command/Cmd_Legs.java +++ b/src/main/java/com/jaoafa/mymaid4/command/Cmd_Legs.java @@ -50,14 +50,14 @@ void setItemLegs(CommandContext context) { SendMessage(player, details(), "手にブロックを持ってください。"); return; } - ItemStack head = inv.getHelmet(); - if (head != null) { - if (head.getType() != Material.AIR) { - inv.removeItem(head); + ItemStack leggings = inv.getLeggings(); + if (leggings != null) { + if (leggings.getType() != Material.AIR) { + inv.removeItem(leggings); } } - inv.setHelmet(hand); - player.getInventory().setLeggings(head); + inv.setLeggings(hand); + player.getInventory().setItemInMainHand(leggings); SendMessage(player, details(), "持っていたブロックを足首に付けました。"); } }