13
0
geforkt von Mirrors/Paper

Fixed getResource not working post-reload, thanks to feildmaster

By: Nathan Adams <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-11-13 11:11:45 +00:00
Ursprung 75f99315f7
Commit 67a69090f5

Datei anzeigen

@ -9,6 +9,8 @@ import com.avaje.ebeaninternal.server.ddl.DdlGenerator;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@ -149,7 +151,14 @@ public abstract class JavaPlugin implements Plugin {
throw new IllegalArgumentException("Filename cannot be null");
}
return getClassLoader().getResourceAsStream(filename);
try {
URL url = getClassLoader().getResource(filename);
URLConnection connection = url.openConnection();
connection.setUseCaches(false);
return connection.getInputStream();
} catch (IOException ex) {
return null;
}
}
/**