mirror of
https://github.com/asofold/CompatNoCheatPlus.git
synced 2024-11-28 12:55:25 +01:00
cncp -> CompatNoCheatPlus :)
Typo, put more plugins in the typical dependencies list.
This commit is contained in:
parent
2a6c9ddd4f
commit
c6c88d4807
@ -37,7 +37,7 @@ public class ClientVersionListener implements Listener {
|
||||
pData.setClientVersionID(Via.getAPI().getPlayerVersion(player));
|
||||
}
|
||||
else if (ProtocolSupport != null && getProtocolVersion != null && ProtocolSupport.isEnabled()) {
|
||||
// Fallback to PS
|
||||
// Fallback to PS (reflectively, due to PS not having a valid mvn repo)
|
||||
Object protocolVersion = ReflectionUtil.invokeMethod(getProtocolVersion, null, player);
|
||||
Method getId = ReflectionUtil.getMethodNoArgs(ProtocolVersionClass, "getId", int.class);
|
||||
int version = (int) ReflectionUtil.invokeMethodNoArgs(getId, protocolVersion);
|
||||
|
@ -120,13 +120,13 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
*/
|
||||
public static boolean addHook(Hook hook){
|
||||
if (Settings.preventAddHooks.contains(hook.getHookName())){
|
||||
Bukkit.getLogger().info("[cncp] Prevented adding hook: "+hook.getHookName() + " / " + hook.getHookVersion());
|
||||
Bukkit.getLogger().info("[CompatNoCheatPlus] Prevented adding hook: "+hook.getHookName() + " / " + hook.getHookVersion());
|
||||
return false;
|
||||
}
|
||||
registeredHooks.add(hook);
|
||||
if (enabled) registerListeners(hook);
|
||||
boolean added = checkAddNCPHook(hook); // Add if plugin is present, otherwise queue for adding.
|
||||
Bukkit.getLogger().info("[cncp] Registered hook"+(added?"":"(NCPHook might get added later)")+": "+hook.getHookName() + " / " + hook.getHookVersion());
|
||||
Bukkit.getLogger().info("[CompatNoCheatPlus] Registered hook"+(added?"":"(NCPHook might get added later)")+": "+hook.getHookName() + " / " + hook.getHookVersion());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
cfgHook.applyConfig(cfg, "hooks.");
|
||||
}
|
||||
catch (Throwable t){
|
||||
getLogger().severe("[cncp] Hook failed to process config ("+hook.getHookName() +" / " + hook.getHookVersion()+"): " + t.getClass().getSimpleName() + ": "+t.getMessage());
|
||||
getLogger().severe("[CompatNoCheatPlus] Hook failed to process config ("+hook.getHookName() +" / " + hook.getHookVersion()+"): " + t.getClass().getSimpleName() + ": "+t.getMessage());
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -324,11 +324,11 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
for (String plgName : settings.loadPlugins){
|
||||
try{
|
||||
if (CompatNoCheatPlus.enablePlugin(plgName)){
|
||||
System.out.println("[cncp] Ensured that the following plugin is enabled: " + plgName);
|
||||
System.out.println("[CompatNoCheatPlus] Ensured that the following plugin is enabled: " + plgName);
|
||||
}
|
||||
}
|
||||
catch (Throwable t){
|
||||
logger.severe("[cncp] Failed to enable the plugin: " + plgName);
|
||||
logger.severe("[CompatNoCheatPlus] Failed to enable the plugin: " + plgName);
|
||||
logger.severe(Utils.toString(t));
|
||||
}
|
||||
}
|
||||
@ -337,7 +337,7 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
if (!oldForceEnableLater.remove(plgName)) oldForceEnableLater.add(plgName);
|
||||
}
|
||||
if (!oldForceEnableLater.isEmpty()){
|
||||
System.out.println("[cncp] Schedule task to re-enable plugins later...");
|
||||
System.out.println("[CompatNoCheatPlus] Schedule task to re-enable plugins later...");
|
||||
sched.scheduleSyncDelayedTask(this, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -346,11 +346,11 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
for (String plgName : oldForceEnableLater){
|
||||
try{
|
||||
if (disablePlugin(plgName)){
|
||||
if (enablePlugin(plgName)) System.out.println("[cncp] Re-enabled plugin: " + plgName);
|
||||
else System.out.println("[cncp] Could not re-enable plugin: "+plgName);
|
||||
if (enablePlugin(plgName)) System.out.println("[CompatNoCheatPlus] Re-enabled plugin: " + plgName);
|
||||
else System.out.println("[CompatNoCheatPlus] Could not re-enable plugin: "+plgName);
|
||||
}
|
||||
else{
|
||||
System.out.println("[cncp] Could not disable plugin (already disabled?): "+plgName);
|
||||
System.out.println("[CompatNoCheatPlus] Could not disable plugin (already disabled?): "+plgName);
|
||||
}
|
||||
}
|
||||
catch (Throwable t){
|
||||
@ -393,7 +393,7 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
getLogger().info("[cncp] Removed "+n+" registered hooks from NoCheatPlus.");
|
||||
getLogger().info("[CompatNoCheatPlus] Removed "+n+" registered hooks from NoCheatPlus.");
|
||||
registeredHooks.clear();
|
||||
return n;
|
||||
}
|
||||
@ -407,7 +407,7 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
NCPHookManager.addHook(hook.getCheckTypes(), ncpHook);
|
||||
n ++;
|
||||
}
|
||||
getLogger().info("[cncp] Added "+n+" registered hooks to NoCheatPlus.");
|
||||
getLogger().info("[CompatNoCheatPlus] Added "+n+" registered hooks to NoCheatPlus.");
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -458,8 +458,7 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
infos.add(temp.isEmpty() ? "NoCheatPlus is missing or not yet enabled." : temp);
|
||||
infos.add("#### Typical plugin dependencies ####");
|
||||
for (String pluginName : new String[]{
|
||||
"mcMMO", "Citizens", "MachinaCraft", "MagicSpells",
|
||||
// TODO: extend
|
||||
"mcMMO", "Citizens", "MachinaCraft", "MagicSpells", "ViaVersion", "ProtocolSupport", "GravityTubes", "Geyser-Spigot", "floodgate", "CMI", "Geyser-BungeeCord"
|
||||
}){
|
||||
temp = getOtherVersion(pluginName);
|
||||
if (!temp.isEmpty()) infos.add(temp);
|
||||
|
@ -33,12 +33,13 @@ public class BedrockPlayerListener implements Listener, PluginMessageListener {
|
||||
if (FloodgateApi.getInstance().isFloodgatePlayer(player.getUniqueId())) {
|
||||
processExemption(player);
|
||||
}
|
||||
} else
|
||||
if (geyser != null && geyser.isEnabled()) {
|
||||
}
|
||||
else if (geyser != null && geyser.isEnabled()) {
|
||||
try {
|
||||
GeyserSession session = GeyserConnector.getInstance().getPlayerByUuid(player.getUniqueId());
|
||||
if (session != null) processExemption(player);
|
||||
} catch (NullPointerException e) {}
|
||||
}
|
||||
catch (NullPointerException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,12 +55,12 @@ public class Settings {
|
||||
if (cfg.getDouble("hooks.set-speed.fly-speed", 0.1) != 0.1){
|
||||
changed = true;
|
||||
cfg.set("hooks.set-speed.fly-speed", 0.1);
|
||||
Bukkit.getLogger().warning("[cncp] Reset fly-speed for the set-speed hook to 0.1 (default) as a safety measure.");
|
||||
Bukkit.getLogger().warning("[CompatNoCheatPlus] Reset fly-speed for the set-speed hook to 0.1 (default) as a safety measure.");
|
||||
}
|
||||
if (cfg.getDouble("hooks.set-speed.walk-speed", 0.2) != 0.2){
|
||||
changed = true;
|
||||
cfg.set("hooks.set-speed.walk-speed", 0.2);
|
||||
Bukkit.getLogger().warning("[cncp] Reset walk-speed for the set-speed hook to 0.2 (default) as a safety measure.");
|
||||
Bukkit.getLogger().warning("[CompatNoCheatPlus] Reset walk-speed for the set-speed hook to 0.2 (default) as a safety measure.");
|
||||
}
|
||||
}
|
||||
if (ConfigUtil.forceDefaults(getDefaultConfig(), cfg)) changed = true;
|
||||
|
@ -137,7 +137,7 @@ public class ConfigUtil {
|
||||
final CheckType checkType = CheckType.valueOf(entry);
|
||||
set.add(checkType);
|
||||
} catch (Exception e) {
|
||||
System.out.println("[cncp] Unknow check " + entry + " is. Skipping!");
|
||||
System.out.println("[CompatNoCheatPlus] Unknown check " + entry + ". Skipping.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,12 +89,12 @@ public class HookMagicSpells extends AbstractConfigurableHook implements Listene
|
||||
catch(Throwable t){
|
||||
}
|
||||
if (type == null){
|
||||
Bukkit.getLogger().warning("[cncp] HookMagicSpells: Bad check type at " + fullKey + ": " + input);
|
||||
Bukkit.getLogger().warning("[CompatNoCheatPlus] HookMagicSpells: Bad check type at " + fullKey + ": " + input);
|
||||
}
|
||||
else checkTypes.add(type);
|
||||
}
|
||||
if (checkTypes.isEmpty()){
|
||||
Bukkit.getLogger().warning("[cncp] HookMagicSpells: No CheckType entries at: " + fullKey);
|
||||
Bukkit.getLogger().warning("[CompatNoCheatPlus] HookMagicSpells: No CheckType entries at: " + fullKey);
|
||||
}
|
||||
else{
|
||||
CheckType[] a = new CheckType[checkTypes.size()];
|
||||
|
Loading…
Reference in New Issue
Block a user