/** * Convenience method. * @deprecated Use fr.neatmonster.nocheatplus.utilities.NCPAPIProvider.getNoCheatPlusAPI() instead, this method might get removed. * @return */ public static NoCheatPlusAPI getAPI() { return NCPAPIProvider.getNoCheatPlusAPI(); }
@Override public ActionFactoryFactory getActionFactoryFactory() { ActionFactoryFactory factory = getGenericInstance(ActionFactoryFactory.class); if (factory == null) { setActionFactoryFactory(null); factory = getGenericInstance(ActionFactoryFactory.class); } return factory; }
/** * 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. This will also register ComponentRegistry instances * if given. */ @Override public boolean addComponent(final Object obj) { return addComponent(obj, true); }
private void noConfirmTeleportPacket() { acceptConfirmTeleportPackets = false; // TODO: Attempt to unregister. NCPAPIProvider.getNoCheatPlusAPI().getLogManager().info(Streams.STATUS, "Confirm teleport packet not available."); }
public RegisterInstanceWorld(RegistrationContext registrationContext, Class<T> type) { super(registrationContext, type, NCPAPIProvider.getNoCheatPlusAPI().getWorldDataManager()); }
private void updateNoCheatPlusAPI() { if (NCPAPIProvider.getNoCheatPlusAPI() == null) { lockableAPI.unlock(lockableAPIsecret); NCPAPIProvider.setNoCheatPlusAPI(this, lockableAPI); lockableAPI.lock(lockableAPIsecret); } }
/** * Register actual listener(s). */ public void register() { // TODO: Replace 'if (enabled)' by actually unregistering the listeners. final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI(); for (final MiniListener<?> listener : miniListeners) { api.addComponent(listener); } }
public RegisterInstancePlayer(RegistrationContext registrationContext, Class<T> type) { super(registrationContext, type, NCPAPIProvider.getNoCheatPlusAPI().getPlayerDataManager()); }
@Override public void runPostRegister() { NCPAPIProvider.getNoCheatPlusAPI().registerGenericInstance(IBridgeCrossPlugin.class, this); }
/** * Instantiates a new survival fly check. */ public SurvivalFly() { super(CheckType.MOVING_SURVIVALFLY); blockChangeTracker = NCPAPIProvider.getNoCheatPlusAPI().getBlockChangeTracker(); }
public CheckListener(CheckType checkType){ this.checkType = checkType; this.mcAccess = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(MCAccess.class); }
/** * Convenience method to get a Random instance from the generic registry * (NoCheatPlusAPI). * * @return the random */ // TODO: Move official stuff to some static direct access API. public static Random getRandom() { return NCPAPIProvider.getNoCheatPlusAPI().getGenericInstance(Random.class); }
@Override public void log(Level level, String content) { // Ignore level for now. NCPAPIProvider.getNoCheatPlusAPI().sendAdminNotifyMessage(prefixIngame == null ? content : (prefixIngame + content)); }
/** * Set the NoCheaPlusAPI without locking against changes. Further see: * {@link #setNoCheatPlusAPI(NoCheatPlusAPI, ILockable)} * * @param noCheatPlusAPI */ static void setNoCheatPlusAPI(NoCheatPlusAPI noCheatPlusAPI) { setNoCheatPlusAPI(noCheatPlusAPI, null); }
@Override public int sendAdminNotifyMessage(final String message) { // TODO: Does this always work? return sendAdminNotifyMessageSubscriptions(message); }
@Override public boolean isLoginDenied(String playerName) { return isLoginDenied(playerName, System.currentTimeMillis()); }
private void onWorldLoad(final WorldLoadEvent event) { onWorldPresent(event.getWorld()); }
/** * Initializing with online players. */ public void onEnable() { final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI(); for (final MiniListener<?> listener : miniListeners) { api.addComponent(listener, false); } api.addComponent(this); }
/** * Instantiates a new creative fly check. */ public CreativeFly() { super(CheckType.MOVING_CREATIVEFLY); blockChangeTracker = NCPAPIProvider.getNoCheatPlusAPI().getBlockChangeTracker(); }
public WrapBlockCache() { this(NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(MCAccess.class)); }