Reference: Leagues

Registry type: LibDatabase.LEAGUE (library_of_exile_league) — SyncTime.NEVER

Leagues are hardcoded only — no JSON support. They are never synced to clients.


League

com.robertx22.library_of_exile.database.league.League

Abstract. Implements ExileRegistry<League>, ITranslated.

Abstract methods

boolean isInSide(ServerLevel level, BlockPos pos)
// Return true when pos is considered "inside" this league.

ChatFormatting getTextColor()
// Color used for league name display.

String modid()
String locName()

Static utility

static League getFromPosition(ServerLevel level, BlockPos pos)
// Iterates all registered leagues, returns the first whose isInSide() returns true.
// Falls back to LibLeagues.INSTANCE.EMPTY.get() (the EmptyLeague) if none match.

EmptyLeague

The fallback league. isInSide() always returns false. GUID: "empty".

Never store or compare against null for a league — always compare against EmptyLeague.

boolean isNotEmpty = !league.GUID().equals("empty");
// or:
boolean isNotEmpty = !(league instanceof EmptyLeague);

CurrentLeague

com.robertx22.library_of_exile.dimension.CurrentLeague

Runtime context representing where a player currently is within a map dimension.

public MapDimensionInfo dimension
public Optional<MapStructure> structure
public Optional<AllMapConnectionData.Data> connectedFrom

static Optional<CurrentLeague> get(ServerLevel level, BlockPos pos)

boolean isAffectedBy(MapDimensionInfo info)

get() returns Optional.empty() when the position is not in any registered map dimension.

Five logical states

  1. Inside the primary map structure.
  2. Inside a secondary map structure.
  3. Inside the map dimension but outside any structure.
  4. In a connected dimension (teleported in from another map).
  5. Not in a map dimension at all → Optional.empty().

OnTeleportToLeagueEvent

Forge event fired when a player is teleported to a league dimension.

ServerPlayer getPlayer()
League getLeague()

Register via ApiForgeEvents.registerForgeEvent(OnTeleportToLeagueEvent.class, event -> { ... }).


Built-in leagues (LibLeagues)

Key GUID Notes
EMPTY "empty" Fallback. isInSide() always false

Registration example

public class MyLeagueRegistrar extends ExileRegistryEventClass {

    @Override
    public ExileRegistryType getType() {
        return LibDatabase.LEAGUE;
    }

    @Override
    public void init(ExileRegistryEvent e) {
        e.add(new MyLeague(), ExileRegistrationInfo.of("my_mod"));
    }
}

Return from OrderedModConstructor.getRegisterEvents().