Skip to content

Commit

Permalink
Fixed sound playing on interact anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
toonystank committed Jun 4, 2022
1 parent 14a26ba commit a778af7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
Expand Down Expand Up @@ -54,6 +55,7 @@ public void onArmorStandRightClickEvent(PlayerInteractAtEntityEvent event) {

Entity entity = event.getRightClicked();


if (!entity.getType().equals(EntityType.ARMOR_STAND)) return;

event.setCancelled(true);
Expand Down Expand Up @@ -119,7 +121,6 @@ void standWithHand(Player player, ArmorStand stand) {
stand.getEquipment().setItemInMainHand(itemStack);
}
}

//
// ARMOR STAND EVENT ENDS HERE
//
Expand Down Expand Up @@ -187,6 +188,7 @@ public void giveItem(ItemStack playerItem, ItemStack itemOnFrame, ItemFrame clic
public void onArmorRightClickEvent(PlayerInteractEvent event) {
if (mainHandSwap) {
Player player = event.getPlayer();
if (player.getInventory().getItemInMainHand().getType().isAir()) return;
int value = getArmorSwapEnabled(player);
if (value == 1) {
Block block = event.getClickedBlock();
Expand Down

0 comments on commit a778af7

Please sign in to comment.