A few bugfixes.
This commit is contained in:
parent
541b6ffd1e
commit
eba582f3f3
@ -52,6 +52,9 @@ public class MCore extends MPlugin
|
||||
|
||||
// Register events
|
||||
this.listener = new InternalListener(this);
|
||||
|
||||
if ( ! preEnable()) return;
|
||||
this.postEnable();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public abstract class GsonClassManager<T> implements IClassManager<T>
|
||||
protected boolean didLoadAll = false;
|
||||
protected void loadIds()
|
||||
{
|
||||
if ( ! this.getFolder().exists()) return;
|
||||
for(File file : this.getFolder().listFiles(JsonFileFilter.getInstance()))
|
||||
{
|
||||
this.ids.add(this.idFromFile(file));
|
||||
|
@ -19,8 +19,6 @@ public class DiscUtil
|
||||
|
||||
public static byte[] readBytes(File file) throws IOException
|
||||
{
|
||||
File parent = file.getParentFile();
|
||||
if (parent != null && !parent.exists()) parent.mkdirs();
|
||||
int length = (int) file.length();
|
||||
byte[] output = new byte[length];
|
||||
InputStream in = new FileInputStream(file);
|
||||
@ -36,6 +34,8 @@ public class DiscUtil
|
||||
|
||||
public static void writeBytes(File file, byte[] bytes) throws IOException
|
||||
{
|
||||
File parent = file.getParentFile();
|
||||
if (parent != null && !parent.exists()) parent.mkdirs();
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
out.write(bytes);
|
||||
out.close();
|
||||
|
Loading…
Reference in New Issue
Block a user