Skip to content

Commit

Permalink
Add Custom Sky generator for Sky Aesthetics (#667)
Browse files Browse the repository at this point in the history
* Added Custom Sky generator

* Added 1.21.1 support

* fix config

* revert config change

* Fix assets config not working

* update url

* Fix merge conflict

---------

Co-authored-by: Misode <misoloo64@gmail.com>
  • Loading branch information
TathanDev and misode authored Dec 27, 2024
1 parent 09a2d4c commit 2bca1f1
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 68 deletions.
126 changes: 63 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"license": "MIT",
"dependencies": {
"@giscus/react": "^2.2.3",
"@spyglassmc/core": "^0.4.16",
"@spyglassmc/java-edition": "^0.3.22",
"@spyglassmc/json": "^0.3.19",
"@spyglassmc/core": "^0.4.17",
"@spyglassmc/java-edition": "^0.3.23",
"@spyglassmc/json": "^0.3.20",
"@spyglassmc/locales": "^0.3.10",
"@spyglassmc/mcdoc": "^0.3.20",
"@spyglassmc/nbt": "^0.3.20",
"@spyglassmc/mcdoc": "^0.3.21",
"@spyglassmc/nbt": "^0.3.21",
"@zip.js/zip.js": "^2.4.5",
"brace": "^0.11.1",
"buffer": "^6.0.3",
Expand Down
106 changes: 106 additions & 0 deletions public/mcdoc/sky_aesthetics.mcdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

dispatch minecraft:resource[sky_aesthetics:sky] to struct SkyProperties {
world: #[id="dimension"] string,
id?: string,
cloud_settings: CloudSettings,
fog_settings?: FogSettings,
rain: boolean,
custom_vanilla_objects: CustomVanillaObjects,
stars: Star,
/// The R, G and B value for the color
sunrise_color?: [float] @ 3,
sunrise_alpha_modifier?: float,
sky_type: SkyType,
sky_color: struct {
custom_color: boolean,

/// The R, G, B and alpha value for the color
#[until="1.21.2"]
color: [float] @ 4,
/// The R, G and B value for the color
#[since="1.21.3"]
color: [float] @ 3 ,

},
sky_objects: [SkyObject],
constellations: [string],
condition: RenderCondition

}

struct CloudSettings {
cloud: boolean,
cloud_height: int,
/// The R, G and B value for the color
cloud_color?: struct CustomCloudColor {
base_color: [double] @ 3,
storm_color: [double] @ 3,
rain_color: [double] @ 3,
always_base_color: boolean
}
}

struct FogSettings {
fog: boolean,
/// The R, G, B and alpha value for the color
fog_color: [float] @ 4,
fog_density: [float] @ 2,
}

struct CustomVanillaObjects {
sun: boolean,
sun_texture: string,
sun_height: int,
sun_size: int,
moon: boolean,
moon_phase: boolean,
moon_texture: string,
moon_height: int,
moon_size: int,
}

struct Star {
vanilla: boolean,
moving_stars: boolean,
count: int,
all_days_visible: boolean,
scale: float,
/// The R, G and B value for the color
color: [float] @ 3,
shooting_stars? : struct shootingStars {
percentage: int,
random_lifetime: [double] @ 2,
scale: float,
speed: float,
color: [double] @ 3,
rotation?: int
}
}

struct SkyObject {
texture: string,
blend: boolean,
size: float,
height: int,
rotation: [float] @ 3,
rotation_type: RotationType
}

struct RenderCondition {
condition: boolean,
biome?: #[id="worldgen/biome"] string,
biomes?: #[id(registry="worldgen/biome",tags=allowed)] string,

}

enum(string) SkyType {
#[starred] Overworld = "OVERWORLD",
None = "NONE",
End = "END"
}

enum(string) RotationType {
Day = "DAY",
Night = "NIGHT",
Fixed = "FIXED"
}
1 change: 1 addition & 0 deletions src/app/services/Spyglass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export class SpyglassService {
...Object.fromEntries(siteConfig.generators.filter(gen => gen.dependency).map(gen =>
[gen.path ?? gen.id, {
category: gen.id,
pack: gen.tags?.includes('assets') ? 'assets' : 'data',
}]
)),
},
Expand Down
9 changes: 9 additions & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,15 @@
"dependency": "ohthetreesyoullgrow",
"minVersion": "1.20",
"wiki": "https://github.com/CorgiTaco/Oh-The-Trees-Youll-Grow/wiki/Generating-Your-Tree-With-Data-Packs!"
},
{
"id": "sky_aesthetics:sky",
"url": "sky-aesthetics/sky",
"path": "sky",
"tags": ["partners", "assets"],
"dependency": "sky_aesthetics",
"minVersion": "1.21.1",
"wiki": "https://github.com/TathanDev/SkyAesthetics/wiki/Custom-Sky"
}
],
"legacyGuides": [
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"generator.neoforge:structure_modifier": "Structure Modifier",
"generator.not_found": "Cannot find generator \"%0%\"",
"generator.ohthetreesyoullgrow:configured_feature": "OTTYG Feature",
"generator.sky_aesthetics:sky": "Custom Sky",
"generator.pack_mcmeta": "pack.mcmeta",
"generator.painting_variant": "Painting Variant",
"generator.post_effect": "Post Effect",
Expand Down Expand Up @@ -187,6 +188,7 @@
"partner.neoforge": "NeoForge",
"partner.obsidian": "Obsidian",
"partner.ohthetreesyoullgrow": "Oh The Trees You'll Grow",
"partner.sky_aesthetics": "Sky Aesthetics",
"presets": "Presets",
"preview": "Visualize",
"preview.auto_scroll": "Auto scroll",
Expand Down

0 comments on commit 2bca1f1

Please sign in to comment.