[Idea]: Folia support for OpenInv #196

Closed
reabuc wants to merge 137 commits from master into master
59 changed files with 4163 additions and 1869 deletions
Showing only changes of commit 4ca222f031 - Show all commits

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2011-2021 lishid. All rights reserved. * Copyright (C) 2011-2022 lishid. All rights reserved.
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ public interface IAnySilentContainer {
/** /**
* Opens the container at the given coordinates for the Player. If you do not want blocked * Opens the container at the given coordinates for the Player. If you do not want blocked
* containers to open, be sure to check {@link #isAnyContainerNeeded(Player, Block)} * containers to open, be sure to check {@link #isAnyContainerNeeded(Block)}
* first. * first.
* *
* @param player the Player opening the container * @param player the Player opening the container

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2011-2021 lishid. All rights reserved. * Copyright (C) 2011-2022 lishid. All rights reserved.
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ public class PlayerListener implements Listener {
Player player = event.getPlayer(); Player player = event.getPlayer();
boolean any = Permissions.ANYCHEST.hasPermission(player) && plugin.getPlayerAnyChestStatus(player); boolean any = Permissions.ANYCHEST.hasPermission(player) && plugin.getPlayerAnyChestStatus(player);
boolean needsAny = plugin.getAnySilentContainer().isAnyContainerNeeded(player, event.getClickedBlock()); boolean needsAny = plugin.getAnySilentContainer().isAnyContainerNeeded(event.getClickedBlock());
if (!any && needsAny) { if (!any && needsAny) {
return; return;
@@ -79,11 +79,11 @@ public class PlayerListener implements Listener {
// If anycontainer or silentcontainer is active // If anycontainer or silentcontainer is active
if (any || silent) { if (any || silent) {
if (plugin.getAnySilentContainer().activateContainer(player, silent, event.getClickedBlock())) { if (plugin.getAnySilentContainer().activateContainer(player, silent, event.getClickedBlock())) {
if (silent && plugin.notifySilentChest() && needsAny && plugin.notifyAnyChest()) { if (silent && needsAny) {
plugin.sendSystemMessage(player, "messages.info.containerBlockedSilent"); plugin.sendSystemMessage(player, "messages.info.containerBlockedSilent");
} else if (needsAny && plugin.notifyAnyChest()) { } else if (needsAny) {
plugin.sendSystemMessage(player, "messages.info.containerBlocked"); plugin.sendSystemMessage(player, "messages.info.containerBlocked");
} else if (silent && plugin.notifySilentChest()) { } else if (silent) {
plugin.sendSystemMessage(player, "messages.info.containerSilent"); plugin.sendSystemMessage(player, "messages.info.containerSilent");
} }
} }