Quick fix

This commit is contained in:
RePixelatedMC
2023-12-24 16:17:41 +01:00
parent 7e5704bf80
commit 2f0dd2d172
2 changed files with 8 additions and 2 deletions

View File

@@ -100,7 +100,13 @@ public class IrisEngineSVC implements IrisService {
Engine engine = supplier.get();
if (engine != null) {
long unloadStart = System.currentTimeMillis();
int count = engine.getMantle().unloadTectonicPlate(tectonicLimit.get() / lastUse.size());
int count = 0;
if (!lastUse.isEmpty()){
count = engine.getMantle().unloadTectonicPlate(tectonicLimit.get() / lastUse.size());
} else {
count = engine.getMantle().unloadTectonicPlate(tectonicLimit.get());
}
if (count > 0) {
Iris.debug(C.GOLD + "Unloaded " + C.YELLOW + count + " TectonicPlates in " + C.RED + Form.duration(System.currentTimeMillis() - unloadStart, 2));
}

View File

@@ -446,7 +446,7 @@ public class Mantle {
public int unloadTectonicPlate(int tectonicLimit) {
// todo: make a advanced unloader
if (toUnload.size() > tectonicLimit){
if (toUnload.size() > tectonicLimit / lastUse.size()){
dynamicThreads.set(2);
}
AtomicInteger i = new AtomicInteger();