mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-27 14:13:11 +02:00
Rename DummyNoCheatPlusAPI to UnitTestNoCheatPlusAPI for the prefix.
Allows determining the state of the system more easily.
This commit is contained in:
parent
13b00a6b8e
commit
30b293e735
@ -45,6 +45,9 @@ import fr.neatmonster.nocheatplus.logging.LogManager;
|
||||
* ComponentWithName (tag)</li>
|
||||
* <hr>
|
||||
* Not sure about all the login-denial API, some of those might get removed.
|
||||
* <hr>
|
||||
* NOTE: Class names for implementations of the NoCheatPlusAPI which aim at unit
|
||||
* tests, where server access might not work, should start with "UnitTest".
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
|
@ -31,15 +31,18 @@ import fr.neatmonster.nocheatplus.logging.StaticLog;
|
||||
public class PluginTests {
|
||||
|
||||
/**
|
||||
* Dummy API, providing only a minimal subset of functionality for offline-testing. Some methods do nothing, some throw an UnsupportedOperationException, some will do something (set/get MCAccess).
|
||||
* Dummy API, providing only a minimal subset of functionality for
|
||||
* offline-testing. Some methods do nothing, some throw an
|
||||
* UnsupportedOperationException, some will do something (set/get MCAccess).
|
||||
*
|
||||
* @author asofold
|
||||
*
|
||||
*/
|
||||
public static class DummyNoCheatPlusAPI implements NoCheatPlusAPI {
|
||||
public static class UnitTestNoCheatPlusAPI implements NoCheatPlusAPI {
|
||||
|
||||
private final DefaultGenericInstanceRegistry genericInstanceRegistry = new DefaultGenericInstanceRegistry();
|
||||
|
||||
public DummyNoCheatPlusAPI() {
|
||||
public UnitTestNoCheatPlusAPI() {
|
||||
genericInstanceRegistry.registerGenericInstance(MCAccess.class, new MCAccessBukkit());
|
||||
}
|
||||
|
||||
@ -162,9 +165,9 @@ public class PluginTests {
|
||||
|
||||
}
|
||||
|
||||
public static void setDummNoCheatPlusAPI(boolean force) {
|
||||
public static void setUnitTestNoCheatPlusAPI(boolean force) {
|
||||
if (force || NCPAPIProvider.getNoCheatPlusAPI() == null) {
|
||||
NCPAPIProvider.setNoCheatPlusAPI(new DummyNoCheatPlusAPI());
|
||||
NCPAPIProvider.setNoCheatPlusAPI(new UnitTestNoCheatPlusAPI());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class BlockTests {
|
||||
* Initialize BlockProperties with default config and Bukkit-API compliance :p.
|
||||
*/
|
||||
public static void initBlockProperties() {
|
||||
PluginTests.setDummNoCheatPlusAPI(false);
|
||||
PluginTests.setUnitTestNoCheatPlusAPI(false);
|
||||
BlockProperties.init(NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(MCAccess.class), new DefaultConfigWorldConfigProvider());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user