diff --git a/build.gradle b/build.gradle index e46940d..7f7715e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.2-SNAPSHOT" apply false } architectury { diff --git a/common/src/main/java/jp/axer/cocoainput/util/TinyConfig.java b/common/src/main/java/jp/axer/cocoainput/util/TinyConfig.java index 9d995db..f8b2e98 100644 --- a/common/src/main/java/jp/axer/cocoainput/util/TinyConfig.java +++ b/common/src/main/java/jp/axer/cocoainput/util/TinyConfig.java @@ -20,7 +20,7 @@ import java.util.regex.Pattern; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.components.EditBox; import net.minecraft.client.gui.components.Button; @@ -216,20 +216,20 @@ protected void init() { } @Override - public void render(PoseStack matrices, int mouseX, int mouseY, float delta) { - this.renderBackground(matrices); + public void render(GuiGraphics helper, int mouseX, int mouseY, float delta) { + this.renderBackground(helper); if (mouseY >= 40 && mouseY <= 39 + entries.size() * 30) { int low = ((mouseY - 10) / 30) * 30 + 10 + 2; - fill(matrices, 0, low, width, low + 30 - 4, 0x33FFFFFF); + helper.fill(0, low, width, low + 30 - 4, 0x33FFFFFF); } - super.render(matrices, mouseX, mouseY, delta); - drawCenteredString(matrices, font, title, width / 2, 15, 0xFFFFFF); + super.render(helper, mouseX, mouseY, delta); + helper.drawCenteredString(font, title, width / 2, 15, 0xFFFFFF); int y = 40; for (EntryInfo info : entries) { - drawString(matrices, font, Component.literal(info.comment), 12, y + 10, 0xFFFFFF); + helper.drawString(font, Component.literal(info.comment), 12, y + 10, 0xFFFFFF); /* if (info.error != null && info.error.getKey().isMouseOver(mouseX,mouseY)) renderTooltip(matrices, info.error.getValue(), mouseX, mouseY); diff --git a/common/src/main/java/jp/axer/cocoainput/wrapper/AbstractSignEditScreenWrapper.java b/common/src/main/java/jp/axer/cocoainput/wrapper/AbstractSignEditScreenWrapper.java index fbabf3a..52b3b79 100644 --- a/common/src/main/java/jp/axer/cocoainput/wrapper/AbstractSignEditScreenWrapper.java +++ b/common/src/main/java/jp/axer/cocoainput/wrapper/AbstractSignEditScreenWrapper.java @@ -9,7 +9,6 @@ import net.minecraft.world.level.block.StandingSignBlock; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.screens.inventory.AbstractSignEditScreen; -import net.minecraft.network.chat.Component; public final class AbstractSignEditScreenWrapper extends IMEReceiver { @@ -25,14 +24,14 @@ public AbstractSignEditScreenWrapper(AbstractSignEditScreen field) { @Override protected void setText(String text) { - owner.sign.setMessage(owner.line, Component.literal(text)); + owner.setMessage(text); String[] util = owner.messages; util[owner.line] = text; } @Override protected String getText() { - return owner.sign.getMessage(owner.line, false).getString(); + return owner.messages[owner.line]; } @Override @@ -69,7 +68,7 @@ public Rect getRect() { y += 30; } return new Rect( - owner.width / 2 + fontRendererObj.width(owner.sign.getMessage(owner.line, false).toString().substring(0, originalCursorPosition)) / 2, + owner.width / 2 + fontRendererObj.width(owner.messages[owner.line].substring(0, originalCursorPosition)) / 2, // owner.width / 2 + fontRendererObj.width(owner.sign.getMessage(owner.line,false).getString()) / 2, y, 0, diff --git a/common/src/main/resources/CocoaInput.accesswidener b/common/src/main/resources/CocoaInput.accesswidener index 6d3febd..ac7f5f1 100644 --- a/common/src/main/resources/CocoaInput.accesswidener +++ b/common/src/main/resources/CocoaInput.accesswidener @@ -6,6 +6,7 @@ accessible field net/minecraft/client/gui/components/EditBox value Ljava/lang/St accessible field net/minecraft/client/gui/components/EditBox frame I accessible method net/minecraft/client/gui/components/EditBox onValueChange (Ljava/lang/String;)V +accessible method net/minecraft/client/gui/screens/inventory/AbstractSignEditScreen setMessage (Ljava/lang/String;)V accessible field net/minecraft/client/gui/screens/inventory/AbstractSignEditScreen line I accessible field net/minecraft/client/gui/screens/inventory/AbstractSignEditScreen frame I accessible field net/minecraft/client/gui/screens/inventory/AbstractSignEditScreen sign Lnet/minecraft/world/level/block/entity/SignBlockEntity; diff --git a/fabric/gradle.properties b/fabric/gradle.properties index 0bcd98f..7b87fc2 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -1,2 +1,2 @@ # Dependencies -modmenu_version=6.1.0-rc.1 +modmenu_version=7.0.0 diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 13403e8..1a74635 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -37,7 +37,7 @@ ], "depends": { - "fabricloader": ">=0.14.17", - "minecraft": ">=1.19.4" + "fabricloader": ">=0.14.21", + "minecraft": "1.20" } } diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 89d9560..8c34c66 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader = "javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion = "[45,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +loaderVersion = "[46,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license = "Minecraft Mod Public License Japanese Transration" @@ -41,11 +41,11 @@ Support IME input on macOS, Windows, X11(Linux). [[dependencies.cocoainput]] modId = "forge" mandatory = true -versionRange = "[45,)" +versionRange = "[46,)" side = "CLIENT" [[dependencies.cocoainput]] modId = "minecraft" mandatory = true -versionRange = "1.19.4" +versionRange = "1.20" side = "CLIENT" diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta index 53b8dee..a5805a0 100644 --- a/forge/src/main/resources/pack.mcmeta +++ b/forge/src/main/resources/pack.mcmeta @@ -1,8 +1,8 @@ { "pack": { "description": "CocoaInput Resources", - "pack_format": 13, - "forge:resource_pack_format": 13, - "forge:data_pack_format": 12 + "pack_format": 15, + "forge:resource_pack_format": 15, + "forge:data_pack_format": 15 } } diff --git a/gradle.properties b/gradle.properties index f552a1f..1add321 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G archives_base_name=CocoaInput -mod_version=4.2.1-EXPERIMENTAL +mod_version=4.3.0-EXPERIMENTAL maven_group=jp.axer.cocoainput -minecraft_version=1.19.4 +minecraft_version=1.20 -fabric_loader_version=0.14.17 -forge_version=1.19.4-45.0.1 +fabric_loader_version=0.14.21 +forge_version=1.20-46.0.1 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index 79a61d4..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in