Skip to content

Commit

Permalink
Void Worldgen with Structures
Browse files Browse the repository at this point in the history
- new worldgen type which generates all structures
  • Loading branch information
BPR02 committed Oct 1, 2024
1 parent 16a03d2 commit e5a90e2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
Binary file not shown.
2 changes: 2 additions & 0 deletions src/packs/worldgen/skyvoid_worldgen_structures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Sky Void Worldgen with Structures
The `skyvoid_worldgen_structures` data pack generates an infinite void world with properties akin to the original SkyBlock. No blocks will generate except for structures. For more information, visit the [wiki](https://github.com/BluePsychoRanger/SkyBlock_Collection/wiki).
13 changes: 13 additions & 0 deletions src/packs/worldgen/skyvoid_worldgen_structures/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id: 'skyvoid_worldgen_structures'
name: 'Sky Void with Structures'
author: 'BluePsychoRanger'
version: 1.0.0

require:
- src.plugins.worldgen.generate.base

data_pack:
load: .

pipeline:
- src.plugins.worldgen.get_empty_biomes.structures
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions src/plugins/worldgen/get_empty_biomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ def empty(ctx: Context):
def normal_end(ctx: Context):
gen(ctx, "normal_end", ["end"])

def structures(ctx: Context):
gen(ctx, "structures", remove_structures=False)



def gen(ctx: Context, cache_loc:str, ignored_dimensions: list[str] = [], full_removal: bool = False):
def gen(ctx: Context, cache_loc:str, ignored_dimensions: list[str] = [], full_removal: bool = False, remove_structures: bool = True):
clear_overworld = "overworld" not in ignored_dimensions
clear_nether = "nether" not in ignored_dimensions
clear_end = "end" not in ignored_dimensions
Expand All @@ -53,6 +54,14 @@ def gen(ctx: Context, cache_loc:str, ignored_dimensions: list[str] = [], full_re

# generate block tag of all blocks except jigsaw
final_purge: list[str] = requests.get(f"https://raw.githubusercontent.com/misode/mcmeta/{VERSION}-registries/block/data.min.json").json() #type: ignore
if not remove_structures:
initial_purge = final_purge.copy() #type: ignore
if "water" in initial_purge: initial_purge.remove("water") #type: ignore
if "minecraft:water" in initial_purge: initial_purge.remove("minecraft:water") #type: ignore
if "lava" in initial_purge: initial_purge.remove("lava") #type: ignore
if "minecraft:lava" in initial_purge: initial_purge.remove("minecraft:lava") #type: ignore
draft.data[f"{NAME}:initial_purge"] = BlockTag({"values": initial_purge})

if "jigsaw" in final_purge: final_purge.remove("jigsaw") #type: ignore
if "minecraft:jigsaw" in final_purge: final_purge.remove("minecraft:jigsaw") #type: ignore
draft.data[f"{NAME}:final_purge"] = BlockTag({"values": final_purge})
Expand All @@ -71,11 +80,11 @@ def gen(ctx: Context, cache_loc:str, ignored_dimensions: list[str] = [], full_re
# clear features
if name in NETHER_BIOMES:
if clear_nether:
data["features"] = [[], [], [], [], [], [], [], geode_purge(draft, 0, 256, "initial"),
data["features"] = [[], [], [] if remove_structures else geode_purge(draft, 0, 256, "initial"), [], [], [], [], geode_purge(draft, 0, 256, "initial") if remove_structures else [],
[], [], [], geode_purge(draft, 0, 256, "final")]
elif name in END_BIOMES:
if clear_end:
data["features"] = [[], [], [], [], [], [], [], geode_purge(draft, 0, 256, "initial"),
data["features"] = [[], [], [], [], [], [], [], geode_purge(draft, 0, 256, "initial") if remove_structures else [],
[], [], [], geode_purge(draft, 0, 256, "final")]
if (name == "the_end"):
data["features"].append(["skyvoid_worldgen:end_fix"])
Expand All @@ -89,7 +98,7 @@ def gen(ctx: Context, cache_loc:str, ignored_dimensions: list[str] = [], full_re
for feature in step_9:
if "minecraft:flower" in feature:
flowers.append(feature)
data["features"] = [[], [], [], [], [], [], [], geode_purge(draft, -64, 320, "initial"),
data["features"] = [[], [], [] if remove_structures else geode_purge(draft, -64, 320, "initial"), [], [], [], [], geode_purge(draft, -64, 320, "initial") if remove_structures else [],
[], [], [], flowers, geode_purge(draft, -64, 320, "final")]

draft.data[f"minecraft:{name}"] = WorldgenBiome(data)
Expand Down

0 comments on commit e5a90e2

Please sign in to comment.