mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-08 19:38:17 +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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>at.pcgamingfreaks</groupId>
|
<groupId>at.pcgamingfreaks</groupId>
|
||||||
<artifactId>Minepacks</artifactId>
|
<artifactId>Minepacks</artifactId>
|
||||||
<version>2.1-RC2</version>
|
<version>2.1-RC3</version>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
<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);
|
messageInvalidBackpack.send(opener);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//noinspection ObjectEquality
|
||||||
|
if(opener.getOpenInventory().getTopInventory().getHolder() == backpack) return; // == is fine as there is only one instance of each backpack
|
||||||
if(openSound != null)
|
if(openSound != null)
|
||||||
{
|
{
|
||||||
opener.getWorld().playSound(opener.getLocation(), openSound, 1, 0);
|
opener.getWorld().playSound(opener.getLocation(), openSound, 1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user