Table of Contents

Class BukkitPathRule

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

The two characters a Paper or Purpur server refuses to run from.

public static class BukkitPathRule
Inheritance
BukkitPathRule
Inherited Members

Remarks

Paper will not start from a path containing + or !, and says so and exits. The two are rejected at different stages and with different wording: ! stops Paperclip before the server exists at all ("Paperclip may not run in a directory containing '!'"), while + gets as far as CraftBukkit's own check ("Cannot run server in a directory with ! or + in the pathname"). Both leave a process that exits cleanly, which the launcher reads as a crash and retries three times.

It applies to the Bukkit family only. The mod loaders and Vanilla run from those paths quite happily, so a folder that has worked for months stops working the moment it becomes Paper — with nothing linking the rename-your-folder message to the type change that caused it.

Methods

Applies(ServerType)

Whether this server type cares about the path at all.

public static bool Applies(ServerType type)

Parameters

type ServerType

Returns

bool

IsInServerFolderName(string?)

Whether the offending character is in the server's own folder rather than above it.

public static bool IsInServerFolderName(string? path)

Parameters

path string

Returns

bool

Remarks

The difference decides whether the app may offer to fix it. Renaming the server's own folder affects only that server; renaming a parent would move everything else living under it too, which is not the app's to do.

IsPathRejection(string)

Whether a console line is the server refusing to run because of its path.

public static bool IsPathRejection(string line)

Parameters

line string

Returns

bool

Remarks

Both wordings, because they come from different programs. Matched so an existing server that hits this gets an explanation rather than three silent restarts — the checks above stop it being reached in the first place, but only for servers created or converted from now on.

OffendingCharacter(string?)

The first offending character in path, or null when there is none.

public static char? OffendingCharacter(string? path)

Parameters

path string

Returns

char?

Remarks

The whole absolute path, not just the server's own folder name: the check is on the working directory, so a + anywhere above it — in a user name, in a Dropbox folder — rejects every Paper server underneath just the same.

Rejects(string?, ServerType)

Whether this type would refuse to start from this path.

public static bool Rejects(string? path, ServerType type)

Parameters

path string
type ServerType

Returns

bool

SuggestCleanPath(string?)

The same path with the offending characters replaced by a hyphen, or null when there is nothing to fix or the problem is in a parent folder.

public static string? SuggestCleanPath(string? path)

Parameters

path string

Returns

string

Remarks

A hyphen rather than nothing: "Java+Bedrock" becoming "JavaBedrock" reads like a typo, while "Java-Bedrock" reads like the name the user meant. Only the last segment is touched.