mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 09:15:10 +01:00
Port to 1.21-pre4
This commit is contained in:
@@ -25,7 +25,7 @@ public class MixinOptionsScreen extends Screen {
|
|||||||
@Shadow @Final private ThreePartsLayoutWidget layout;
|
@Shadow @Final private ThreePartsLayoutWidget layout;
|
||||||
@Unique TextIconButtonWidget button = TextIconButtonWidget.builder(Text.translatable("midnightlib.overview.title"), (
|
@Unique TextIconButtonWidget button = TextIconButtonWidget.builder(Text.translatable("midnightlib.overview.title"), (
|
||||||
buttonWidget) -> Objects.requireNonNull(client).setScreen(new MidnightConfigOverviewScreen(this)), true)
|
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"));
|
@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);}
|
protected MixinOptionsScreen(Text title) {super(title);}
|
||||||
|
|||||||
@@ -287,7 +287,10 @@ public abstract class MidnightConfig {
|
|||||||
super.init();
|
super.init();
|
||||||
tabNavigation.setWidth(this.width);
|
tabNavigation.setWidth(this.width);
|
||||||
tabNavigation.init();
|
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 -> {
|
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.CANCEL, button -> {
|
||||||
loadValues();
|
loadValues();
|
||||||
@@ -320,7 +323,7 @@ public abstract class MidnightConfig {
|
|||||||
info.index = 0;
|
info.index = 0;
|
||||||
list.clear();
|
list.clear();
|
||||||
fillList();
|
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);
|
resetButton.setPosition(width - 205, 0);
|
||||||
|
|
||||||
if (info.widget instanceof Map.Entry) {
|
if (info.widget instanceof Map.Entry) {
|
||||||
@@ -386,12 +389,11 @@ public abstract class MidnightConfig {
|
|||||||
|
|
||||||
if (tabs.size() < 2)
|
if (tabs.size() < 2)
|
||||||
context.drawCenteredTextWithShadow(textRenderer, title, width / 2, 10, 0xFFFFFF);
|
context.drawCenteredTextWithShadow(textRenderer, title, width / 2, 10, 0xFFFFFF);
|
||||||
list.renderHeaderSeperator = tabs.size() < 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public static class MidnightConfigListWidget extends ElementListWidget<ButtonEntry> {
|
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) {
|
public MidnightConfigListWidget(MinecraftClient client, int width, int height, int y, int itemHeight) {
|
||||||
super(client, width, height, y, itemHeight);
|
super(client, width, height, y, itemHeight);
|
||||||
}
|
}
|
||||||
@@ -400,7 +402,7 @@ public abstract class MidnightConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawHeaderAndFooterSeparators(DrawContext context) {
|
protected void drawHeaderAndFooterSeparators(DrawContext context) {
|
||||||
if (renderHeaderSeperator) super.drawHeaderAndFooterSeparators(context);
|
if (renderHeaderSeparator) super.drawHeaderAndFooterSeparators(context);
|
||||||
else {
|
else {
|
||||||
RenderSystem.enableBlend();
|
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);
|
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);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ components.java {
|
|||||||
|
|
||||||
unifiedPublishing {
|
unifiedPublishing {
|
||||||
project {
|
project {
|
||||||
displayName = "MidnightLib v$project.version - Fabric $project.minecraft_version"
|
displayName = "MidnightLib $project.version - Fabric $project.minecraft_version"
|
||||||
releaseType = "$project.release_type"
|
releaseType = "$project.release_type"
|
||||||
changelog = releaseChangelog()
|
changelog = releaseChangelog()
|
||||||
gameVersions = []
|
gameVersions = []
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
org.gradle.jvmargs=-Xmx4096M
|
org.gradle.jvmargs=-Xmx4096M
|
||||||
|
|
||||||
minecraft_version=1.20.6
|
minecraft_version=1.21-pre4
|
||||||
yarn_mappings=1.20.6+build.1
|
yarn_mappings=1.21-pre4+build.3
|
||||||
enabled_platforms=fabric,neoforge
|
enabled_platforms=fabric
|
||||||
|
|
||||||
archives_base_name=midnightlib
|
archives_base_name=midnightlib
|
||||||
mod_version=1.5.5
|
mod_version=1.5.6
|
||||||
maven_group=eu.midnightdust
|
maven_group=eu.midnightdust
|
||||||
release_type=release
|
release_type=release
|
||||||
curseforge_id=488090
|
curseforge_id=488090
|
||||||
modrinth_id=codAaoxh
|
modrinth_id=codAaoxh
|
||||||
|
|
||||||
fabric_loader_version=0.15.11
|
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
|
neoforge_version=20.6.63-beta
|
||||||
yarn_mappings_patch_neoforge_version = 1.20.5+build.3
|
yarn_mappings_patch_neoforge_version = 1.20.5+build.3
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ components.java {
|
|||||||
|
|
||||||
unifiedPublishing {
|
unifiedPublishing {
|
||||||
project {
|
project {
|
||||||
displayName = "MidnightLib v$project.version - NeoForge $project.minecraft_version"
|
displayName = "MidnightLib $project.version - NeoForge $project.minecraft_version"
|
||||||
releaseType = "$project.release_type"
|
releaseType = "$project.release_type"
|
||||||
changelog = releaseChangelog()
|
changelog = releaseChangelog()
|
||||||
gameVersions = []
|
gameVersions = []
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ include("common")
|
|||||||
include("fabric-like")
|
include("fabric-like")
|
||||||
include("fabric")
|
include("fabric")
|
||||||
//include("quilt")
|
//include("quilt")
|
||||||
include("neoforge")
|
//include("neoforge")
|
||||||
|
|
||||||
rootProject.name = "midnightlib"
|
rootProject.name = "midnightlib"
|
||||||
|
|||||||
Reference in New Issue
Block a user