9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2026-01-06 15:51:30 +00:00
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

View File

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

View File

@@ -178,8 +178,8 @@ public interface EngineMantle extends IObjectPlacer {
default void trim(int limit) {
getMantle().trim(TimeUnit.SECONDS.toMillis(IrisSettings.get().getPerformance().getMantleKeepAlive()), limit);
}
default int unloadTectonicPlate(int tectonicLimit){
return getMantle().unloadTectonicPlate(tectonicLimit);
default int unloadTectonicPlate(){
return getMantle().unloadTectonicPlate();
}
default MultiBurst burst() {

View File

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