-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReplaceBiomes.groovy
More file actions
29 lines (25 loc) · 936 Bytes
/
ReplaceBiomes.groovy
File metadata and controls
29 lines (25 loc) · 936 Bytes
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
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 biomesFrom) {
biomePalette.set(i, StringTag.valueOf(biomeTo))
}
}
}
}
/** !! CODE ABOVE !! **/
/** Usually, you don't need to edit anything here. **/
/**
* Replaces all biomes in `biomesFrom` with `biomeTo`.
*
* @type Change NBT (Ctrl + N)
* @version 1.18+
*/
@Field List<String> biomesFrom = ["minecraft:forest", "minecraft:birch_forest"]
@Field String biomeTo = "minecraft:plains"