Skip to content

Commit

Permalink
Merge pull request #102
Browse files Browse the repository at this point in the history
* mc1.20.2
* mc1.20.3
* mc1.20.4
* Format buttons on Hanging Signs too
  • Loading branch information
pinter-gabor-at authored Jun 22, 2024
1 parent 116140a commit de93361
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 23 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
// https://fabricmc.net/wiki/documentation:fabric_loom
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
// https://plugins.gradle.org/plugin/io.github.juuxel.loom-vineflower
id 'io.github.juuxel.loom-vineflower' version '1.11.0'
//id 'io.github.juuxel.loom-vineflower' version '1.11.0'
id 'maven-publish'
id 'idea'
}
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ org.gradle.jvmargs = -Xmx6G
org.gradle.parallel = true

# Fabric Properties: https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.21
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
loader_version=0.15.1

#Fabric api
fabric_version=0.86.0+1.20.1
fabric_version=0.91.2+1.20.4

# Shedaniel API's: https://linkie.shedaniel.me/dependencies
modmenu_version = 7.1.0
cloth_config_version = 11.0.99
modmenu_version = 9.0.0-pre.1
cloth_config_version = 13.0.114

# Local dev mod versions
rei_version = 12.0.625
rei_version = 14.0.680
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
package io.chaws.textutilities.client.handlers;

import com.google.common.collect.ImmutableList;
import io.chaws.textutilities.TextUtilities;
import java.util.ArrayList;
import java.util.List;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
import net.fabricmc.fabric.api.client.screen.v1.Screens;

import com.google.common.collect.ImmutableList;
import io.chaws.textutilities.TextUtilities;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
import net.minecraft.client.gui.screen.ingame.BookEditScreen;
import net.minecraft.client.gui.screen.ingame.HangingSignEditScreen;
import net.minecraft.client.gui.screen.ingame.SignEditScreen;
import net.minecraft.client.gui.tooltip.Tooltip;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
import net.fabricmc.fabric.api.client.screen.v1.Screens;

@Environment(EnvType.CLIENT)
public class FormatButtonsHandler {

Expand Down Expand Up @@ -61,7 +65,8 @@ private static void onScreenOpened(Screen screen) {
var xOffsetFromCenter = 0;
var yOffset = 0;

if (screen instanceof SignEditScreen) {
if (screen instanceof SignEditScreen ||
screen instanceof HangingSignEditScreen) {
if (!config.signFormattingEnabled) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void onSlotUpdate(
}

var json = nameElement.asString();
var text = Text.Serializer.fromJson(json);
var text = Text.Serialization.fromJson(json);
if (text == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Environment(EnvType.CLIENT)
@Mixin(TextFieldWidget.class)
public class TextFieldWidgetMixin {
@Redirect(method = "renderButton", at = @At(value = "INVOKE", target = "Ljava/lang/String;substring(I)Ljava/lang/String;", ordinal = 1))
@Redirect(method = "renderWidget", at = @At(value = "INVOKE", target = "Ljava/lang/String;substring(I)Ljava/lang/String;", ordinal = 1))
private String appendFormatting(String string, int i) {
var strings = FormattingUtils.splitWithFormatting(string, i);

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"cloth-config": "*"
},
"depends": {
"fabricloader": ">=0.14",
"fabricloader": ">=0.15",
"fabric": "*",
"minecraft": ">=1.20",
"minecraft": ">=1.20.4",
"java": ">=17"
},
"suggests": {
"modmenu": ">=5"
"modmenu": ">=8"
},
"conflicts": {
"clickthrough": "*",
Expand All @@ -60,4 +60,4 @@
}
}
}
}
}

0 comments on commit de93361

Please sign in to comment.