Skip to main content

3. Management & Control

DerThe IWorldManager verwaltetmanages alleall Welten,worlds, währendwhile dasthe IManageableWorld-Objekt dieobject Kontrolleallows übercontrol eineover spezifischea Weltspecific ermöglicht.world.

WeltenRetrieve abrufenworlds

// EinzelneRetrive Welta holensingle world
Optional<IManageableWorld> worldOpt = worldManager.getWorld("Lobby");

// AlleRetrive Weltenall auflistenworlds
List<IManageableWorld> allWorlds = worldManager.getWorlds();

Welt-AktionenWorld actions

JedesEach IManageableWorld-Objekt bietetobject Methodenprovides zurmethods Steuerung:for control:

MethodeMethod

BeschreibungDescription

loadMap()

LädtLoads diethe Weltworld vonfrom derthe Festplattehard drive (Bukkit World Init).

unloadMap()

EntlädtUnloads diethe Weltworld undand teleportiertteleports Spielerplayers zumto Hauptspawn.the main spawn.

deleteMap()

LöschtIrrevocably diedeletes Weltthe unwiderruflichworld (Dateienfiles & Datenbank-Eintrag)database entry).

reCreate(boolean save)

LöschtDeletes diethe Weltworld undand generiertregenerates sie neuit (Reset)reset). OptionalOptionally mitwith Backupbackup (true) oderor ohnewithout (false).

clone(String name)

ErstelltCreates einea Kopiecopy derof Weltthe unterworld neuemunder Namen.a new name.

Beispiel:Example: Welt-ResetPerforming durchführena world reset

worldManager.getWorld("Farmwelt"“Farmworld”).ifPresent(world -> {
    // WeltReset zurücksetzenworld undand Kopiekeep dercopy altenof Weltold behaltenworld
    world.reCreate(true); 
});

Beispiel:Example: WeltRemove entfernenworld (ausfrom demthe System)system)

WennIf duyou einewant Weltto ausremove a world from GWorld entfernen(including möchtestdeleting (inklusivethe Löschung der Dateien)files):

// VarianteOption A: DirektDirectly übervia dasthe Objektobject (Empfohlen)recommended)
world.deleteMap();

// VarianteOption B: ÜberOver denthe Managermanager
worldManager.removeWorld(world);