mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:06:11 +03:00
42 lines
1.7 KiB
Diff
42 lines
1.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/world/gen/layer/IntCache.java
|
|
+++ ../src-work/minecraft/net/minecraft/world/gen/layer/IntCache.java
|
|
@@ -18,13 +18,13 @@
|
|
if (freeSmallArrays.isEmpty())
|
|
{
|
|
int[] aint4 = new int[256];
|
|
- inUseSmallArrays.add(aint4);
|
|
+ if (inUseSmallArrays.size() < org.spigotmc.SpigotConfig.intCacheLimit) inUseSmallArrays.add(aint4);
|
|
return aint4;
|
|
}
|
|
else
|
|
{
|
|
int[] aint3 = freeSmallArrays.remove(freeSmallArrays.size() - 1);
|
|
- inUseSmallArrays.add(aint3);
|
|
+ if (inUseSmallArrays.size() < org.spigotmc.SpigotConfig.intCacheLimit) inUseSmallArrays.add(aint3);
|
|
return aint3;
|
|
}
|
|
}
|
|
@@ -34,19 +34,19 @@
|
|
freeLargeArrays.clear();
|
|
inUseLargeArrays.clear();
|
|
int[] aint2 = new int[intCacheSize];
|
|
- inUseLargeArrays.add(aint2);
|
|
+ if (inUseLargeArrays.size() < org.spigotmc.SpigotConfig.intCacheLimit) inUseLargeArrays.add(aint2);
|
|
return aint2;
|
|
}
|
|
else if (freeLargeArrays.isEmpty())
|
|
{
|
|
int[] aint1 = new int[intCacheSize];
|
|
- inUseLargeArrays.add(aint1);
|
|
+ if (inUseLargeArrays.size() < org.spigotmc.SpigotConfig.intCacheLimit) inUseLargeArrays.add(aint1);
|
|
return aint1;
|
|
}
|
|
else
|
|
{
|
|
int[] aint = freeLargeArrays.remove(freeLargeArrays.size() - 1);
|
|
- inUseLargeArrays.add(aint);
|
|
+ if (inUseLargeArrays.size() < org.spigotmc.SpigotConfig.intCacheLimit) inUseLargeArrays.add(aint);
|
|
return aint;
|
|
}
|
|
}
|