Play backpack sound only for player using the backpack

This commit is contained in:
GeorgH93 2021-01-19 19:23:15 +01:00
parent 4df0ea78e9
commit 7a118e2385
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
3 changed files with 5 additions and 5 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}

View File

@ -7,7 +7,7 @@
<packaging>pom</packaging>
<properties>
<revision>2.3.21.2</revision>
<revision>2.3.21.3</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>