Skip to content

Commit

Permalink
fix pale garden in 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsjo committed Dec 3, 2024
1 parent 740378e commit 954631d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/BuildIn/MultiNoiseBiomeParameterList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
Most content of this file is Copyright (c) Mojang. This file is not covered by the Licence in LICENSE.txt !
*/

import { versionMetadata } from "../util"

export function getPreset(key: string, mc_version: string){
if (key === "minecraft:nether"){
return NETHER_PRESET
} else if (key === "minecraft:overworld" && mc_version === "1_19") {
return OVERWORLD_PRESET(() => "minecraft:meadow")
} else if (key === "minecraft:overworld" || key === "minecraft:overworld_update_1_20") {
return OVERWORLD_PRESET(() => "minecraft:cherry_grove")
} else if (key === "minecraft:overworld_winter_drop") {
return OVERWORLD_PRESET(() => "minecraft:cherry_grove", () => "minecraft:pale_garden")
} else if (key.startsWith("minecraft:overworld")) {
const cherry_grove = key === "minecraft:overworld_update_1_20" ? "minecraft:cherry_grove" : versionMetadata[mc_version].biomes.cherry_grove
const pale_garden = key === "minecraft:overworld_winter_drop" ? "minecraft:pale_garden" : versionMetadata[mc_version].biomes.pale_garden
return OVERWORLD_PRESET(() => cherry_grove, () => pale_garden)
} else {
return []
}
Expand Down Expand Up @@ -79,7 +79,7 @@ const NETHER_PRESET = [
}
]

function OVERWORLD_PRESET(cherry_grove: () => string, pale_garden: () => string = () => "minecraft:dark_forest"){
function OVERWORLD_PRESET(cherry_grove: () => string, pale_garden: () => string){
return [
{
"parameters": {
Expand Down
36 changes: 36 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ type Metadata = {
resourceLocations: {
structure: ResourceLocation
},
biomes: {
cherry_grove: string,
pale_garden: string
}
experimentalDatapacks: {
url: string,
translation_key: string
Expand All @@ -134,6 +138,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.LEGACY_STRUCTURE
},
biomes: {
cherry_grove: "minecraft:meadow",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.LEGACY_ZERO_BIASED,
dimensionPaddingEnabled: false
},
Expand All @@ -145,6 +153,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.LEGACY_STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.LEGACY_ZERO_BIASED,
dimensionPaddingEnabled: false
},
Expand All @@ -156,6 +168,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.LEGACY_STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.LEGACY_ZERO_BIASED,
dimensionPaddingEnabled: false
},
Expand All @@ -172,6 +188,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.LEGACY_STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.LEGACY_ZERO_BIASED,
dimensionPaddingEnabled: false
},
Expand All @@ -188,6 +208,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.LEGACY_STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.LEGACY_ZERO_BIASED,
dimensionPaddingEnabled: false
},
Expand All @@ -199,6 +223,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.LEGACY_ZERO_BIASED,
dimensionPaddingEnabled: false
},
Expand All @@ -215,6 +243,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:dark_forest"
},
spawnAlgorithm: SpawnTarget.Algorithm.BEST_CLIMATE,
dimensionPaddingEnabled: false
},
Expand All @@ -226,6 +258,10 @@ export const versionMetadata: { [version: string]: Metadata } = {
resourceLocations: {
structure: ResourceLocation.STRUCTURE
},
biomes: {
cherry_grove: "minecraft:cherry_grove",
pale_garden: "minecraft:pale_garden"
},
spawnAlgorithm: SpawnTarget.Algorithm.BEST_CLIMATE,
dimensionPaddingEnabled: true
},
Expand Down

0 comments on commit 954631d

Please sign in to comment.