Entity spawns

This commit is contained in:
Daniel Mills
2020-11-14 22:27:37 -05:00
parent e0fc4b9443
commit 44d86bc350
17 changed files with 265 additions and 106 deletions

View File

@@ -0,0 +1,26 @@
package com.volmit.iris.util;
import java.io.File;
public class ReactiveFolder
{
private File folder;
private Consumer3<KList<File>, KList<File>, KList<File>> hotload;
private FolderWatcher fw;
public ReactiveFolder(File folder, Consumer3<KList<File>, KList<File>, KList<File>> hotload)
{
this.folder = folder;
this.hotload = hotload;
this.fw = new FolderWatcher(folder);
fw.checkModified();
}
public void check()
{
if(fw.checkModified())
{
hotload.accept(fw.getCreated(), fw.getChanged(), fw.getDeleted());
}
}
}