Skip to content

Commit e186dd7

Browse files
committed
Fix some multi-compile errors
1 parent fa1d4c1 commit e186dd7

File tree

7 files changed

+17
-31
lines changed

7 files changed

+17
-31
lines changed

forge/src/main/resources/META-INF/mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ issueTrackerURL = "https://github.com/BluSpring/UnityTranslate/issues"
2424
[[dependencies.${mod_id}]]
2525
modId = "minecraft"
2626
mandatory = true
27-
versionRange = "[${mc_version},)"
27+
versionRange = "[${minecraft_version_range},)"
2828
ordering = "NONE"
2929
side = "BOTH"
3030

neoforge/src/main/resources/META-INF/neoforge.mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ issueTrackerURL = "https://github.com/UnityMultiplayer/UnityTranslate/issues"
2424
[[dependencies.${mod_id}]]
2525
modId = "minecraft"
2626
type = "required"
27-
versionRange = "[${mc_version},)"
27+
versionRange = "[${minecraft_version_range},)"
2828
ordering = "NONE"
2929
side = "BOTH"
3030

src/main/kotlin/xyz/bluspring/unitytranslate/Language.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package xyz.bluspring.unitytranslate
22

3-
//? if >= 1.20.6 {
4-
/*import net.minecraft.network.RegistryFriendlyByteBuf
5-
import net.minecraft.network.codec.StreamCodec
6-
import net.minecraft.network.codec.StreamDecoder
7-
import net.minecraft.network.codec.StreamEncoder
8-
*///?}
93
import net.minecraft.network.chat.Component
104
import xyz.bluspring.modernnetworking.api.NetworkCodecs
115
import xyz.bluspring.unitytranslate.client.transcribers.TranscriberType

src/main/kotlin/xyz/bluspring/unitytranslate/client/UnityTranslateClient.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package xyz.bluspring.unitytranslate.client
22

3-
//? if >= 1.20.6 {
4-
/*import xyz.bluspring.unitytranslate.network.payloads.SendTranscriptToServerPayload
5-
*///?}
63
import com.mojang.blaze3d.platform.InputConstants
74
import kotlinx.coroutines.CoroutineStart
85
import kotlinx.coroutines.launch

src/main/kotlin/xyz/bluspring/unitytranslate/client/gui/EditTranscriptBoxesScreen.kt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
package xyz.bluspring.unitytranslate.client.gui
22

3-
//? if >= 1.20.6 {
4-
/*import xyz.bluspring.unitytranslate.network.payloads.SetUsedLanguagesPayload
3+
//? if < 1.21.4 {
4+
//?} else {
5+
/*import net.minecraft.util.ARGB
56
*///?}
67
import net.minecraft.client.Minecraft
78
import net.minecraft.client.gui.GuiGraphics
89
import net.minecraft.client.gui.components.Button
910
import net.minecraft.client.gui.screens.Screen
1011
import net.minecraft.network.chat.CommonComponents
1112
import net.minecraft.network.chat.Component
12-
import net.minecraft.util.FastColor
1313
import net.minecraft.util.Mth
1414
import org.lwjgl.glfw.GLFW
1515
import xyz.bluspring.unitytranslate.UnityTranslate
1616
import xyz.bluspring.unitytranslate.client.UnityTranslateClient
1717
import xyz.bluspring.unitytranslate.network.UTClientNetworking
1818
import java.util.*
19+
import net.minecraft.util.FastColor.ARGB32 as ARGB
1920

2021
class EditTranscriptBoxesScreen(val boxes: MutableList<TranscriptBox>, val parent: Screen? = null) : Screen(Component.empty()) {
2122
val CLOSE_BUTTON = UnityTranslate.id("textures/gui/close.png")
@@ -105,42 +106,42 @@ class EditTranscriptBoxesScreen(val boxes: MutableList<TranscriptBox>, val paren
105106
if (mouseX >= box.x - 1 && mouseY >= box.y - 1 && mouseX <= box.x + box.width + 1 && mouseY <= box.y + box.height + 1) {
106107
if (mouseX >= box.x - 1 && mouseX <= box.x + 1) {
107108
if (mouseY >= box.y - 1 && mouseY <= box.y + 1) {
108-
guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, FastColor.ARGB32.color(255, 255, 255, 255))
109+
guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, ARGB.color(255, 255, 255, 255))
109110
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR))
110111
} else if (mouseY >= box.y + box.height - 1 && mouseY <= box.y + box.height + 1) {
111-
guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, FastColor.ARGB32.color(255, 255, 255, 255))
112+
guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, ARGB.color(255, 255, 255, 255))
112113
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NESW_CURSOR))
113114
} else {
114115
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_HRESIZE_CURSOR))
115116
}
116117

