MCPcopy Create free account
hub / github.com/ZetaMap/MoreCommands / init

Method init

src/main/java/moreCommandsPlugin.java:75–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74 // Called after all plugins have been created and commands have been registered.
75 public void init() {
76 // check if a new update is available
77 arc.util.Http.get(mindustry.Vars.ghApi + "/repos/ZetaMap/moreCommands/releases/latest", s -> {
78 String[] lastestV = arc.util.serialization.Jval.read(s.getResultAsString()).get("tag_name").asString().substring(1).split("\\."),
79 pluginV = mindustry.Vars.mods.getMod("morecommands").meta.version.split("\\.");
80
81 if (Strings.parseFloat(lastestV[1].isBlank() ? lastestV[0]
82 : lastestV[0] + (lastestV[1].length() == 1 ? ".0" : ".") + lastestV[1]) > Strings.parseFloat(
83 pluginV[1].isBlank() ? pluginV[0] : pluginV[0] + (pluginV[1].length() == 1 ? ".0" : ".") + pluginV[1]))
84 Log.info( "A new version of moreCommands is available! See 'github.com/ZetaMap/moreCommands/releases' to download it!");
85 }, null);
86
87 ContentRegister.initFilters(); // init chat and actions filters
88 CommandsManager.init(); // init the commands manager
89
90 // pause the game if no one is connected
91 if (PVars.autoPause) {
92 state.set(State.paused);
93 Log.info("auto-pause: Game paused...");
94 }
95
96 Log.info("|-> MoreCommands Plugin loaded! enjoy the fun =)");
97 }
98
99 // register commands that run on the server
100 @Override

Callers

nothing calls this directly

Calls 5

initFiltersMethod · 0.95
initMethod · 0.95
infoMethod · 0.80
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected