Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Internals

Mark Vainomaa edited this page Mar 22, 2018 · 8 revisions

Orion internals & startup

As Orion re-uses some ideas from other solutions (like Sponge, Forge and Glowstone), then some similiarities are noticeable.

Step 1: Server bootstrap

Paperclip jar will be downloaded, and server jar will be obtained using small wrapper I wrote.

As Orion Launcher tries to be as small as it can be, then it downloads all required dependencies from Maven using tiny client written by me.

Libraries are loaded to system classloader.

Bootstrap invokes LegacyLauncher to proceed to step 2

Step 2: OrionTweakClass

Tweak class deals with mod loading and dependency management. After that access transformers will be applied.

Step 2.1: Mod loading

Mod classes will be scanned for @OrionMod annotation. First class is used as a mod class.

Bytecode reading is used, because it is faster and to avoid loading the class (as you can not unload class from classloader later).

Side note: Mod resources

As all mods are loaded to LaunchClassLoader, this means resources cannot have same name (like in Bukkit plugins - plugin.yml in every jar file). I do not know which resource gets used when two jars provide same name resource.

Step 2.2: Server launching

CraftBukkit jar's main(String[] args) will be called.

Step 3: Server start

In this step, you see normal server startup. Except it utilizes modified classes now.

Summary

Orion is simple and consists from simple 3 steps! Nothing hard.

Cooking your own clone? Look here