Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* FastBack - Fast, incremental Minecraft backups powered by Git.
* Copyright (C) 2022 pcal.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/

package net.pcal.fastback.common.mixins;

import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.screens.Screen;
import org.jspecify.annotations.Nullable;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(Gui.class)
public interface GuiAccessors {
@Accessor("screen")
@Nullable Screen getScreen();

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
package net.pcal.fastback.common.mod;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.screens.GenericMessageScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.pcal.fastback.common.logging.UserMessage;
import net.pcal.fastback.common.mixins.ScreenAccessors;
import net.pcal.fastback.common.mixins.GuiAccessors;

import static net.pcal.fastback.common.logging.SystemLogger.syslog;
import static net.pcal.fastback.common.mod.UserMessageUtil.messageToText;
Expand Down Expand Up @@ -75,7 +77,8 @@ public void clearHudText() {

public void setMessageScreenText(UserMessage userMessage) {
if (this.client == null) return;
final Screen screen = client.screen;
final Gui gui = client.gui;
final Screen screen = ((GuiAccessors) gui).getScreen();
if (screen instanceof GenericMessageScreen) {
((ScreenAccessors) screen).setTitle(messageToText(userMessage));
((ScreenAccessors) screen).invokeRebuildWidgets(); // force it to rebuild the message component with the new title
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/resources/fastback.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
],
"client": [
"MessageScreenMixin",
"ScreenAccessors"
"ScreenAccessors",
"GuiAccessors"
],
"injectors": {
"defaultRequire": 1
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"fabricloader": ">=${fabric_loader_version}",
"fabric-api": "*",
"fabric-permissions-api-v0": "*",
"minecraft": "26.1.x",
"minecraft": "26.2.x",
"java": ">=25"
},
"conflicts": {}
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Mod
#
mod_version = 0.33.2+26.1.2-prerelease
mod_version = 0.34.0+26.2.0-prerelease
archives_base_name = fastback
github_projectUrl = https://github.com/pcal43/fastback
modrinth_projectId = ZHKrK8Rp
Expand All @@ -10,21 +10,21 @@ curseforge_projectId = 667417
#
# Minecraft
#
minecraft_version=26.1.2
minecraft_version=26.2
java_version = 25

#
# Fabric - https://fabricmc.net/develop
#
fabric_loader_version=0.19.1
fabric_loom_version=1.16-SNAPSHOT
fabric_api_version=0.145.4+26.1.2
fabric_loader_version=0.19.3
fabric_loom_version=1.17-SNAPSHOT
fabric_api_version=0.154.2+26.2

#
# NeoForge - https://neoforged.net/
#
neoforge_version = 26.1.2.8-beta
neoforge_moddev_version = 2.0.140
neoforge_version = 26.2.0.8-beta
neoforge_moddev_version = 2.0.141

#
# Dependencies
Expand Down Expand Up @@ -60,7 +60,7 @@ fabric_permissions_version = 0.7.0

# https://github.com/NucleoidMC/Server-Translations/releases
# https://maven.nucleoid.xyz/xyz/nucleoid/server-translations-api/
server_translations_version = 3.0.3+26.1
server_translations_version = 3.1.0+26.2

#
# Build settings
Expand Down
Loading