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(), "持っていたブロックを足首に付けました。"); } }