mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-25 12:05:16 +01:00
Fix issue for other versions the getView() is not existent
This commit is contained in:
parent
fb4f80c341
commit
558a0abfad
@ -23,3 +23,4 @@
|
||||
- Quest objective amount is now optional (default 1)
|
||||
- Fixed issue when used 1.12 and lower versions then some materials not work correctly.
|
||||
- Added option to jobs shop to hide icon if a player there are no enough points to buy a item
|
||||
- Fixed issue for inventory dragging when a player is in jobs GUI.
|
||||
|
@ -232,8 +232,12 @@ public class JobsListener implements Listener {
|
||||
@EventHandler
|
||||
public void onGuiDrag(InventoryDragEvent e) {
|
||||
Player player = (Player) e.getWhoClicked();
|
||||
if (Jobs.getGUIManager().isInGui(player) && e.getView().getTopInventory().getHolder() instanceof JobsInventoryHolder) {
|
||||
e.setCancelled(true);
|
||||
if (Jobs.getGUIManager().isInGui(player)) {
|
||||
if (Version.isCurrentEqualOrLower(Version.v1_12_R1) && e.getInventory().getHolder() instanceof JobsInventoryHolder
|
||||
|| Version.isCurrentEqualOrHigher(Version.v1_13_R1) && e.getView().getTopInventory().getHolder()
|
||||
instanceof JobsInventoryHolder) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user