mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-02-13 01:12:43 +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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>at.pcgamingfreaks</groupId>
|
<groupId>at.pcgamingfreaks</groupId>
|
||||||
<artifactId>MinePacks</artifactId>
|
<artifactId>MinePacks</artifactId>
|
||||||
<version>1.17.11</version>
|
<version>1.17.12-SNAPSHOT</version>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
<connection>scm:git:git@github.com:GeorgH93/Minepacks.git</connection>
|
||||||
|
@ -93,7 +93,7 @@ public void open(Player p, boolean editable)
|
|||||||
if(owner.isOnline())
|
if(owner.isOnline())
|
||||||
{
|
{
|
||||||
Player player = owner.getPlayer();
|
Player player = owner.getPlayer();
|
||||||
if(player != null)
|
if(player != null && (player.hasPermission("backpack") || player.hasPermission("backpack.use")))
|
||||||
{
|
{
|
||||||
int size = MinePacks.getBackpackPermSize(player);
|
int size = MinePacks.getBackpackPermSize(player);
|
||||||
if(size != bp.getSize())
|
if(size != bp.getSize())
|
||||||
@ -101,7 +101,7 @@ public void open(Player p, boolean editable)
|
|||||||
List<ItemStack> items = setSize(size);
|
List<ItemStack> items = setSize(size);
|
||||||
for(ItemStack i : items)
|
for(ItemStack i : items)
|
||||||
{
|
{
|
||||||
if (i != null)
|
if(i != null)
|
||||||
{
|
{
|
||||||
player.getWorld().dropItemNaturally(player.getLocation(), i);
|
player.getWorld().dropItemNaturally(player.getLocation(), i);
|
||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user