mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-02-01 23:22:06 +01:00
Prevent backpack shrinking if player doesn't have the permission to open it
This commit is contained in:
parent
5a60f09ed7
commit
192d805154
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>MinePacks</artifactId>
|
||||
<version>1.17.11</version>
|
||||
<version>1.17.12-SNAPSHOT</version>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
||||
|
@ -93,7 +93,7 @@ public void open(Player p, boolean editable)
|
||||
if(owner.isOnline())
|
||||
{
|
||||
Player player = owner.getPlayer();
|
||||
if(player != null)
|
||||
if(player != null && (player.hasPermission("backpack") || player.hasPermission("backpack.use")))
|
||||
{
|
||||
int size = MinePacks.getBackpackPermSize(player);
|
||||
if(size != bp.getSize())
|
||||
@ -101,10 +101,10 @@ public void open(Player p, boolean editable)
|
||||
List<ItemStack> items = setSize(size);
|
||||
for(ItemStack i : items)
|
||||
{
|
||||
if (i != null)
|
||||
if(i != null)
|
||||
{
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), i);
|
||||
hasChanged = true;
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user