mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-14 10:45:23 +01:00
Fix issue with paper and bungeecord setups
This commit is contained in:
parent
9a9a94673d
commit
a2e1fc19e8
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2023 GeorgH93
|
||||
* Copyright (C) 2024 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
|
||||
@ -19,13 +19,14 @@
|
||||
|
||||
import at.pcgamingfreaks.Bukkit.Message.Message;
|
||||
import at.pcgamingfreaks.Bukkit.Message.MessageBuilder;
|
||||
import at.pcgamingfreaks.Bukkit.Util.InventoryUtils;
|
||||
import at.pcgamingfreaks.Bukkit.Util.Utils;
|
||||
import at.pcgamingfreaks.Command.HelpData;
|
||||
import at.pcgamingfreaks.Message.MessageClickEvent;
|
||||
import at.pcgamingfreaks.Message.MessageColor;
|
||||
import at.pcgamingfreaks.Message.MessageFormat;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommand;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommand;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Permissions;
|
||||
|
||||
@ -119,7 +120,7 @@ private void debugSystem(final @NotNull CommandSender commandSender)
|
||||
sender.performCommand("backpack");
|
||||
}, 5*20L);
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> {
|
||||
Bukkit.getPluginManager().callEvent(new ClickEvent(sender.getOpenInventory(), InventoryType.SlotType.QUICKBAR, sender.getOpenInventory().getTopInventory().getSize() + 27, ClickType.LEFT, InventoryAction.PICKUP_ALL));
|
||||
Bukkit.getPluginManager().callEvent(new ClickEvent(sender.getOpenInventory(), InventoryType.SlotType.QUICKBAR, InventoryUtils.getPlayerTopInventory(sender).getSize() + 27, ClickType.LEFT, InventoryAction.PICKUP_ALL));
|
||||
}, 10*20L);
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, sender::closeInventory, 20*20L);
|
||||
Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> {
|
||||
|
@ -21,6 +21,7 @@
|
||||
import at.pcgamingfreaks.Bukkit.MCVersion;
|
||||
import at.pcgamingfreaks.Bukkit.ManagedUpdater;
|
||||
import at.pcgamingfreaks.Bukkit.Message.Message;
|
||||
import at.pcgamingfreaks.Bukkit.Util.InventoryUtils;
|
||||
import at.pcgamingfreaks.Bukkit.Util.Utils;
|
||||
import at.pcgamingfreaks.ConsoleColor;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack;
|
||||
@ -321,7 +322,7 @@ public void openBackpack(@NotNull Player opener, @Nullable Backpack backpack, bo
|
||||
return;
|
||||
}
|
||||
//noinspection ObjectEquality
|
||||
if(opener.getOpenInventory().getTopInventory().getHolder() == backpack) return; // == is fine as there is only one instance of each backpack
|
||||
if(InventoryUtils.getPlayerTopInventory(opener).getHolder() == backpack) return; // == is fine as there is only one instance of each backpack
|
||||
if(openSound != null)
|
||||
{
|
||||
opener.playSound(opener.getLocation(), openSound, 1, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user