This commit is contained in:
RePixelatedMC
2023-12-24 16:40:44 +01:00
parent 2f0dd2d172
commit cdf73c4629
3 changed files with 4 additions and 14 deletions
@@ -100,13 +100,7 @@ public class IrisEngineSVC implements IrisService {
Engine engine = supplier.get(); Engine engine = supplier.get();
if (engine != null) { if (engine != null) {
long unloadStart = System.currentTimeMillis(); long unloadStart = System.currentTimeMillis();
int count = 0; int count = engine.getMantle().unloadTectonicPlate();
if (!lastUse.isEmpty()){
count = engine.getMantle().unloadTectonicPlate(tectonicLimit.get() / lastUse.size());
} else {
count = engine.getMantle().unloadTectonicPlate(tectonicLimit.get());
}
if (count > 0) { if (count > 0) {
Iris.debug(C.GOLD + "Unloaded " + C.YELLOW + count + " TectonicPlates in " + C.RED + Form.duration(System.currentTimeMillis() - unloadStart, 2)); Iris.debug(C.GOLD + "Unloaded " + C.YELLOW + count + " TectonicPlates in " + C.RED + Form.duration(System.currentTimeMillis() - unloadStart, 2));
} }
@@ -178,8 +178,8 @@ public interface EngineMantle extends IObjectPlacer {
default void trim(int limit) { default void trim(int limit) {
getMantle().trim(TimeUnit.SECONDS.toMillis(IrisSettings.get().getPerformance().getMantleKeepAlive()), limit); getMantle().trim(TimeUnit.SECONDS.toMillis(IrisSettings.get().getPerformance().getMantleKeepAlive()), limit);
} }
default int unloadTectonicPlate(int tectonicLimit){ default int unloadTectonicPlate(){
return getMantle().unloadTectonicPlate(tectonicLimit); return getMantle().unloadTectonicPlate();
} }
default MultiBurst burst() { default MultiBurst burst() {
@@ -444,11 +444,7 @@ public class Mantle {
} }
} }
public int unloadTectonicPlate(int tectonicLimit) { public int unloadTectonicPlate() {
// todo: make a advanced unloader
if (toUnload.size() > tectonicLimit / lastUse.size()){
dynamicThreads.set(2);
}
AtomicInteger i = new AtomicInteger(); AtomicInteger i = new AtomicInteger();
unloadLock.lock(); unloadLock.lock();
try { try {