mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-04 16:13:32 +01:00
Make it so dynmap commands can be proxied via /execute
without failing to parse.
Also adds some gitignore entries for stuff generated by fabric
This commit is contained in:
parent
11388de37d
commit
47b75694d8
2
.gitignore
vendored
2
.gitignore
vendored
@ -24,9 +24,11 @@
|
|||||||
/bin
|
/bin
|
||||||
/dist
|
/dist
|
||||||
/manifest.mf
|
/manifest.mf
|
||||||
|
/run
|
||||||
|
|
||||||
# Mac filesystem dust
|
# Mac filesystem dust
|
||||||
/.DS_Store
|
/.DS_Store
|
||||||
/dependency-reduced-pom.xml
|
/dependency-reduced-pom.xml
|
||||||
|
|
||||||
|
*.log
|
||||||
/.gradle
|
/.gradle
|
||||||
|
@ -45,7 +45,13 @@ public class DynmapCommandExecutor implements Command<ServerCommandSource> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
|
public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
|
||||||
String[] args = context.getInput().split("\\s+");
|
// Commands in brigadier may be proxied in Minecraft via a syntax like `/execute ... ... run dmap [args]`
|
||||||
|
// Dynmap will fail to parse this properly, so we find the starting position of the actual command being parsed after any forks or redirects.
|
||||||
|
// The start position of the range specifies where the actual command dynmap has registered starts
|
||||||
|
int start = context.getRange().getStart();
|
||||||
|
String dynmapInput = context.getInput().substring(start);
|
||||||
|
|
||||||
|
String[] args = dynmapInput.split("\\s+");
|
||||||
plugin.handleCommand(context.getSource(), cmd, Arrays.copyOfRange(args, 1, args.length));
|
plugin.handleCommand(context.getSource(), cmd, Arrays.copyOfRange(args, 1, args.length));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,13 @@ public class DynmapCommandExecutor implements Command<ServerCommandSource> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
|
public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
|
||||||
String[] args = context.getInput().split("\\s+");
|
// Commands in brigadier may be proxied in Minecraft via a syntax like `/execute ... ... run dmap [args]`
|
||||||
|
// Dynmap will fail to parse this properly, so we find the starting position of the actual command being parsed after any forks or redirects.
|
||||||
|
// The start position of the range specifies where the actual command dynmap has registered starts
|
||||||
|
int start = context.getRange().getStart();
|
||||||
|
String dynmapInput = context.getInput().substring(start);
|
||||||
|
|
||||||
|
String[] args = dynmapInput.split("\\s+");
|
||||||
plugin.handleCommand(context.getSource(), cmd, Arrays.copyOfRange(args, 1, args.length));
|
plugin.handleCommand(context.getSource(), cmd, Arrays.copyOfRange(args, 1, args.length));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user