classinternallombokSource
public class SessionLock

Constructors

public SessionLock(Path path)
Parameters
pathPath

Methods

public static Handle acquire(Path worldDirectory) throws IOException
Takes the world's session.lock like Minecraft does, so the game keeps its hands off the world until the handle is closed. Every write in minified-worlds takes it anyway, take it yourself if you keep a world open for longer (an editor, say). Taking it twice is fine. Disk I/O, creates session.lock if it's missing
Parameters
worldDirectoryPathThe folder with level.dat in it
Returns
Handle
Throws
IOExceptionIf Minecraft (or something else) has the world open
public boolean isLocked()

Returns the locked value.

Returns
boolean

Generated by Lombok's @Getter for the field locked

Nested types