use of cc.hyperium.mods.nickhider.command.CommandNickHider in project Hyperium by HyperiumClient.
the class NickHider method init.
@Override
public AbstractMod init() {
instance = this;
Sk1erMod sk1erMod = new Sk1erMod("nick_hider", VERSION, object -> {
if (!object.optBoolean("enabled"))
forceDown = true;
if (object.optBoolean("extended"))
extendedUse = true;
});
Multithreading.runAsync(() -> {
String s = sk1erMod.rawWithAgent("https://sk1er.club/words.txt?uuid=" + Minecraft.getMinecraft().getSession().getProfile().getId());
namesDatabase.addAll(Arrays.asList(s.split("\n")));
});
sk1erMod.checkStatus();
configFile = new File(Hyperium.folder, "nickhider.json");
if (configFile.exists()) {
try {
String s = FileUtils.readFileToString(configFile, StandardCharsets.UTF_8);
nickHiderConfig = new Gson().fromJson(s, NickHiderConfig.class);
} catch (Exception e) {
e.printStackTrace();
}
}
if (nickHiderConfig == null)
nickHiderConfig = new NickHiderConfig();
EventBus.INSTANCE.register(this);
Hyperium.INSTANCE.getHandlers().getCommandHandler().registerCommand(new CommandNickHider());
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
String s = new Gson().toJson(nickHiderConfig);
try {
FileUtils.write(configFile, s, StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
}
}));
return this;
}
Aggregations