forked from chipmunkmc/chipmunkbot
feat: allow path outside bot dir for funnies
This commit is contained in:
parent
0fcc68c7a2
commit
10ca2e4e06
2 changed files with 2 additions and 5 deletions
|
@ -58,7 +58,7 @@ public class LocationArgumentType implements ArgumentType<Object> {
|
|||
public Path parsePath (StringReader reader) throws CommandSyntaxException {
|
||||
final String pathString = reader.readString();
|
||||
final Path path = Path.of(root.toString(), pathString).toAbsolutePath().normalize();
|
||||
if (!path.startsWith(root)) throw OOB_FILEPATH.create();
|
||||
// if (!path.startsWith(root)) throw OOB_FILEPATH.create(); for the funnies
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,10 +99,7 @@ public class MusicCommand {
|
|||
final Path path = getPath(context, "location");
|
||||
|
||||
if (path != null) songPlayer.loadSong(path);
|
||||
else {
|
||||
source.sendOutput(Component.text("no").color(NamedTextColor.RED));
|
||||
// songPlayer.loadSong(getUrl(context, "location"));
|
||||
}
|
||||
else songPlayer.loadSong(getUrl(context, "location"));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue