Skip to content

Commit

Permalink
allow more zoom & custom dimension type
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsjo committed Jun 30, 2024
1 parent eac159c commit 803da1f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,15 @@
<div class="setting"> <label><span class="description">Dimension Name:</span><input type="text"
id="dimension_name" /></label></div>

<div class="setting"> <label><span class="description">Noise Settings Name:</span>
<div class="setting"> <label><span class="description">Noise Settings:</span>
<select id="noise_settings_name">
</select>
</label><span class="warning" id="missing_noise_setting" title="Select different noise_settings or load datapack containing these noise_settings">missing noise settings</span> </div>

<div class="setting"> <label><span class="description">Dimension Type:</span><input type="text"
id="dimension_type_name" /></label></div>


<div class="setting"> <label><span class="description">Enable Splines-Editor:</span>
<input type="checkbox" id="export_splines" />
</label></div>
Expand Down
2 changes: 1 addition & 1 deletion public/empty.snowcapped.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/minecraft_overworld_1_19.snowcapped.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/minecraft_overworld_1_20.snowcapped.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/main/BuilderData/BiomeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class BiomeBuilder {
targetVersion: string = '1_19'
datapackFormat: number = 15
noiseSettingsName: string = "minecraft:overworld"
dimensionTypeName: string = "minecraft:overworld"
exportSplines: boolean = true;
exportBiomeColors: boolean = true;

Expand Down Expand Up @@ -95,6 +96,7 @@ export class BiomeBuilder {
this.exportSplines = json.exportSplines
this.exportBiomeColors = json.exportBiomeColors ?? false
this.noiseSettingsName = json.noiseSettingsName
this.dimensionTypeName = json.dimensionTypeName ?? this.dimensionTypeName

this.dimension = Grid.fromJSON(this, json.dimension, new DimensionMultiNoiseIndexesAccessor(this))
this.modes = json.modes
Expand Down Expand Up @@ -149,6 +151,7 @@ export class BiomeBuilder {
exportSplines: this.exportSplines,
exportBiomeColors: this.exportBiomeColors,
noiseSettingsName: this.noiseSettingsName,
dimensionTypeName: this.dimensionTypeName,

splines: {
offset: this.splines.offset.toJSON(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/BuilderData/Exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class Exporter {


const dimension = {
type: "minecraft:overworld",
type: this.builder.dimensionTypeName,
generator: {
biome_source: {
biomes: biomes,
Expand Down
7 changes: 7 additions & 0 deletions src/main/UI/SettingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export class SettingsManager {
UI.getInstance().refresh({noises: true})
}

const dimensionTypeNameInput = document.getElementById("dimension_type_name") as HTMLInputElement;
dimensionTypeNameInput.value = this.builder.dimensionTypeName
dimensionTypeNameInput.onchange = (evt) => {
this.builder.hasChanges = true
this.builder.dimensionTypeName = dimensionTypeNameInput.value
UI.getInstance().refresh({noises: true})
}


const noiseSettingsNameSelect = d3.select("#noise_settings_name")
Expand Down
2 changes: 1 addition & 1 deletion src/main/UI/VisualizationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class VisualizationManger {

this.map = L.map('visualization_map')
this.map.setView([0, 0], 15)
this.map.setMaxZoom(16)
this.map.setMaxZoom(18)
this.map.setMinZoom(11)

this.biomeLayer = new BiomeLayer(this, { tileSize: 256 });
Expand Down

0 comments on commit 803da1f

Please sign in to comment.