minified-worlds/com.dervarex.minified.worlds.save
SessionLock
public class SessionLockConstructors
public SessionLock(Path path)| Parameters | ||
|---|---|---|
path | Path | |
Methods
Handle acquire(Path)Takes the world's session.lock like Minecraft does, so the game keeps its hands off the world until the handle is closed.boolean isLocked()Returns the locked value.acquire(Path)
staticSource
public static Handle acquire(Path worldDirectory) throws IOExceptionTakes 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 | ||
|---|---|---|
worldDirectory | Path | The folder with level.dat in it |
| Returns | ||
Handle | ||
| Throws | ||
IOException | If Minecraft (or something else) has the world open | |
isLocked()
lombokSource
public boolean isLocked()Returns the locked value.
| Returns | ||
|---|---|---|
boolean | ||
Generated by Lombok's @Getter for the field locked