mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-07 19:28:11 +01:00
Prevent a backpack from being opened when it is already open
This commit is contained in:
parent
d352ec9c75
commit
e469f1a16d
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>Minepacks</artifactId>
|
||||
<version>2.1-RC2</version>
|
||||
<version>2.1-RC3</version>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
||||
|
@ -298,6 +298,8 @@ public void openBackpack(@NotNull Player opener, @Nullable Backpack backpack, bo
|
||||
messageInvalidBackpack.send(opener);
|
||||
return;
|
||||
}
|
||||
//noinspection ObjectEquality
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user