mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-22 21:41:23 +01:00
Play backpack sound only for player using the backpack
This commit is contained in:
parent
4df0ea78e9
commit
7a118e2385
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 GeorgH93
|
||||
* Copyright (C) 2021 GeorgH93
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -67,7 +67,7 @@ public void onClose(InventoryCloseEvent event)
|
||||
}
|
||||
if(closeSound != null)
|
||||
{
|
||||
closer.getWorld().playSound(closer.getLocation(), closeSound, 1, 0);
|
||||
closer.playSound(closer.getLocation(), closeSound, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 GeorgH93
|
||||
* Copyright (C) 2021 GeorgH93
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -327,7 +327,7 @@ public void openBackpack(@NotNull Player opener, @Nullable Backpack backpack, bo
|
||||
if(opener.getOpenInventory().getTopInventory().getHolder() == backpack) return; // == is fine as there is only one instance of each backpack
|
||||
if(openSound != null)
|
||||
{
|
||||
opener.getWorld().playSound(opener.getLocation(), openSound, 1, 0);
|
||||
opener.playSound(opener.getLocation(), openSound, 1, 0);
|
||||
}
|
||||
backpack.open(opener, editable);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user