9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 19:19:07 +00:00
This commit is contained in:
cyberpwn
2021-08-17 15:57:53 -04:00
parent 37705dfc71
commit 38329514f9
4 changed files with 18 additions and 19 deletions

View File

@@ -47,6 +47,7 @@ import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import java.lang.reflect.Field;
import java.util.List;
import java.util.UUID;
@@ -502,4 +503,20 @@ public class IrisComplex implements DataProvider {
biome.setInferredType(b.getInferredType());
return implode(biome, x, z, max - 1);
}
public void close() {
// I know this looks awful, but it helps gc not deal with the spaghetti reference soup going on here
for (Field i : getClass().getDeclaredFields())
{
if(i.getType().equals(ProceduralStream.class))
{
i.setAccessible(true);
try {
i.set(this, null);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
}

View File

@@ -303,6 +303,7 @@ public class IrisEngine extends BlockPopulator implements Engine {
getCaveModifier().close();
getPostModifier().close();
getMantle().close();
getComplex().close();
Iris.debug("Engine Fully Shutdown!");
}