NoCheatPlus/NCPCore/src/main/java/fr/neatmonster/nocheatplus/event/mini/MiniListener.java

26 lines
880 B
Java
Raw Normal View History

2018-01-17 23:52:50 +01:00
/*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
[BLEEDING][BREAKING] Use a new internal event registry. The old ListenerManager is removed, new system in place. Removed doesManageListeners(). (The new system isn't that new, but it's been fixed and adapted to using RegistrationOrder.) New * Register all Bukkit events via the new EventRegistryBukkit. * This way listeners can be ordered by numeric priority and tags (regular expressions for beforeTag and afterTag). * Unregistering listeners is possible (a listener node stays in the Bukkit registry, but only one per event). * It's possible to add listeners with minimal impact (MiniListener). * The registry registers by event class 'hard' i.e., no relations between already registered classes are checked. * Order isn't necessarily stable nor even reproducible for randomized start conditions with the same elements. Point * Compatibility hooks can easily place event listeners before/after/between NCP default listeners, without resorting to tricks like 'load-before'. * Future registry of NCP itself: unregistering listeners is necessary for runtime-removable checks, order is useful if not necessary, to be able to add check listeners at any point of time. Breaks: * Anything relying on the previous (optional) managelisteners feature. Missing: * Lots of testing/inspection. * Ensure all NCP listeners are coming with name/tag at least. * Provide meaningful tags/RegistrationOrder for fine grained access (e.g. after feature.moving but before feature.inventory). * Change cncp to hard depend on NCP and use listener priorities.
2018-01-16 22:19:18 +01:00
package fr.neatmonster.nocheatplus.event.mini;
/**
* Minimal listener for one event.
* @author asofold
*
* @param <E>
*/
public interface MiniListener<E> {
public void onEvent(E event);
}