-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstructure.h
117 lines (94 loc) · 4.17 KB
/
structure.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//
// Created by xhy on 2021/8/3.
//
#pragma once
#ifndef BSSTRUCTURRE_STRUCTURE_H
#define BSSTRUCTURRE_STRUCTURE_H
#endif // BSSTRUCTURRE_STRUCTURE_H
#include "generator.h"
#include "layers.h"
#include "tools.h"
enum BEStructureType {
BEVillage,
BEStronghold,
BEMineshaft,
BEDesertTemple,
BEWitchHut,
BEJungleTemple,
BEIgloo,
BEOceanMonument,
BEOceanRuin,
BEWoodlandMansion,
BEShipwreck,
BERuindPortal,
BEBuriedTreasure,
BEPillagerOutpost,
BENetherFortress,
BEBastion,
BEEndcity
};
int check_nether_fortress_1_14(uint32_t worldseed, ChunkPos pos);
struct BEStructureConfig {
int spacing;
int spawnRange;
int salt;
int num;
};
#define DEF_STRUCTURE(Name, spacing, spawnRange, salt) \
constexpr BEStructureConfig Name = {spacing, spawnRange, salt};
constexpr BEStructureConfig BE_RANDOM_SCATTERED = {
32, 24, 14357617, 2}; //女巫房子,丛林,沙漠神殿
constexpr BEStructureConfig BE_BURIED_TREASURE = {4, 2, 16842397, 4}; //海底宝藏
constexpr BEStructureConfig BE_PILLAGER_OUTPOST = {80, 56, 165745296, 4}; //哨塔
constexpr BEStructureConfig BE_VILLAGE = {27, 17, 10387312, 4}; //村庄
constexpr BEStructureConfig BE_WOODLAND_MANSION = {80, 60, 10387319,
4}; //林地府邸
constexpr BEStructureConfig BE_END_CITY = {20, 9, 10387313, 4}; //末地城市
constexpr BEStructureConfig BE_OCEAN_MONUMENT = {32, 27, 10387313,
4}; //海底神殿
constexpr BEStructureConfig BE_NETHER_STRUCTURE = {30, 26, 430084232, 4};
constexpr BEStructureConfig BE_SHIP_WREAK = {10, 5, 1, 4};
constexpr BEStructureConfig BE_OCEAN_RUIN = {12, 5, 14357621, 4};
constexpr BEStructureConfig BE_RUIN_PORTAL_NETHER = {25, 15, 40552231, 4};
constexpr BEStructureConfig BE_RUIN_PORTAL_OVERWORLD = {40, 25, 40552231, 4};
constexpr BEStructureConfig BE_INVALID = {1, 1, 0, 1};
void biome_test(uint32_t seed, int l, const char *path, int width);
constexpr uint16_t BSZ = sizeof(enum BiomeID);
constexpr enum BiomeID WORLD_SPAWN_FILTER[] = {
forest, plains, taiga_hills, forestHills, jungle_hills, jungle};
constexpr enum BiomeID VILLAGE_FILTER[] = {
plains, savanna, icePlains, taiga,
taiga_hills, coldTaiga, coldTaigaHills, desert};
constexpr enum BiomeID OCEAN_MONUMENT_FILTER[] = {ocean,
deep_ocean,
lukewarm_ocean,
cold_ocean,
frozen_ocean,
warm_ocean,
deep_lukewarm_ocean,
deep_warm_ocean,
deep_frozen_ocean,
deep_cold_ocean,
river,
frozen_river};
constexpr enum BiomeID OCEAN_MONUMENT_SPAWN_FILTER[] = {
deep_ocean, deep_cold_ocean, deep_warm_ocean, deep_frozen_ocean,
deep_lukewarm_ocean};
constexpr enum BiomeID DESERT_TEMPLE_FILTER[] = {desert, desert_hills,
desert_lakes};
constexpr enum BiomeID JUNGLE_TEMPLE_FILTER[] = {jungle, jungle_hills};
constexpr enum BiomeID WITCH_HUT_FILTER[] = {swamp, swampland};
constexpr enum BiomeID IGLOO_FILTER[] = {icePlains, coldTaiga};
// NOT
constexpr enum BiomeID BURIED_TREASURE_FILTER[] = {
beach, coldBeach, stone_shore, mushroom_field_shore};
constexpr enum BiomeID WOODLAND_MANSION_FILTER[] = {roofedForest};
constexpr enum BiomeID PILLAGER_OUTPOST_FILTER[] = {
plains, sunflower_plains, savanna, icePlains, taiga_hills,
taiga, coldTaiga, coldTaigaHills, desert};
// extra check for structure
bool extra_feature_check(struct Generator *g, enum BEStructureType type,
ChunkPos pos);
// get the first 3 position of stronghold
ChunkPos *generate_stronghold_positions(uint32_t seed, struct Layer *layer);
ChunkPos get_world_spawn_position(uint32_t seed);