Change packages for penalties.

So actions.types remains soemwhat consistent for now.
This commit is contained in:
asofold 2018-04-17 12:42:35 +02:00
parent f6d00c3346
commit ad5be20eb6
21 changed files with 36 additions and 31 deletions

View File

@ -18,11 +18,11 @@ import java.util.Map;
import fr.neatmonster.nocheatplus.actions.types.CancelAction; import fr.neatmonster.nocheatplus.actions.types.CancelAction;
import fr.neatmonster.nocheatplus.actions.types.LogAction; import fr.neatmonster.nocheatplus.actions.types.LogAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.CancelPenalty; import fr.neatmonster.nocheatplus.actions.types.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyNode;
import fr.neatmonster.nocheatplus.checks.ViolationData; import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.logging.StaticLog; import fr.neatmonster.nocheatplus.logging.StaticLog;
import fr.neatmonster.nocheatplus.penalties.CancelPenalty;
import fr.neatmonster.nocheatplus.penalties.PenaltyNode;
import fr.neatmonster.nocheatplus.utilities.CheckUtils; import fr.neatmonster.nocheatplus.utilities.CheckUtils;
/** /**

View File

@ -16,9 +16,8 @@ package fr.neatmonster.nocheatplus.actions.types;
import fr.neatmonster.nocheatplus.actions.AbstractActionList; import fr.neatmonster.nocheatplus.actions.AbstractActionList;
import fr.neatmonster.nocheatplus.actions.ActionData; import fr.neatmonster.nocheatplus.actions.ActionData;
import fr.neatmonster.nocheatplus.actions.types.penalty.CancelPenalty; import fr.neatmonster.nocheatplus.penalties.CancelPenalty;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction; import fr.neatmonster.nocheatplus.penalties.PenaltyNode;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyNode;
/** /**
* Sole purpose is to indicate that an action is to be cancelled 100% (as * Sole purpose is to indicate that an action is to be cancelled 100% (as

View File

@ -12,11 +12,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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.AbstractActionList;
import fr.neatmonster.nocheatplus.actions.Action; import fr.neatmonster.nocheatplus.actions.Action;
import fr.neatmonster.nocheatplus.actions.ActionData; 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> * Penalty action, referencing a certain penalty defined elsewhere. <br>

View File

@ -22,11 +22,11 @@ import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.NCPAPIProvider; import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.actions.ActionList; import fr.neatmonster.nocheatplus.actions.ActionList;
import fr.neatmonster.nocheatplus.actions.types.penalty.IPenaltyList;
import fr.neatmonster.nocheatplus.compat.MCAccess; import fr.neatmonster.nocheatplus.compat.MCAccess;
import fr.neatmonster.nocheatplus.components.debug.IDebugPlayer; import fr.neatmonster.nocheatplus.components.debug.IDebugPlayer;
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle; import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
import fr.neatmonster.nocheatplus.hooks.NCPHookManager; import fr.neatmonster.nocheatplus.hooks.NCPHookManager;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.players.DataManager; import fr.neatmonster.nocheatplus.players.DataManager;
import fr.neatmonster.nocheatplus.players.ExecutionHistory; import fr.neatmonster.nocheatplus.players.ExecutionHistory;
import fr.neatmonster.nocheatplus.players.IPlayerData; import fr.neatmonster.nocheatplus.players.IPlayerData;

View File

@ -24,13 +24,13 @@ import fr.neatmonster.nocheatplus.actions.ActionData;
import fr.neatmonster.nocheatplus.actions.ActionList; import fr.neatmonster.nocheatplus.actions.ActionList;
import fr.neatmonster.nocheatplus.actions.ParameterName; import fr.neatmonster.nocheatplus.actions.ParameterName;
import fr.neatmonster.nocheatplus.actions.types.GenericLogAction; import fr.neatmonster.nocheatplus.actions.types.GenericLogAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.DefaultPenaltyList; import fr.neatmonster.nocheatplus.actions.types.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.IPenaltyList;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction;
import fr.neatmonster.nocheatplus.checks.access.IViolationInfo; import fr.neatmonster.nocheatplus.checks.access.IViolationInfo;
import fr.neatmonster.nocheatplus.compat.BridgeHealth; import fr.neatmonster.nocheatplus.compat.BridgeHealth;
import fr.neatmonster.nocheatplus.logging.StaticLog; import fr.neatmonster.nocheatplus.logging.StaticLog;
import fr.neatmonster.nocheatplus.logging.StreamID; import fr.neatmonster.nocheatplus.logging.StreamID;
import fr.neatmonster.nocheatplus.penalties.DefaultPenaltyList;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.permissions.RegisteredPermission; import fr.neatmonster.nocheatplus.permissions.RegisteredPermission;
/** /**
@ -193,6 +193,10 @@ public class ViolationData implements IViolationInfo, ActionData {
if (!penaltyList.isEmpty()) { if (!penaltyList.isEmpty()) {
penaltyList.applyAllApplicablePenalties(player, true); penaltyList.applyAllApplicablePenalties(player, true);
} }
/*
* TODO: Concept for penalties running actions. E.g.
* penaltyList.applyAllApplicablePenalties(ViolationData, true);
*/
} catch (final Exception e) { } catch (final Exception e) {
StaticLog.logSevere(e); StaticLog.logSevere(e);
// On exceptions cancel events. // On exceptions cancel events.

View File

@ -23,7 +23,6 @@ import org.bukkit.potion.PotionEffectType;
import fr.neatmonster.nocheatplus.NCPAPIProvider; import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.actions.ParameterName; 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.Check;
import fr.neatmonster.nocheatplus.checks.CheckType; import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.ViolationData; import fr.neatmonster.nocheatplus.checks.ViolationData;
@ -33,6 +32,7 @@ import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveInfo; import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveInfo;
import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving; import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving;
import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil; import fr.neatmonster.nocheatplus.checks.moving.util.MovingUtil;
import fr.neatmonster.nocheatplus.penalties.IPenaltyList;
import fr.neatmonster.nocheatplus.players.IPlayerData; import fr.neatmonster.nocheatplus.players.IPlayerData;
import fr.neatmonster.nocheatplus.utilities.StringUtil; import fr.neatmonster.nocheatplus.utilities.StringUtil;
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties; import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;

View File

@ -34,8 +34,6 @@ import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import fr.neatmonster.nocheatplus.NCPAPIProvider; 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.CheckListener;
import fr.neatmonster.nocheatplus.checks.CheckType; import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.combined.Combined; import fr.neatmonster.nocheatplus.checks.combined.Combined;
@ -62,6 +60,8 @@ import fr.neatmonster.nocheatplus.components.data.IData;
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle; import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
import fr.neatmonster.nocheatplus.components.registry.factory.IFactoryOne; import fr.neatmonster.nocheatplus.components.registry.factory.IFactoryOne;
import fr.neatmonster.nocheatplus.components.registry.feature.JoinLeaveListener; 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.permissions.Permissions;
import fr.neatmonster.nocheatplus.players.DataManager; import fr.neatmonster.nocheatplus.players.DataManager;
import fr.neatmonster.nocheatplus.players.IPlayerData; import fr.neatmonster.nocheatplus.players.IPlayerData;

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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). * Convenience implementation for input-specific effects (other than Player).

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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; import org.bukkit.entity.Player;

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 * This penalty does nothing. It's presence solely indicates that an action is

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 { public interface IPenaltyFactory {

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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; import org.bukkit.configuration.MemorySection;

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 * Contain applicable penalty types that need to be handled outside of

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 * A reference to a penalty by id. Concept-wise this is meant for an early

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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. * Penalty for one type of input.

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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.Collection;
import java.util.Random; import java.util.Random;

View File

@ -12,11 +12,11 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 org.bukkit.event.entity.EntityDamageEvent;
import fr.neatmonster.nocheatplus.actions.types.penalty.AbstractPenalty; import fr.neatmonster.nocheatplus.penalties.AbstractPenalty;
/** /**
* Basic fight specific penalty. * Basic fight specific penalty.

View File

@ -12,11 +12,11 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 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. * Specifically target damage done by entities to entities.

View File

@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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 org.bukkit.event.entity.EntityDamageEvent;

View File

@ -22,12 +22,12 @@ import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.PluginTests; import fr.neatmonster.nocheatplus.PluginTests;
import fr.neatmonster.nocheatplus.actions.Action; import fr.neatmonster.nocheatplus.actions.Action;
import fr.neatmonster.nocheatplus.actions.ActionList; import fr.neatmonster.nocheatplus.actions.ActionList;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyAction; import fr.neatmonster.nocheatplus.actions.types.PenaltyAction;
import fr.neatmonster.nocheatplus.actions.types.penalty.PenaltyNode;
import fr.neatmonster.nocheatplus.checks.ViolationData; import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.config.ConfPaths; import fr.neatmonster.nocheatplus.config.ConfPaths;
import fr.neatmonster.nocheatplus.config.ConfigFile; import fr.neatmonster.nocheatplus.config.ConfigFile;
import fr.neatmonster.nocheatplus.config.DefaultConfig; import fr.neatmonster.nocheatplus.config.DefaultConfig;
import fr.neatmonster.nocheatplus.penalties.PenaltyNode;
import fr.neatmonster.nocheatplus.permissions.PermissionRegistry; import fr.neatmonster.nocheatplus.permissions.PermissionRegistry;
public class TestActions { public class TestActions {