the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "..\Minecraft.World\JavaIntHash.h"
3
4class BiomeCache
5{
6private:
7 static const int DECAY_TIME = 1000 * 30;
8 static const int ZONE_SIZE_BITS = 4;
9 static const int ZONE_SIZE = 1 << ZONE_SIZE_BITS;
10 static const int ZONE_SIZE_MASK = ZONE_SIZE - 1;
11
12 const BiomeSource *source;
13 __int64 lastUpdateTime;
14
15public:
16 class Block
17 {
18 public:
19 // MGH - changed this to just cache biome indices, as we have direct access to the data if we know the index.
20// floatArray temps;
21// floatArray downfall;
22// BiomeArray biomes;
23 byteArray biomeIndices;
24 int x, z;
25 __int64 lastUse;
26
27 Block(int x, int z, BiomeCache *parent);
28 ~Block();
29 Biome *getBiome(int x, int z);
30 float getTemperature(int x, int z);
31 float getDownfall(int x, int z);
32 };
33
34private:
35 unordered_map<__int64,Block *,LongKeyHash,LongKeyEq> cached; // 4J - was LongHashMap
36 vector<Block *> all; // was ArrayList<Block>
37
38public:
39 BiomeCache(BiomeSource *source);
40 ~BiomeCache();
41
42 Block *getBlockAt(int x, int z);
43 Biome *getBiome(int x, int z);
44 float getTemperature(int x, int z);
45 float getDownfall(int x, int z);
46 void update();
47 BiomeArray getBiomeBlockAt(int x, int z);
48 byteArray getBiomeIndexBlockAt(int x, int z);
49
50private:
51 CRITICAL_SECTION m_CS;
52};