Skip to content

Instances

Vrekt edited this page May 12, 2023 · 2 revisions

TODO

These features are not included within Lunar, yet

Instances describe something like an interior, dungeon, etc within an already existing world. Instances get their base implementation from LunarWorld. All features within LunarWorld are available within instances.

Instances

Defining a new instance

To create a new instance you can simply extend LunarInstance.

public final class MyInterior extends LunarInstance<MyPlayer, MultiplayerPlayer, LunarEntity> {}

parameters:

  • 1: The first parameter is your local player.
  • 2: The second parameter is which implementation to use for MP players.
  • 3: The third parameter is which implemented to use for all entities/

You can define any custom entity you want as long as it extends LunarEntityPlayer and LunarEntity respectively.

Here is my implementation in my own game:

public abstract class OasisInteriorDungeon extends LunarInstance<OasisPlayerSP, OasisNetworkPlayer, LunarEntity> implements InputProcessor {}

You can find my game here

Configuration