mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-24 10:34:29 +00:00
chunk provider logic unification
This commit is contained in:
8 files changed
+117
-217
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package com.falsepattern.endlessids.mixin.helpers;
|
||||
|
||||
import gnu.trove.function.TIntFunction;
|
||||
import lombok.val;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
import static com.falsepattern.endlessids.EndlessIDs.BIOME_ARRAY_PLACEHOLDER;
|
||||
|
||||
public class BiomePatchHelper {
|
||||
public static byte[] getBiomeArrayTweaked(Chunk chunk, IntFunction<BiomeGenBase> biomesForGeneration) {
|
||||
val chunkBiomes = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
|
||||
for(int i = 0; i < chunkBiomes.length; ++i) {
|
||||
chunkBiomes[i] = (short) biomesForGeneration.apply(i).biomeID;
|
||||
}
|
||||
return BIOME_ARRAY_PLACEHOLDER;
|
||||
}
|
||||
|
||||
public static byte[] getBiomeArrayTweaked(Chunk chunk, BiomeGenBase[] biomesForGeneration) {
|
||||
val chunkBiomes = ((IChunkMixin)chunk).getBiomeShortArray();
|
||||
|
||||
for(int i = 0; i < chunkBiomes.length; ++i) {
|
||||
chunkBiomes[i] = (short) biomesForGeneration[i].biomeID;
|
||||
}
|
||||
return BIOME_ARRAY_PLACEHOLDER;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user