Skip to content

Commit 08894c4

Browse files
committed
v1.3
1 parent 7206d28 commit 08894c4

File tree

12 files changed

+67
-19
lines changed

12 files changed

+67
-19
lines changed

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ java {
6767
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
6868
}
6969

70-
archivesBaseName = project.archives_base_name
7170
withSourcesJar()
7271
sourceCompatibility = javaVersion
7372
targetCompatibility = javaVersion

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ org.gradle.parallel=true
55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
77
minecraft_version=1.21.5
8-
loader_version=0.16.14
8+
loader_version=0.17.1
99
loom_version=1.11-SNAPSHOT
1010

1111
# Dependencies
1212
fabric_version=0.128.1+1.21.5
1313
modmenu_version=14.0.0-rc.2
1414

1515
# Mod Properties
16-
mod_version=1.2
16+
mod_version=1.3
1717
maven_group=btw.lowercase
1818
archives_base_name=optiboxes

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pluginManagement {
22
repositories {
33
maven {
4-
name = 'Fabric'
5-
url = 'https://maven.fabricmc.net/'
4+
name = "Fabric"
5+
url = "https://maven.fabricmc.net/"
66
}
77
gradlePluginPortal()
88
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package btw.lowercase.lightconfig.lib.v1.screen;
2+
3+
import btw.lowercase.lightconfig.lib.v1.Config;
4+
import btw.lowercase.optiboxes.config.OptiBoxesConfig;
5+
import btw.lowercase.optiboxes.config.OptiBoxesConfigScreen;
6+
import net.minecraft.client.gui.screens.Screen;
7+
import net.minecraft.network.chat.Component;
8+
import org.jetbrains.annotations.Nullable;
9+
10+
public class ConfigScreenBuilder {
11+
private final Config config;
12+
private Component title = Component.empty();
13+
14+
private ConfigScreenBuilder(Config config) {
15+
this.config = config;
16+
}
17+
18+
public static ConfigScreenBuilder builder(Config config) {
19+
return new ConfigScreenBuilder(config);
20+
}
21+
22+
// TODO
23+
24+
public ConfigScreenBuilder setTitle(Component title) {
25+
this.title = title;
26+
return this;
27+
}
28+
29+
public Screen build(@Nullable Screen parent) {
30+
return new OptiBoxesConfigScreen(parent, this.title, (OptiBoxesConfig) this.config);
31+
// TODO : return new ConfigScreen(this.title, this.config, parent);
32+
}
33+
}

src/main/java/btw/lowercase/optiboxes/OptiBoxesClient.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ private void parseSkyboxes(SkyboxResourceHelper skyboxResourceHelper, String sky
139139
}
140140

141141
final JsonObject json = CommonUtils.convertOptiFineSkyProperties(skyboxResourceHelper, properties, id);
142-
switch (world) {
143-
case "world0" -> overworldLayers.add(json);
144-
case "world1" -> endLayers.add(json);
142+
if (json != null) { // NOTE: Don't add broken skies (returns null if broken)
143+
switch (world) {
144+
case "world0" -> overworldLayers.add(json);
145+
case "world1" -> endLayers.add(json);
146+
}
145147
}
146148
}
147149
});

src/main/java/btw/lowercase/optiboxes/config/ModMenuIntegration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
public class ModMenuIntegration implements ModMenuApi {
88
@Override
99
public ConfigScreenFactory<?> getModConfigScreenFactory() {
10-
return (parent) -> OptiBoxesClient.getConfig().getConfigScreen(parent);
10+
return OptiBoxesClient.getConfig()::getConfigScreen;
1111
}
1212
}

src/main/java/btw/lowercase/optiboxes/config/OptiBoxesConfig.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import btw.lowercase.lightconfig.lib.v1.Config;
44
import btw.lowercase.lightconfig.lib.v1.field.BooleanConfigField;
5+
import btw.lowercase.lightconfig.lib.v1.screen.ConfigScreenBuilder;
56
import btw.lowercase.optiboxes.OptiBoxesClient;
67
import net.minecraft.client.gui.screens.Screen;
8+
import net.minecraft.network.chat.Component;
79

810
import java.nio.file.Path;
911

@@ -14,13 +16,17 @@ public class OptiBoxesConfig extends Config {
1416
public final BooleanConfigField renderSunMoon = this.booleanFieldOf("renderSunMoon", true);
1517
public final BooleanConfigField renderStars = this.booleanFieldOf("renderStars", true);
1618
public final BooleanConfigField showOverworldForUnknownDimension = this.booleanFieldOf("showOverworldForUnknownDimension", true);
19+
public final BooleanConfigField ignoreBrokenSkies = this.booleanFieldOf("ignoreBrokenSkies", false);
1720

1821
public OptiBoxesConfig(Path path) {
1922
super(OptiBoxesClient.INSTANCE.getModContainer(), path);
2023
}
2124

2225
@Override
2326
public Screen getConfigScreen(Screen parent) {
24-
return new OptiBoxesConfigScreen(parent, this);
27+
ConfigScreenBuilder builder = ConfigScreenBuilder.builder(this)
28+
.setTitle(Component.translatable("options.optiboxes.title"));
29+
// TODO: Add config stuff
30+
return builder.build(parent);
2531
}
2632
}

src/main/java/btw/lowercase/optiboxes/config/OptiBoxesConfigScreen.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
import net.minecraft.network.chat.Component;
1414

1515
public class OptiBoxesConfigScreen extends Screen {
16-
public static final Component TITLE = Component.translatable("options.optiboxes.title");
17-
1816
private final Screen parent;
1917
private final OptiBoxesConfig config;
2018

21-
public OptiBoxesConfigScreen(Screen parent, OptiBoxesConfig config) {
22-
super(TITLE);
19+
public OptiBoxesConfigScreen(Screen parent, Component title, OptiBoxesConfig config) {
20+
super(title);
2321
this.parent = parent;
2422
this.config = config;
2523
}
@@ -30,7 +28,7 @@ protected void init() {
3028

3129
HeaderAndFooterLayout layout = new HeaderAndFooterLayout(this, 61, 33);
3230
LinearLayout linearLayout = layout.addToHeader(LinearLayout.vertical().spacing(8));
33-
linearLayout.addChild(new StringWidget(TITLE, this.font), LayoutSettings::alignHorizontallyCenter);
31+
linearLayout.addChild(new StringWidget(this.getTitle(), this.font), LayoutSettings::alignHorizontallyCenter);
3432

3533
GridLayout gridLayout = new GridLayout();
3634
gridLayout.defaultCellSetting().paddingHorizontal(4).paddingBottom(4).alignHorizontallyCenter().alignVerticallyMiddle();
@@ -42,6 +40,7 @@ protected void init() {
4240
rowHelper.addChild(config.processMCPatcher.createWidget(() -> this.minecraft.reloadResourcePacks()));
4341
rowHelper.addChild(config.renderSunMoon.createWidget());
4442
rowHelper.addChild(config.renderStars.createWidget());
43+
rowHelper.addChild(config.ignoreBrokenSkies.createWidget(() -> this.minecraft.reloadResourcePacks()));
4544
layout.addToContents(gridLayout);
4645

4746
GridLayout footerGridLayout = new GridLayout();

0 commit comments

Comments
 (0)