-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathRenderingChunkProvider.java
More file actions
83 lines (83 loc) · 2.89 KB
/
RenderingChunkProvider.java
File metadata and controls
83 lines (83 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//package dev.compactmods.crafting.client.fakeworld;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.function.BooleanSupplier;
//import java.util.stream.Collectors;
//import com.mojang.datafixers.util.Pair;
//import dev.compactmods.crafting.recipes.MiniaturizationRecipe;
//import net.minecraft.core.BlockPos;
//import net.minecraft.core.Holder;
//import net.minecraft.world.level.BlockGetter;
//import net.minecraft.world.level.ChunkPos;
//import net.minecraft.world.level.biome.Biome;
//import net.minecraft.world.level.biome.Biomes;
//import net.minecraft.world.level.chunk.ChunkAccess;
//import net.minecraft.world.level.chunk.ChunkSource;
//import net.minecraft.world.level.chunk.ChunkStatus;
//import net.minecraft.world.level.chunk.EmptyLevelChunk;
//import net.minecraft.world.level.lighting.LevelLightEngine;
//import net.minecraftforge.registries.ForgeRegistries;
//import org.jetbrains.annotations.Nullable;
//
//public class RenderingChunkProvider extends ChunkSource {
// private final Holder<Biome> VOID;
// private final MiniaturizationRecipe recipe;
//
// private final Map<ChunkPos, ChunkAccess> chunks;
// private final RenderingWorld renderingLevel;
// private final LevelLightEngine lightManager;
//
// public RenderingChunkProvider(RenderingWorld renderingLevel, MiniaturizationRecipe recipe) {
// VOID = ForgeRegistries.BIOMES.getHolder(Biomes.THE_VOID).get();
//
// this.recipe = recipe;
//
// this.renderingLevel = renderingLevel;
// this.lightManager = new LevelLightEngine(this, true, true);
//
// Map<ChunkPos, List<BlockPos>> byChunk = new HashMap<>();
// BlockPos.betweenClosedStream(this.recipe.getDimensions())
// .map(BlockPos::immutable)
// .forEach(pos -> {
// byChunk.computeIfAbsent(new ChunkPos(pos), $ -> new ArrayList<>()).add(pos);
// });
//
// chunks = byChunk.keySet().stream()
// .map(chunkPos -> Pair.of(chunkPos, new RecipeChunk(this.renderingLevel, chunkPos, recipe)))
// .collect(Collectors.toMap(Pair::getFirst, Pair::getSecond));
// }
//
// @Nullable
// @Override
// public ChunkAccess getChunk(int cx, int cz, ChunkStatus status, boolean load) {
// return chunks.computeIfAbsent(new ChunkPos(cx, cz), p -> new EmptyLevelChunk(renderingLevel, p, VOID));
// }
//
// @Override
// public void tick(BooleanSupplier bool, boolean bool2) {
//
// }
//
// @Override
// public String gatherStats() {
// return "?";
// }
//
// @Override
// public int getLoadedChunksCount() {
// return chunks.size();
// }
//
// @Override
// public LevelLightEngine getLightEngine() {
// return lightManager;
// }
//
// @Override
// public BlockGetter getLevel() {
// return renderingLevel;
// }
//}