Skip to content

Commit f5a54d5

Browse files
committed
Fixed bug where MainHand item disappearing on Armor Stand swap
1 parent f8f434e commit f5a54d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/com/toonystank/armorswap/Events/ClickEvent.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,22 @@ public void onArmorStandRightClickEvent(PlayerInteractAtEntityEvent event) {
6262
PlayerData.storeData(stand, map);
6363
// armor stand set armor
6464
for (DataType dataType : DataType.values()) {
65+
if (dataType.equals(DataType.ARMOR_STAND_SWAP)
66+
|| dataType.equals(DataType.ITEM_FRAME_SWAP)
67+
|| dataType.equals(DataType.MAIN_HAND_SWAP))
68+
continue;
6569
if (!stand.hasArms()) {
66-
if (dataType.equals(DataType.PLAYER_MAIN_HAND) || dataType.equals(DataType.PLAYER_OFF_HAND) || dataType.equals(DataType.STAND_OFF_HAND))
70+
if (dataType.equals(DataType.PLAYER_MAIN_HAND)
71+
|| dataType.equals(DataType.STAND_MAIN_HAND)
72+
|| dataType.equals(DataType.PLAYER_OFF_HAND)
73+
|| dataType.equals(DataType.STAND_OFF_HAND))
6774
continue;
6875
}
6976
if (PlayerData.canMove(dataType, map)) {
7077
PlayerData.setEquipment(dataType, stand, map);
7178
PlayerData.setEquipment(dataType, player, map);
7279
}
80+
7381
}
7482
player.playSound(player.getLocation(), Sound.valueOf(sound), 1.0F, 1.0F);
7583
}

0 commit comments

Comments
 (0)