Compare commits
No commits in common. "1.21.6" and "1.21.5" have entirely different histories.
@ -14,8 +14,8 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.1.20"
|
kotlin("jvm") version "2.0.0"
|
||||||
kotlin("plugin.serialization") version "2.1.20"
|
kotlin("plugin.serialization") version "2.0.0"
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||||
id("architectury-plugin") version "[3.4.160, 3.5["
|
id("architectury-plugin") version "[3.4.160, 3.5["
|
||||||
id("dev.architectury.loom") version "1.10-SNAPSHOT" apply false
|
id("dev.architectury.loom") version "1.10-SNAPSHOT" apply false
|
||||||
@ -57,7 +57,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
mappingsDep = layered {
|
mappingsDep = layered {
|
||||||
silentMojangMappingsLicense()
|
silentMojangMappingsLicense()
|
||||||
officialMojangMappings().parchment("org.parchmentmc.data:parchment-1.21.6:2025.06.26-nightly-20250626.125431-1")
|
officialMojangMappings().parchment("org.parchmentmc.data:parchment-1.21.5:2025.04.19")
|
||||||
}
|
}
|
||||||
val refmap = "snowygui-${project.name}-refmap.json"
|
val refmap = "snowygui-${project.name}-refmap.json"
|
||||||
mixin {
|
mixin {
|
||||||
|
@ -12,10 +12,10 @@ import fr.username404.snowygui.utils.RenderingUtil.prepareDraw
|
|||||||
import fr.username404.snowygui.utils.RenderingUtil.renderBufferWithPipeline
|
import fr.username404.snowygui.utils.RenderingUtil.renderBufferWithPipeline
|
||||||
import io.github.config4k.extract
|
import io.github.config4k.extract
|
||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
|
import net.minecraft.client.gui.Font
|
||||||
import net.minecraft.client.gui.GuiGraphics
|
import net.minecraft.client.gui.GuiGraphics
|
||||||
import net.minecraft.client.renderer.RenderPipelines
|
import net.minecraft.client.renderer.RenderPipelines
|
||||||
import net.minecraft.network.chat.Component
|
import net.minecraft.network.chat.Component
|
||||||
import net.minecraft.util.ARGB
|
|
||||||
import org.jetbrains.annotations.ApiStatus
|
import org.jetbrains.annotations.ApiStatus
|
||||||
import java.util.TreeSet
|
import java.util.TreeSet
|
||||||
import kotlin.collections.LinkedHashSet
|
import kotlin.collections.LinkedHashSet
|
||||||
@ -45,7 +45,7 @@ class ClickBox(
|
|||||||
override val color: Int get() = this@ClickBox.color
|
override val color: Int get() = this@ClickBox.color
|
||||||
override fun render(guiGraphics: GuiGraphics?) {
|
override fun render(guiGraphics: GuiGraphics?) {
|
||||||
prepareDraw()
|
prepareDraw()
|
||||||
colorShader(); defaultRectFunc();
|
colorShader(); defaultRectFunc()
|
||||||
endDraw()
|
endDraw()
|
||||||
}
|
}
|
||||||
init { height = 8 }
|
init { height = 8 }
|
||||||
@ -119,11 +119,9 @@ class ClickBox(
|
|||||||
}
|
}
|
||||||
guiGraphics?.run {
|
guiGraphics?.run {
|
||||||
with(Minecraft.getInstance().font) {
|
with(Minecraft.getInstance().font) {
|
||||||
drawString(
|
drawInBatch(Component.nullToEmpty(name.string),
|
||||||
this,
|
(x + 5), (y + 2), Colors.TRANSPARENT.hexValue, false,
|
||||||
Component.nullToEmpty(name.string),
|
pose().last().pose(), bufferSource, Font.DisplayMode.NORMAL, 0, 15728880, isBidirectional
|
||||||
(x + 5).toInt(), (y + 2).toInt(),
|
|
||||||
ARGB.opaque(Colors.TRANSPARENT.hexValue), false
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
|||||||
}
|
}
|
||||||
final override fun render(guiGraphics: GuiGraphics?) {
|
final override fun render(guiGraphics: GuiGraphics?) {
|
||||||
prepareDraw()
|
prepareDraw()
|
||||||
colorShader(); defaultRectFunc();
|
colorShader(); defaultRectFunc()
|
||||||
endDraw()
|
endDraw()
|
||||||
if (guiGraphics != null) {
|
if (guiGraphics != null) {
|
||||||
FontUtil.drawScaled(guiGraphics, title, x + 1, y + 1, 0.75F)
|
FontUtil.drawScaled(guiGraphics, title, x + 1, y + 1, 0.75F)
|
||||||
|
@ -3,19 +3,13 @@ package fr.username404.snowygui.utils
|
|||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
import fr.username404.snowygui.gui.feature.Colors
|
import fr.username404.snowygui.gui.feature.Colors
|
||||||
import net.minecraft.client.gui.GuiGraphics
|
import net.minecraft.client.gui.GuiGraphics
|
||||||
import net.minecraft.util.ARGB
|
|
||||||
import org.joml.Matrix3x2f
|
|
||||||
|
|
||||||
object FontUtil {
|
object FontUtil {
|
||||||
fun drawScaled(guiGraphics: GuiGraphics, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) {
|
fun drawScaled(guiGraphics: GuiGraphics, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) {
|
||||||
val stack = guiGraphics.pose()
|
val stack = guiGraphics.pose()
|
||||||
stack.scale(scaleFactor, scaleFactor, Matrix3x2f())
|
stack.scale(scaleFactor, scaleFactor, scaleFactor)
|
||||||
guiGraphics.drawString(
|
guiGraphics.drawString(Minecraft.getInstance().font, text, (x / scaleFactor).toInt(), (y / scaleFactor).toInt(), color.hexValue, false)
|
||||||
Minecraft.getInstance().font, text,
|
|
||||||
(x / scaleFactor).toInt(), (y / scaleFactor).toInt(),
|
|
||||||
ARGB.opaque(color.hexValue), false
|
|
||||||
)
|
|
||||||
val factorToOriginal = 1F / scaleFactor
|
val factorToOriginal = 1F / scaleFactor
|
||||||
stack.scale(factorToOriginal, factorToOriginal, Matrix3x2f())
|
stack.scale(factorToOriginal, factorToOriginal, factorToOriginal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package fr.username404.snowygui.utils
|
package fr.username404.snowygui.utils
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.buffers.BufferType
|
||||||
|
import com.mojang.blaze3d.buffers.BufferUsage
|
||||||
import com.mojang.blaze3d.opengl.GlCommandEncoder
|
import com.mojang.blaze3d.opengl.GlCommandEncoder
|
||||||
import com.mojang.blaze3d.opengl.GlStateManager
|
import com.mojang.blaze3d.opengl.GlStateManager
|
||||||
import com.mojang.blaze3d.pipeline.RenderPipeline
|
import com.mojang.blaze3d.pipeline.RenderPipeline
|
||||||
@ -13,16 +15,17 @@ import fr.username404.snowygui.gui.feature.Colors
|
|||||||
import fr.username404.snowygui.gui.hextoRGB
|
import fr.username404.snowygui.gui.hextoRGB
|
||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
import net.minecraft.client.renderer.RenderPipelines
|
import net.minecraft.client.renderer.RenderPipelines
|
||||||
import org.joml.Vector4f
|
|
||||||
import java.util.OptionalDouble
|
|
||||||
import java.util.OptionalInt
|
import java.util.OptionalInt
|
||||||
|
import java.util.OptionalDouble
|
||||||
|
|
||||||
object RenderingUtil {
|
object RenderingUtil {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun VertexConsumer.colorIt(color: Int, opacity: Float = 1F): VertexConsumer = hextoRGB(color).run {
|
fun VertexConsumer.colorIt(color: Int, opacity: Float = 1F): VertexConsumer = hextoRGB(color).run {
|
||||||
setColor(get(0), get(1), get(2), opacity)
|
setColor(get(0), get(1), get(2), opacity)
|
||||||
}
|
}
|
||||||
fun colorShader() {}
|
fun colorShader() {
|
||||||
|
RenderSystem.setShaderColor(1F, 1F, 1F, 1F)
|
||||||
|
}
|
||||||
fun prepareDraw() {
|
fun prepareDraw() {
|
||||||
colorShader()
|
colorShader()
|
||||||
GlStateManager._enableBlend()
|
GlStateManager._enableBlend()
|
||||||
@ -42,13 +45,6 @@ object RenderingUtil {
|
|||||||
addVertex(x, y, 0.0F).colorIt()
|
addVertex(x, y, 0.0F).colorIt()
|
||||||
}
|
}
|
||||||
|
|
||||||
val gpuSlice = RenderSystem.getDynamicUniforms().writeTransform(
|
|
||||||
RenderSystem.getModelViewMatrix(),
|
|
||||||
Vector4f(1F, 1F, 1F, 1F), // Alternative to old setShaderColor
|
|
||||||
RenderSystem.getModelOffset(),
|
|
||||||
RenderSystem.getTextureMatrix(),
|
|
||||||
RenderSystem.getShaderLineWidth()
|
|
||||||
)
|
|
||||||
fun renderBufferWithPipeline(
|
fun renderBufferWithPipeline(
|
||||||
name: String? = "Dynamic vertex buffer",
|
name: String? = "Dynamic vertex buffer",
|
||||||
renderPipeline: RenderPipeline,
|
renderPipeline: RenderPipeline,
|
||||||
@ -62,15 +58,14 @@ object RenderingUtil {
|
|||||||
builder.buildOrThrow().use { meshData ->
|
builder.buildOrThrow().use { meshData ->
|
||||||
val encoder = RenderSystem.getDevice().createCommandEncoder() as GlCommandEncoder
|
val encoder = RenderSystem.getDevice().createCommandEncoder() as GlCommandEncoder
|
||||||
encoder.createRenderPass(
|
encoder.createRenderPass(
|
||||||
{ name },
|
renderTarget.colorTexture!!,
|
||||||
renderTarget.colorTextureView!!,
|
|
||||||
OptionalInt.empty(),
|
OptionalInt.empty(),
|
||||||
renderTarget.depthTextureView!!,
|
renderTarget.depthTexture,
|
||||||
OptionalDouble.empty()
|
OptionalDouble.empty()
|
||||||
).use { renderPass ->
|
).use { renderPass ->
|
||||||
encoder.inRenderPass = false;
|
encoder.inRenderPass = false;
|
||||||
RenderSystem.getDevice().createBuffer(
|
RenderSystem.getDevice().createBuffer(
|
||||||
{ name }, 40, meshData.vertexBuffer()
|
{ name }, BufferType.VERTICES, BufferUsage.DYNAMIC_WRITE, meshData.vertexBuffer()
|
||||||
).use { buffer ->
|
).use { buffer ->
|
||||||
val autoStorageIndexBuffer = RenderSystem.getSequentialBuffer(mode)
|
val autoStorageIndexBuffer = RenderSystem.getSequentialBuffer(mode)
|
||||||
renderPass.setPipeline(renderPipeline)
|
renderPass.setPipeline(renderPipeline)
|
||||||
@ -79,13 +74,8 @@ object RenderingUtil {
|
|||||||
autoStorageIndexBuffer.getBuffer(meshData.drawState().indexCount()),
|
autoStorageIndexBuffer.getBuffer(meshData.drawState().indexCount()),
|
||||||
autoStorageIndexBuffer.type()
|
autoStorageIndexBuffer.type()
|
||||||
)
|
)
|
||||||
// RenderSystem.bindDefaultUniforms(renderPass)
|
|
||||||
renderPass.setUniform(
|
|
||||||
"DynamicTransforms",
|
|
||||||
gpuSlice
|
|
||||||
)
|
|
||||||
uniformAndSamplerConsumer?.invoke(renderPass)
|
uniformAndSamplerConsumer?.invoke(renderPass)
|
||||||
renderPass.drawIndexed(0, 0, meshData.drawState().indexCount(), 1)
|
renderPass.drawIndexed(0, meshData.drawState().indexCount())
|
||||||
}
|
}
|
||||||
encoder.inRenderPass = false;
|
encoder.inRenderPass = false;
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,7 @@ accessWidener v2 named
|
|||||||
accessible field net/minecraft/client/OptionInstance value Ljava/lang/Object;
|
accessible field net/minecraft/client/OptionInstance value Ljava/lang/Object;
|
||||||
mutable field net/minecraft/client/OptionInstance value Ljava/lang/Object;
|
mutable field net/minecraft/client/OptionInstance value Ljava/lang/Object;
|
||||||
|
|
||||||
|
accessible field net/minecraft/client/gui/GuiGraphics bufferSource Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;
|
||||||
|
|
||||||
accessible field com/mojang/blaze3d/opengl/GlCommandEncoder inRenderPass Z
|
accessible field com/mojang/blaze3d/opengl/GlCommandEncoder inRenderPass Z
|
||||||
mutable field com/mojang/blaze3d/opengl/GlCommandEncoder inRenderPass Z
|
mutable field com/mojang/blaze3d/opengl/GlCommandEncoder inRenderPass Z
|
@ -1,22 +1,22 @@
|
|||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
org.gradle.jvmargs=-Xmx2G -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+AlwaysPreTouch
|
org.gradle.jvmargs=-Xmx2G -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+AlwaysPreTouch
|
||||||
kotlin.incremental=true
|
kotlin.incremental=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.unsafe.configuration-cache=on
|
org.gradle.unsafe.configuration-cache=on
|
||||||
org.gradle.vfs.watch=true
|
org.gradle.vfs.watch=true
|
||||||
|
|
||||||
minecraft=1.21.6
|
minecraft=1.21.5
|
||||||
forge_version=21.6.0-beta
|
forge_version=21.5.40-beta
|
||||||
kotlinforforge=5.9.0
|
kotlinforforge=5.7.0
|
||||||
kotlinVer=2.1.20
|
kotlinVer=2.1.0
|
||||||
kotlin_coroutines_version=1.10.2
|
kotlin_coroutines_version=1.9.0
|
||||||
serializationVer=1.8.1
|
serializationVer=1.7.3
|
||||||
fabric_loader_version=0.16.0
|
fabric_loader_version=0.14.20
|
||||||
fabric_language_kotlin=1.13.3+kotlin.2.1.21
|
fabric_language_kotlin=1.13.0+kotlin.2.1.0
|
||||||
fabric_resource_loader_version=3.1.10+fa6cb72b9c
|
fabric_resource_loader_version=3.1.6+02ca679607
|
||||||
fabric_rendering_api_version=12.3.0+ac3e15d19c
|
fabric_rendering_api_version=11.1.11+081cc04307
|
||||||
fabric_api_base_version=0.4.63+9ec45cd89c
|
fabric_api_base_version=0.4.62+73a52b4b07
|
||||||
clothconfig_version=19.0.146
|
clothconfig_version=18.0.145
|
||||||
modmenu_version=15.0.0-beta.1
|
modmenu_version=14.0.0-rc.2
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-rc-1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
Loading…
Reference in New Issue
Block a user