117-
guiGraphics.fill(box.x - 1, box.y, box.x + 1, box.y + box.height, FastColor.ARGB32.color(255, 255, 255, 255))
118+
guiGraphics.fill(box.x - 1, box.y, box.x + 1, box.y + box.height, ARGB.color(255, 255, 255, 255))
118119
} else if (mouseX >= box.x + box.width - 1 && mouseX <= box.x + box.width + 1) {
119120
if (mouseY >= box.y - 1 && mouseY <= box.y + 1) {
120-
guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, FastColor.ARGB32.color(255, 255, 255, 255))
121+
guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, ARGB.color(255, 255, 255, 255))
121122
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NESW_CURSOR))
122123
} else if (mouseY >= box.y + box.height - 1 && mouseY <= box.y + box.height + 1) {
123-
guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, FastColor.ARGB32.color(255, 255, 255, 255))
124+
guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, ARGB.color(255, 255, 255, 255))
124125
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_NWSE_CURSOR))
125126
} else {
126127
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_HRESIZE_CURSOR))
127128
}
128129

129-
guiGraphics.fill(box.x + box.width - 1, box.y, box.x + box.width + 1, box.y + box.height, FastColor.ARGB32.color(255, 255, 255, 255))
130+
guiGraphics.fill(box.x + box.width - 1, box.y, box.x + box.width + 1, box.y + box.height, ARGB.color(255, 255, 255, 255))
130131
} else if (mouseY >= box.y - 1 && mouseY <= box.y + 1) {
131-
guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, FastColor.ARGB32.color(255, 255, 255, 255))
132+
guiGraphics.fill(box.x, box.y - 1, box.x + box.width, box.y + 1, ARGB.color(255, 255, 255, 255))
132133
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_VRESIZE_CURSOR))
133134
} else if (mouseY >= box.y + box.height - 1 && mouseY <= box.y + box.height + 1) {
134-
guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, FastColor.ARGB32.color(255, 255, 255, 255))
135+
guiGraphics.fill(box.x, box.y + box.height - 1, box.x + box.width, box.y + box.height + 1, ARGB.color(255, 255, 255, 255))
135136
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_VRESIZE_CURSOR))
136137
} else {
137-
guiGraphics.renderOutline(box.x, box.y, box.width, box.height, FastColor.ARGB32.color(255, 255, 255, 255))
138+
guiGraphics.renderOutline(box.x, box.y, box.width, box.height, ARGB.color(255, 255, 255, 255))
138139

139140
val offset = 5
140141
if (mouseX >= box.x + offset + 1 && mouseY >= box.y + offset + 1 && mouseX <= box.x + offset + 16 && mouseY <= box.y + offset + 16) {
141142
GLFW.glfwSetCursor(this.minecraft!!.window.window, arrowCursor)
142-
guiGraphics.fill(box.x + offset, box.y + offset, box.x + offset + 16, box.y + offset + 16, FastColor.ARGB32.color(95, 255, 0, 0))
143-
guiGraphics.renderOutline(box.x + offset, box.y + offset, 16, 16, FastColor.ARGB32.color(95, 255, 255, 255))
143+
guiGraphics.fill(box.x + offset, box.y + offset, box.x + offset + 16, box.y + offset + 16, ARGB.color(95, 255, 0, 0))
144+
guiGraphics.renderOutline(box.x + offset, box.y + offset, 16, 16, ARGB.color(95, 255, 255, 255))
144145
} else {
145146
GLFW.glfwSetCursor(this.minecraft!!.window.window, assignCursor(GLFW.GLFW_RESIZE_ALL_CURSOR))
146147
}

src/main/kotlin/xyz/bluspring/unitytranslate/client/transcribers/SpeechTranscriber.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package xyz.bluspring.unitytranslate.client.transcribers
22

3-
//? if >= 1.20.6 {
4-
/*import xyz.bluspring.unitytranslate.network.payloads.SetCurrentLanguagePayload
5-
*///?}
63
import net.minecraft.client.Minecraft
74
import xyz.bluspring.modernnetworking.api.minecraft.VanillaPacketSender
85
import xyz.bluspring.unitytranslate.Language

src/main/kotlin/xyz/bluspring/unitytranslate/translator/TranslatorManager.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package xyz.bluspring.unitytranslate.translator
22

3-
//? if >= 1.20.6 {
4-
/*import xyz.bluspring.unitytranslate.network.payloads.MarkIncompletePayload
5-
*///?}
63
import com.google.common.cache.Cache
74
import com.google.common.cache.CacheBuilder
85
import kotlinx.coroutines.*

0 commit comments

Comments
 (0)