Skip to content

Commit

Permalink
Change packages for penalties.
Browse files Browse the repository at this point in the history
So actions.types remains soemwhat consistent for now.
  • Loading branch information
asofold committed Apr 17, 2018
1 parent f6d00c3 commit ad5be20
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 31 deletions.
Expand Up @@ -18,11 +18,11 @@

import fr.neatmonster.nocheatplus.actions.types.CancelAction;
import fr.neatmonster.nocheatplus.actions.types.LogAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.CancelPenalty;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyNode;
import fr.neatmonster.nocheatplus.actions.types.PenaltyAction;
import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.logging.StaticLog;
import fr.neatmonster.nocheatplus.penalties.CancelPenalty;
import fr.neatmonster.nocheatplus.penalties.PenaltyNode;
import fr.neatmonster.nocheatplus.utilities.CheckUtils;

/**
Expand Down
Expand Up @@ -16,9 +16,8 @@

import fr.neatmonster.nocheatplus.actions.AbstractActionList;
import fr.neatmonster.nocheatplus.actions.ActionData;
import fr.neatmonster.nocheatplus.actions.types.penalty.CancelPenalty;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyNode;
import fr.neatmonster.nocheatplus.penalties.CancelPenalty;
import fr.neatmonster.nocheatplus.penalties.PenaltyNode;

/**
* Sole purpose is to indicate that an action is to be cancelled 100% (as
Expand Down
Expand Up @@ -12,11 +12,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.actions.types;

import fr.neatmonster.nocheatplus.actions.AbstractActionList;
import fr.neatmonster.nocheatplus.actions.Action;
import fr.neatmonster.nocheatplus.actions.ActionData;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.penalties.PenaltyNode;

/**
* Penalty action, referencing a certain penalty defined elsewhere. <br>
Expand Down
Expand Up @@ -22,11 +22,11 @@

import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.actions.ActionList;
import fr.neatmonster.nocheatplus.actions.types.penalty.IPenaltyList;
import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.components.debug.IDebugPlayer;
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
import fr.neatmonster.nocheatplus.hooks.NCPHookManager;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.players.DataManager;
import fr.neatmonster.nocheatplus.players.ExecutionHistory;
import fr.neatmonster.nocheatplus.players.IPlayerData;
Expand Down
Expand Up @@ -24,13 +24,13 @@
import fr.neatmonster.nocheatplus.actions.ActionList;
import fr.neatmonster.nocheatplus.actions.ParameterName;
import fr.neatmonster.nocheatplus.actions.types.GenericLogAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.DefaultPenaltyList;
import fr.neatmonster.nocheatplus.actions.types.penalty.IPenaltyList;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.PenaltyAction;
import fr.neatmonster.nocheatplus.checks.access.IViolationInfo;
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
import fr.neatmonster.nocheatplus.logging.StaticLog;
import fr.neatmonster.nocheatplus.logging.StreamID;
import fr.neatmonster.nocheatplus.penalties.DefaultPenaltyList;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.permissions.RegisteredPermission;

/**
Expand Down Expand Up @@ -193,6 +193,10 @@ public void executeActions() {
if (!penaltyList.isEmpty()) {
penaltyList.applyAllApplicablePenalties(player, true);
}
/*
* TODO: Concept for penalties running actions. E.g.
* penaltyList.applyAllApplicablePenalties(ViolationData, true);
*/
} catch (final Exception e) {
StaticLog.logSevere(e);
// On exceptions cancel events.
Expand Down
Expand Up @@ -23,7 +23,6 @@

import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.actions.ParameterName;
import fr.neatmonster.nocheatplus.actions.types.penalty.IPenaltyList;
import fr.neatmonster.nocheatplus.checks.Check;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.ViolationData;
Expand All @@ -33,6 +32,7 @@
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveInfo;
import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving;
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.players.IPlayerData;
import fr.neatmonster.nocheatplus.utilities.StringUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
Expand Down
Expand Up @@ -34,8 +34,6 @@
import org.bukkit.inventory.ItemStack;

import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.actions.types.penalty.DefaultPenaltyList;
import fr.neatmonster.nocheatplus.actions.types.penalty.IPenaltyList;
import fr.neatmonster.nocheatplus.checks.CheckListener;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.combined.Combined;
Expand All @@ -62,6 +60,8 @@
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
import fr.neatmonster.nocheatplus.components.registry.factory.IFactoryOne;
import fr.neatmonster.nocheatplus.components.registry.feature.JoinLeaveListener;
import fr.neatmonster.nocheatplus.penalties.DefaultPenaltyList;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.permissions.Permissions;
import fr.neatmonster.nocheatplus.players.DataManager;
import fr.neatmonster.nocheatplus.players.IPlayerData;
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

/**
* Convenience implementation for input-specific effects (other than Player).
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

import org.bukkit.entity.Player;

Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

/**
* This penalty does nothing. It's presence solely indicates that an action is
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

import java.util.Iterator;
import java.util.LinkedHashMap;
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

public interface IPenaltyFactory {

Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

import org.bukkit.configuration.MemorySection;

Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

/**
* Contain applicable penalty types that need to be handled outside of
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

/**
* A reference to a penalty by id. Concept-wise this is meant for an early
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

/**
* Penalty for one type of input.
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty;
package fr.neatmonster.nocheatplus.penalties;

import java.util.Collection;
import java.util.Random;
Expand Down
Expand Up @@ -12,11 +12,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty.fight;
package fr.neatmonster.nocheatplus.penalties.fight;

import org.bukkit.event.entity.EntityDamageEvent;

import fr.neatmonster.nocheatplus.actions.types.penalty.AbstractPenalty;
import fr.neatmonster.nocheatplus.penalties.AbstractPenalty;

/**
* Basic fight specific penalty.
Expand Down
Expand Up @@ -12,11 +12,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty.fight;
package fr.neatmonster.nocheatplus.penalties.fight;

import org.bukkit.event.entity.EntityDamageByEntityEvent;

import fr.neatmonster.nocheatplus.actions.types.penalty.AbstractPenalty;
import fr.neatmonster.nocheatplus.penalties.AbstractPenalty;

/**
* Specifically target damage done by entities to entities.
Expand Down
Expand Up @@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.actions.types.penalty.fight;
package fr.neatmonster.nocheatplus.penalties.fight;

import org.bukkit.event.entity.EntityDamageEvent;

Expand Down
Expand Up @@ -22,12 +22,12 @@
import fr.neatmonster.nocheatplus.PluginTests;
import fr.neatmonster.nocheatplus.actions.Action;
import fr.neatmonster.nocheatplus.actions.ActionList;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyNode;
import fr.neatmonster.nocheatplus.actions.types.PenaltyAction;
import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.config.ConfPaths;
import fr.neatmonster.nocheatplus.config.ConfigFile;
import fr.neatmonster.nocheatplus.config.DefaultConfig;
import fr.neatmonster.nocheatplus.penalties.PenaltyNode;
import fr.neatmonster.nocheatplus.permissions.PermissionRegistry;

public class TestActions {
Expand Down

0 comments on commit ad5be20

Please sign in to comment.