mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-28 03:29:06 +00:00
Remove block data caching
This commit is contained in:
@@ -46,7 +46,6 @@ public class B {
|
||||
private static final IntSet storageCache = buildStorageCache();
|
||||
private static final IntSet storageChestCache = buildStorageChestCache();
|
||||
private static final IntSet litCache = buildLitCache();
|
||||
private static final KMap<String, BlockData> blockDataCache = new KMap<>();
|
||||
private static final ChronoLatch clw = new ChronoLatch(1000);
|
||||
|
||||
private static IntSet buildFoliageCache() {
|
||||
@@ -346,12 +345,6 @@ public class B {
|
||||
|
||||
private static BlockData parseBlockData(String ix) {
|
||||
try {
|
||||
BlockData bb = blockDataCache.get(ix);
|
||||
|
||||
if (bb != null) {
|
||||
return bb;
|
||||
}
|
||||
|
||||
BlockData bx = null;
|
||||
|
||||
if (ix.startsWith("oraxen:") && Iris.linkOraxen.supported()) {
|
||||
@@ -368,7 +361,6 @@ public class B {
|
||||
((Leaves) bx).setPersistent(false);
|
||||
}
|
||||
|
||||
blockDataCache.put(ix, bx);
|
||||
return bx;
|
||||
} catch (Throwable e) {
|
||||
if(clw.flip())
|
||||
@@ -420,9 +412,7 @@ public class B {
|
||||
Iris.debug("Converting " + ix + " to " + newBlock);
|
||||
|
||||
try {
|
||||
BlockData bd = Bukkit.createBlockData(newBlock);
|
||||
blockDataCache.put(ix, bd);
|
||||
return bd;
|
||||
return Bukkit.createBlockData(newBlock);
|
||||
} catch (Throwable e1) {
|
||||
Iris.reportError(e1);
|
||||
}
|
||||
|
||||
@@ -473,8 +473,7 @@ public class Mantle {
|
||||
* @return the file
|
||||
*/
|
||||
public static File fileForRegion(File folder, Long key) {
|
||||
String id = UUID.nameUUIDFromBytes(("TectonicPlate:" + key).getBytes(StandardCharsets.UTF_8)).toString();
|
||||
File f = new File(folder, id.substring(0, 2) + "/" + id.split("\\Q-\\E")[3] + "/" + id + ".ttp");
|
||||
File f = new File(folder, "p." + key + ".ttp");
|
||||
if(!f.getParentFile().exists())
|
||||
{
|
||||
f.getParentFile().mkdirs();
|
||||
|
||||
@@ -513,6 +513,16 @@ public abstract class VolmitPlugin extends JavaPlugin implements Listener {
|
||||
return f;
|
||||
}
|
||||
|
||||
public File getDataFolderNoCreate(String... strings) {
|
||||
if (strings.length == 0) {
|
||||
return super.getDataFolder();
|
||||
}
|
||||
|
||||
File f = new File(getDataFolder(), new KList<>(strings).toString(File.separator));
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
public File getDataFolderList(String pre, String[] strings) {
|
||||
KList<String> v = new KList<>(strings);
|
||||
v.add(0, pre);
|
||||
|
||||
Reference in New Issue
Block a user