Fix resource load in Windows

This commit is contained in:
djytw 2021-07-08 18:42:38 +02:00
parent dc89b180fb
commit 694d05e78a

View File

@ -164,7 +164,8 @@ public abstract class Extension {
*/
public @Nullable InputStream getPackagedResource(@NotNull Path target) {
try {
final URL url = getOrigin().getMinestomExtensionClassLoader().getResource(target.toString());
String path = target.toString().replace('\\', '/');
final URL url = getOrigin().getMinestomExtensionClassLoader().getResource(path);
if (url == null) {
getLogger().debug("Resource not found: {}", target);
return null;