-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReplaceBiomePairs.groovy
More file actions
32 lines (28 loc) · 1.03 KB
/
ReplaceBiomePairs.groovy
File metadata and controls
32 lines (28 loc) · 1.03 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
import groovy.transform.Field
import net.querz.mcaselector.io.mca.ChunkData
import net.querz.nbt.CompoundTag
import net.querz.nbt.StringTag
void apply(ChunkData data) {
for (section in data.region?.data?.getListTag("sections") as List<CompoundTag>) {
var biomePalette = section.getCompoundTag("biomes")?.getListTag("palette")
if (!biomePalette) continue
biomePalette.copy().eachWithIndex { StringTag biome, int i ->
if (biome.value in biomePairs) {
biomePalette.set(i, StringTag.valueOf(biomePairs[biome.value]))
}
}
}
}
/** !! CODE ABOVE !! **/
/** Usually, you don't need to edit anything here. **/
/**
* Replaces the original biome in each biome pair with its respective destination biome.
*
* @type Change NBT (Ctrl + N)
* @version 1.18+
*/
@Field Map<String, String> biomePairs = [
//"minecraft:biome_from": "minecraft:biome_to",
"minecraft:plains": "minecraft:dark_forest",
"minecraft:ocean" : "minecraft:river"
]