Port to 1.21-pre4

This commit is contained in:
Martin Prokoph
2024-06-08 20:42:16 +02:00
parent aeeed9922a
commit f0c8895d74
6 changed files with 16 additions and 14 deletions

View File

@@ -25,7 +25,7 @@ public class MixinOptionsScreen extends Screen {
@Shadow @Final private ThreePartsLayoutWidget layout;
@Unique TextIconButtonWidget button = TextIconButtonWidget.builder(Text.translatable("midnightlib.overview.title"), (
buttonWidget) -> Objects.requireNonNull(client).setScreen(new MidnightConfigOverviewScreen(this)), true)
.texture(new Identifier("midnightlib","icon/midnightlib"), 16, 16).dimension(20, 20).build();
.texture(Identifier.of("midnightlib","icon/midnightlib"), 16, 16).dimension(20, 20).build();
@Unique boolean shouldShowButton = MidnightLibConfig.config_screen_list.equals(MidnightLibConfig.ConfigButton.TRUE) || (MidnightLibConfig.config_screen_list.equals(MidnightLibConfig.ConfigButton.MODMENU) && !PlatformFunctions.isModLoaded("modmenu"));
protected MixinOptionsScreen(Text title) {super(title);}

View File

@@ -287,7 +287,10 @@ public abstract class MidnightConfig {
super.init();
tabNavigation.setWidth(this.width);
tabNavigation.init();
if (tabs.size() > 1) this.addDrawableChild(tabNavigation);
if (tabs.size() > 1) {
this.addDrawableChild(tabNavigation);
list.renderHeaderSeparator = false;
}
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.CANCEL, button -> {
loadValues();
@@ -320,7 +323,7 @@ public abstract class MidnightConfig {
info.index = 0;
list.clear();
fillList();
}), true).texture(new Identifier("midnightlib","icon/reset"), 12, 12).dimension(40, 20).build();
}), true).texture(Identifier.of("midnightlib","icon/reset"), 12, 12).dimension(40, 20).build();
resetButton.setPosition(width - 205, 0);
if (info.widget instanceof Map.Entry) {
@@ -386,12 +389,11 @@ public abstract class MidnightConfig {
if (tabs.size() < 2)
context.drawCenteredTextWithShadow(textRenderer, title, width / 2, 10, 0xFFFFFF);
list.renderHeaderSeperator = tabs.size() < 2;
}
}
@Environment(EnvType.CLIENT)
public static class MidnightConfigListWidget extends ElementListWidget<ButtonEntry> {
boolean renderHeaderSeperator = true;
boolean renderHeaderSeparator = true;
public MidnightConfigListWidget(MinecraftClient client, int width, int height, int y, int itemHeight) {
super(client, width, height, y, itemHeight);
}
@@ -400,7 +402,7 @@ public abstract class MidnightConfig {
@Override
protected void drawHeaderAndFooterSeparators(DrawContext context) {
if (renderHeaderSeperator) super.drawHeaderAndFooterSeparators(context);
if (renderHeaderSeparator) super.drawHeaderAndFooterSeparators(context);
else {
RenderSystem.enableBlend();
context.drawTexture(this.client.world == null ? Screen.FOOTER_SEPARATOR_TEXTURE : Screen.INWORLD_FOOTER_SEPARATOR_TEXTURE, this.getX(), this.getBottom(), 0.0F, 0.0F, this.getWidth(), 2, 32, 2);

View File

@@ -66,7 +66,7 @@ components.java {
unifiedPublishing {
project {
displayName = "MidnightLib v$project.version - Fabric $project.minecraft_version"
displayName = "MidnightLib $project.version - Fabric $project.minecraft_version"
releaseType = "$project.release_type"
changelog = releaseChangelog()
gameVersions = []

View File

@@ -1,18 +1,18 @@
org.gradle.jvmargs=-Xmx4096M
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
enabled_platforms=fabric,neoforge
minecraft_version=1.21-pre4
yarn_mappings=1.21-pre4+build.3
enabled_platforms=fabric
archives_base_name=midnightlib
mod_version=1.5.5
mod_version=1.5.6
maven_group=eu.midnightdust
release_type=release
curseforge_id=488090
modrinth_id=codAaoxh
fabric_loader_version=0.15.11
fabric_api_version=0.97.8+1.20.6
fabric_api_version=0.100.0+1.21
neoforge_version=20.6.63-beta
yarn_mappings_patch_neoforge_version = 1.20.5+build.3

View File

@@ -75,7 +75,7 @@ components.java {
unifiedPublishing {
project {
displayName = "MidnightLib v$project.version - NeoForge $project.minecraft_version"
displayName = "MidnightLib $project.version - NeoForge $project.minecraft_version"
releaseType = "$project.release_type"
changelog = releaseChangelog()
gameVersions = []

View File

@@ -11,6 +11,6 @@ include("common")
include("fabric-like")
include("fabric")
//include("quilt")
include("neoforge")
//include("neoforge")
rootProject.name = "midnightlib"