Fix issues with 1.13+

Signed-off-by: DroppingAnvil <dr0pping.4nvi1@gmail.com>
This commit is contained in:
DroppingAnvil
2019-11-05 18:31:17 -06:00
parent d3870731f4
commit 441382acdc
5 changed files with 28 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ public class AntiChestListener implements Listener {
public void onInventoryClick(InventoryClickEvent e) {
Player player = (Player) e.getWhoClicked();
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (!e.getView().getTopInventory().getTitle().equalsIgnoreCase(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fchest.Inventory-Title")))) return;
if (!fPlayer.isInFactionsChest()) return;
if (e.isCancelled()) return;
@@ -49,7 +49,7 @@ public class AntiChestListener implements Listener {
Player p = (Player) e.getWhoClicked();
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(p);
if (!e.getView().getTopInventory().getTitle().equalsIgnoreCase(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fchest.Inventory-Title")))) return;
if (!fPlayer.isInFactionsChest()) return;
if (e.isCancelled()) return;
ItemStack dragged = e.getOldCursor();

View File

@@ -30,6 +30,7 @@ public class CmdChest extends FCommand {
return;
}
// This permission check is way too explicit but it's clean
context.fPlayer.setInFactionsChest(true);
context.player.openInventory(context.faction.getChestInventory());
}