Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix: #846 body, legs, bootsが正常に動作しない不具合修正 (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Jun 8, 2022
1 parent ac4dfc9 commit 092c7b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/jaoafa/mymaid4/command/Cmd_Body.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ void setItemBody(CommandContext<CommandSender> 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(), "持っていたブロックを背中に付けました。");
}
}
12 changes: 6 additions & 6 deletions src/main/java/com/jaoafa/mymaid4/command/Cmd_Boots.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ void setItemBoots(CommandContext<CommandSender> 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(), "持っていたブロックを足に付けました。");
}
}
12 changes: 6 additions & 6 deletions src/main/java/com/jaoafa/mymaid4/command/Cmd_Legs.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ void setItemLegs(CommandContext<CommandSender> 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(), "持っていたブロックを足首に付けました。");
}
}

0 comments on commit 092c7b8

Please sign in to comment.