Fix localizations

This commit is contained in:
tterrag1098 committed 2015-05-04 19:29:08 -04:00
1 parent fddcd36f29
commit ed514c78cc
11 files changed
+72

No files matched your search

@@ -0,0 +1,51 @@
package com.enderio.core.common.util;
import java.io.File;
import java.util.List;
import lombok.SneakyThrows;
import com.google.common.collect.Lists;
public class PermanentCache<I> extends WorldCache<I> {
private static final List<PermanentCache<?>> allCaches = Lists.newArrayList();
@SneakyThrows
public PermanentCache(String ident) {
super(ident);
loadData(getSaveFile());
}
@Override
@SneakyThrows
protected File getSaveFile() {
return new File("saves", ident + ".dat");
}
@Override
protected void blockOldIDs() {
if (!objToName.isEmpty()) {
super.blockOldIDs();
}
}
@Override
protected void mergeNewIDs() {
if (!objToName.isEmpty()) {
super.mergeNewIDs();
}
}
@Override
public void addObject(I object, String name) {
super.addObject(object, name);
setID(name);
}
public static void saveCaches() {
for (PermanentCache<?> c : allCaches) {
c.saveData(c.getSaveFile());
}
}
}