Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/com/ss/jme/plugin/JmePluginState.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ void copyOf(@Nullable JmePluginState other) {
public void setJmbPath(@Nullable String jmbPath) {
this.jmbPath = jmbPath == null ? DEFAULT_JMB_PATH : jmbPath;
}
public String getJmbPath() {
return this.jmbPath;
}
}
20 changes: 19 additions & 1 deletion src/main/java/com/ss/jme/plugin/jmb/JmbInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class JmbInstance extends Thread {
@NotNull
private static final ReadablePacketRegistry PACKET_REGISTRY = ReadablePacketRegistry.of(EmptyServerCommand.class);


@NotNull
private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor();

Expand Down Expand Up @@ -156,6 +157,10 @@ public void run() {
}
}

public void setServer(Server server) {
this.server = server;
}

/**
* Starts an instance of jMB.
*
Expand Down Expand Up @@ -297,12 +302,25 @@ private synchronized void startInstanceImpl() {
LOG.debug("jMB was started successfully.");
}

private void setLastJmbPath(Path pathToJmb) {
lastJmbPath = pathToJmb;
}

private Server getServer() {
return server;
}

private Path getLastJmbPath() {
return lastJmbPath;
}

/**
* Gets the server of jMB.
*
* @return the server of jMB.
*/
private @NotNull Optional<Server> getServerOpt() {
private @NotNull
Optional<Server> getServerOpt() {
return Optional.ofNullable(server);
}

Expand Down