Use Faster GlueList

Uses GlueList a faster List implementation. Drop in replacement for ArrayList.

https://github.com/ertugrulcetin/GlueList
This commit is contained in:
Bud Gidiere
2020-11-19 19:09:48 -06:00
parent bb4ecee1f8
commit d125ee3d87
6 changed files with 1062 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import com.dfsek.terra.config.base.ConfigPack;
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
import com.dfsek.terra.config.genconfig.biome.BiomeFloraConfig;
import com.dfsek.terra.event.TreeGenerateEvent;
import com.dfsek.terra.util.GlueList;
import org.apache.commons.math3.util.FastMath;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
@@ -48,7 +49,7 @@ public class FloraPopulator extends GaeaBlockPopulator {
}
public static List<Block> getValidTreeSpawnsAt(Chunk chunk, int x, int z, Range check) {
List<Block> blocks = new ArrayList<>();
List<Block> blocks = new GlueList<>();
for(int y : check) {
if(chunk.getBlock(x, y, z).getType().isSolid() && chunk.getBlock(x, y + 1, z).getType().isAir()) {
blocks.add(chunk.getBlock(x, y + 1, z));