mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Entity spawns
This commit is contained in:
26
src/main/java/com/volmit/iris/util/ReactiveFolder.java
Normal file
26
src/main/java/com/volmit/iris/util/ReactiveFolder.java
Normal 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user