mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-30 20:37:52 +01:00
Add components package with interfaces [likely to be moved around soon].
This commit is contained in:
parent
ea82a57272
commit
c6eb573b57
@ -0,0 +1,18 @@
|
|||||||
|
package fr.neatmonster.nocheatplus.components;
|
||||||
|
|
||||||
|
public interface IComponentRegistry {
|
||||||
|
/**
|
||||||
|
* Convenience method to add components according to implemented interfaces,
|
||||||
|
* like Listener, INotifyReload, INeedConfig.<br>
|
||||||
|
* For the NoCheatPlus instance this must be done after the configuration has been initialized.
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
public void addComponent(final Object onj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a registered component. <br>
|
||||||
|
* Does not unregister listeners currently.
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
public void removeComponent(final Object obj);
|
||||||
|
}
|
10
src/fr/neatmonster/nocheatplus/components/IData.java
Normal file
10
src/fr/neatmonster/nocheatplus/components/IData.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package fr.neatmonster.nocheatplus.components;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some (player-related) data is held here.
|
||||||
|
* @author mc_dev
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IData {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package fr.neatmonster.nocheatplus.components;
|
||||||
|
|
||||||
|
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface to indicate a component is associated with a CheckType.
|
||||||
|
* @author mc_dev
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IHaveCheckType {
|
||||||
|
public CheckType getCheckType();
|
||||||
|
}
|
11
src/fr/neatmonster/nocheatplus/components/INeedConfig.java
Normal file
11
src/fr/neatmonster/nocheatplus/components/INeedConfig.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package fr.neatmonster.nocheatplus.components;
|
||||||
|
|
||||||
|
import fr.neatmonster.nocheatplus.command.INotifyReload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicate that a component needs config after time of creation but in onEnable.
|
||||||
|
* @author mc_dev
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface INeedConfig extends INotifyReload{
|
||||||
|
}
|
20
src/fr/neatmonster/nocheatplus/components/IRemoveData.java
Normal file
20
src/fr/neatmonster/nocheatplus/components/IRemoveData.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package fr.neatmonster.nocheatplus.components;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for component registration to allow cleanup for player data.
|
||||||
|
* @author mc_dev
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IRemoveData {
|
||||||
|
/**
|
||||||
|
* Remove the data of one player.
|
||||||
|
* @param playerName
|
||||||
|
* @return IData instance, if it was present.
|
||||||
|
*/
|
||||||
|
public IData removeData(String playerName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the data of all players.
|
||||||
|
*/
|
||||||
|
public void removeAllData();
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package fr.neatmonster.nocheatplus.components;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public interface NoCheatPlusAPI extends IComponentRegistry{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user