mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 01:29:05 +00:00
Add Sort Settings - Filter/Order/Type to Cloner GUI
This commit is contained in:
1 parent
36cd81e6e4
commit
5d738987b2
6 files changed
+188
-58
No files matched your search
@@ -18,6 +18,7 @@ import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.scripted.CustomNPCsException;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -144,6 +145,27 @@ public class ServerCloneController implements ICloneHandler {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> getClonesDate(int tab){
|
||||
List<String> list = new ArrayList<String>();
|
||||
File dir = new File(getDir(), tab + "");
|
||||
if(!dir.exists() || !dir.isDirectory())
|
||||
return list;
|
||||
File[] files = dir.listFiles();
|
||||
Arrays.sort(files, new Comparator<File>(){
|
||||
public int compare(File f1, File f2)
|
||||
{
|
||||
return Long.compare(f1.lastModified(), f2.lastModified());
|
||||
}
|
||||
});
|
||||
|
||||
for(File file : files){
|
||||
String fileName = file.getName();
|
||||
if(fileName.endsWith(".json"))
|
||||
list.add(fileName.substring(0, fileName.length() - 5));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean removeClone(String name, int tab){
|
||||
File file = new File(new File(getDir(), tab + ""), name + ".json");
|
||||
if(!file.exists())
|
||||
|
||||
Reference in new issue
Block a user