Merge branch '1.19' into 1.19.3
# Conflicts: # gradle.properties # src/main/java/org/betterx/bclib/BCLib.java # src/main/java/org/betterx/bclib/api/v2/generator/BCLChunkGenerator.java # src/main/java/org/betterx/worlds/together/mixin/common/WorldPresetsBootstrapMixin.java # src/main/java/org/betterx/worlds/together/worldPreset/WorldPresets.java # src/main/resources/bclib.accesswidener
This commit is contained in:
commit
0dcb7809b8
41 changed files with 1586 additions and 75 deletions
|
@ -81,8 +81,47 @@ public class UpdatesScreen extends BCLibLayoutScreen {
|
|||
row.addText(fit(), fit(), Component.literal(" -> "));
|
||||
row.addText(fit(), fit(), Component.literal(updated)).setColor(ColorHelper.GREEN);
|
||||
row.addFiller();
|
||||
if (nfo != null && nfo.getMetadata().getContact().get("homepage").isPresent()) {
|
||||
row.addButton(fit(), fit(), Component.translatable("bclib.updates.curseforge_link"))
|
||||
boolean createdDownloadLink = false;
|
||||
if (nfo != null
|
||||
&& nfo.getMetadata().getCustomValue("bclib") != null
|
||||
&& nfo.getMetadata().getCustomValue("bclib").getAsObject().get("downloads") != null) {
|
||||
CustomValue.CvObject downloadLinks = nfo.getMetadata()
|
||||
.getCustomValue("bclib")
|
||||
.getAsObject()
|
||||
.get("downloads")
|
||||
.getAsObject();
|
||||
String link = null;
|
||||
Component name = null;
|
||||
if (Configs.CLIENT_CONFIG.preferModrinthForUpdates() && downloadLinks.get("modrinth") != null) {
|
||||
link = downloadLinks.get("modrinth").getAsString();
|
||||
name = Component.translatable("bclib.updates.modrinth_link");
|
||||
// row.addButton(fit(), fit(), Component.translatable("bclib.updates.modrinth_link"))
|
||||
// .onPress((bt) -> {
|
||||
// this.openLink(downloadLinks.get("modrinth").getAsString());
|
||||
// }).centerVertical();
|
||||
// createdDownloadLink = true;
|
||||
} else if (downloadLinks.get("curseforge") != null) {
|
||||
link = downloadLinks.get("curseforge").getAsString();
|
||||
name = Component.translatable("bclib.updates.curseforge_link");
|
||||
// row.addButton(fit(), fit(), Component.translatable("bclib.updates.curseforge_link"))
|
||||
// .onPress((bt) -> {
|
||||
// this.openLink(downloadLinks.get("curseforge").getAsString());
|
||||
// }).centerVertical();
|
||||
// createdDownloadLink = true;
|
||||
}
|
||||
|
||||
if (link != null) {
|
||||
createdDownloadLink = true;
|
||||
final String finalLink = link;
|
||||
row.addButton(fit(), fit(), name)
|
||||
.onPress((bt) -> {
|
||||
this.openLink(finalLink);
|
||||
}).centerVertical();
|
||||
}
|
||||
}
|
||||
|
||||
if (!createdDownloadLink && nfo != null && nfo.getMetadata().getContact().get("homepage").isPresent()) {
|
||||
row.addButton(fit(), fit(), Component.translatable("bclib.updates.download_link"))
|
||||
.onPress((bt) -> {
|
||||
this.openLink(nfo.getMetadata().getContact().get("homepage").get());
|
||||
}).centerVertical();
|
||||
|
|
|
@ -41,6 +41,8 @@ import org.jetbrains.annotations.Nullable;
|
|||
public class WorldSetupScreen extends LayoutScreen {
|
||||
private final WorldCreationContext context;
|
||||
private final CreateWorldScreen createWorldScreen;
|
||||
private Range<Integer> netherBiomeSize;
|
||||
private Range<Integer> netherVerticalBiomeSize;
|
||||
private Range<Integer> landBiomeSize;
|
||||
private Range<Integer> voidBiomeSize;
|
||||
private Range<Integer> centerBiomeSize;
|
||||
|
@ -60,6 +62,8 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
Checkbox endCustomTerrain;
|
||||
Checkbox generateEndVoid;
|
||||
Checkbox netherLegacy;
|
||||
Checkbox netherVertical;
|
||||
Checkbox netherAmplified;
|
||||
|
||||
public LayoutComponent<?, ?> netherPage(BCLNetherBiomeSourceConfig netherConfig) {
|
||||
VerticalStack content = new VerticalStack(fill(), fit()).centerHorizontal();
|
||||
|
@ -77,9 +81,51 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
netherConfig.mapVersion == BCLNetherBiomeSourceConfig.NetherBiomeMapType.SQUARE
|
||||
);
|
||||
|
||||
netherAmplified = content.indent(20).addCheckbox(
|
||||
fit(), fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_amplified"),
|
||||
netherConfig.amplified
|
||||
);
|
||||
|
||||
netherVertical = content.indent(20).addCheckbox(
|
||||
fit(), fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_vertical"),
|
||||
netherConfig.useVerticalBiomes
|
||||
);
|
||||
|
||||
content.addSpacer(12);
|
||||
content.addText(fit(), fit(), Component.translatable("title.screen.bclib.worldgen.avg_biome_size"))
|
||||
.centerHorizontal();
|
||||
content.addHorizontalSeparator(8).alignTop();
|
||||
|
||||
netherBiomeSize = content.addRange(
|
||||
fixed(200),
|
||||
fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_biome_size"),
|
||||
1,
|
||||
512,
|
||||
netherConfig.biomeSize / 16
|
||||
);
|
||||
|
||||
netherVerticalBiomeSize = content.addRange(
|
||||
fixed(200),
|
||||
fit(),
|
||||
Component.translatable("title.screen.bclib.worldgen.nether_vertical_biome_size"),
|
||||
1,
|
||||
32,
|
||||
netherConfig.biomeSizeVertical / 16
|
||||
);
|
||||
|
||||
bclibNether.onChange((cb, state) -> {
|
||||
netherLegacy.setEnabled(state);
|
||||
netherAmplified.setEnabled(state);
|
||||
netherVertical.setEnabled(state);
|
||||
netherBiomeSize.setEnabled(state);
|
||||
netherVerticalBiomeSize.setEnabled(state && netherVertical.isChecked());
|
||||
});
|
||||
|
||||
netherVertical.onChange((cb, state) -> {
|
||||
netherVerticalBiomeSize.setEnabled(state && bclibNether.isChecked());
|
||||
});
|
||||
|
||||
content.addSpacer(8);
|
||||
|
@ -198,6 +244,8 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
private void updateSettings() {
|
||||
Map<ResourceKey<LevelStem>, ChunkGenerator> betterxDimensions = TogetherWorldPreset.getDimensionsMap(
|
||||
PresetsRegistry.BCL_WORLD);
|
||||
Map<ResourceKey<LevelStem>, ChunkGenerator> betterxAmplifiedDimensions = TogetherWorldPreset.getDimensionsMap(
|
||||
PresetsRegistry.BCL_WORLD_AMPLIFIED);
|
||||
Map<ResourceKey<LevelStem>, ChunkGenerator> vanillaDimensions = TogetherWorldPreset.getDimensionsMap(
|
||||
WorldPresets.NORMAL);
|
||||
BCLEndBiomeSourceConfig.EndBiomeMapType endVersion = BCLEndBiomeSourceConfig.DEFAULT.mapVersion;
|
||||
|
@ -233,12 +281,17 @@ public class WorldSetupScreen extends LayoutScreen {
|
|||
netherLegacy.isChecked()
|
||||
? BCLNetherBiomeSourceConfig.NetherBiomeMapType.SQUARE
|
||||
: BCLNetherBiomeSourceConfig.NetherBiomeMapType.HEX,
|
||||
BCLNetherBiomeSourceConfig.DEFAULT.biomeSize,
|
||||
BCLNetherBiomeSourceConfig.DEFAULT.biomeSizeVertical,
|
||||
BCLNetherBiomeSourceConfig.DEFAULT.useVerticalBiomes
|
||||
netherBiomeSize.getValue() * 16,
|
||||
netherVerticalBiomeSize.getValue() * 16,
|
||||
netherVertical.isChecked(),
|
||||
netherAmplified.isChecked()
|
||||
);
|
||||
|
||||
ChunkGenerator netherGenerator = betterxDimensions.get(LevelStem.NETHER);
|
||||
ChunkGenerator netherGenerator = (
|
||||
netherAmplified.isChecked()
|
||||
? betterxAmplifiedDimensions
|
||||
: betterxDimensions
|
||||
).get(LevelStem.NETHER);
|
||||
((BCLibNetherBiomeSource) netherGenerator.getBiomeSource()).setTogetherConfig(netherConfig);
|
||||
|
||||
updateConfiguration(LevelStem.NETHER, BuiltinDimensionTypes.NETHER, netherGenerator);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue