mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-15 10:55:20 +01:00
Fix formatting
This commit is contained in:
parent
8e65bcc70d
commit
d9e101e0f1
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 GeorgH93
|
||||
* Copyright (C) 2023 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
|
||||
@ -44,11 +44,11 @@ public BackpackEventListener(Minepacks plugin)
|
||||
closeSound = plugin.getConfiguration().getCloseSound();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onClose(InventoryCloseEvent event)
|
||||
{
|
||||
if (event.getInventory() != null && event.getInventory().getHolder() instanceof Backpack && event.getPlayer() instanceof Player)
|
||||
{
|
||||
{
|
||||
Backpack backpack = (Backpack)event.getInventory().getHolder();
|
||||
Player closer = (Player)event.getPlayer();
|
||||
if(backpack.canEdit(closer))
|
||||
@ -69,14 +69,14 @@ public void onClose(InventoryCloseEvent event)
|
||||
{
|
||||
closer.playSound(closer.getLocation(), closeSound, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onClick(InventoryClickEvent event)
|
||||
{
|
||||
if (event.getInventory() != null && event.getInventory().getHolder() instanceof Backpack && event.getWhoClicked() instanceof Player)
|
||||
{
|
||||
{
|
||||
Backpack backpack = (Backpack) event.getInventory().getHolder();
|
||||
if(!backpack.canEdit((Player)event.getWhoClicked()))
|
||||
{
|
||||
@ -86,7 +86,7 @@ public void onClick(InventoryClickEvent event)
|
||||
{
|
||||
backpack.setChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
|
Loading…
Reference in New Issue
Block a user