diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-11-15 23:13:50 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-11-15 23:13:50 +0100 |
| commit | 4d8399ff4d769def62e6a8241327c4f2dac47e71 (patch) | |
| tree | 703f8651cb680d2583d82c2b1b4aee0911ccb490 /src/main/kotlin/util/mc | |
| parent | 215178c650d38a4a77fdef6dc8815c07bef29c25 (diff) | |
| download | Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.tar.gz Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.tar.bz2 Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.zip | |
snapshot: main source set compile
Diffstat (limited to 'src/main/kotlin/util/mc')
| -rw-r--r-- | src/main/kotlin/util/mc/CustomRenderPassHelper.kt | 3 | ||||
| -rw-r--r-- | src/main/kotlin/util/mc/NbtUtil.kt | 5 | ||||
| -rw-r--r-- | src/main/kotlin/util/mc/SkullItemData.kt | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/main/kotlin/util/mc/CustomRenderPassHelper.kt b/src/main/kotlin/util/mc/CustomRenderPassHelper.kt index 295f727..67fb2f8 100644 --- a/src/main/kotlin/util/mc/CustomRenderPassHelper.kt +++ b/src/main/kotlin/util/mc/CustomRenderPassHelper.kt @@ -11,6 +11,7 @@ import java.nio.ByteBuffer import java.nio.ByteOrder import java.util.OptionalDouble import java.util.OptionalInt +import org.joml.Vector3f import org.joml.Vector4f import net.minecraft.client.gl.Framebuffer import net.minecraft.client.render.BufferBuilder @@ -67,7 +68,7 @@ class CustomRenderPassHelper( .write( RenderSystem.getModelViewMatrix(), Vector4f(1.0F, 1.0F, 1.0F, 1.0F), - RenderSystem.getModelOffset(), + Vector3f(), // TODO: 1.21.10 RenderSystem.getTextureMatrix(), RenderSystem.getShaderLineWidth() ) diff --git a/src/main/kotlin/util/mc/NbtUtil.kt b/src/main/kotlin/util/mc/NbtUtil.kt index 2cab1c7..5c47c28 100644 --- a/src/main/kotlin/util/mc/NbtUtil.kt +++ b/src/main/kotlin/util/mc/NbtUtil.kt @@ -1,10 +1,15 @@ package moe.nea.firmament.util.mc +import net.minecraft.component.type.NbtComponent import net.minecraft.nbt.NbtElement import net.minecraft.nbt.NbtList +import moe.nea.firmament.mixins.accessor.AccessorNbtComponent fun Iterable<NbtElement>.toNbtList() = NbtList().also { for (element in this) { it.add(element) } } + +@Suppress("CAST_NEVER_SUCCEEDS") +val NbtComponent.unsafeNbt get() = (this as AccessorNbtComponent).unsafeNbt_firmament diff --git a/src/main/kotlin/util/mc/SkullItemData.kt b/src/main/kotlin/util/mc/SkullItemData.kt index 3a4c508..6f8f24b 100644 --- a/src/main/kotlin/util/mc/SkullItemData.kt +++ b/src/main/kotlin/util/mc/SkullItemData.kt @@ -46,7 +46,7 @@ fun ItemStack.setEncodedSkullOwner(uuid: UUID, encodedData: String) { assert(this.item == Items.PLAYER_HEAD) val gameProfile = GameProfile(uuid, "LameGuy123") gameProfile.properties.put(propertyTextures, Property(propertyTextures, encodedData.padToValidBase64())) - this.set(DataComponentTypes.PROFILE, ProfileComponent(gameProfile)) + this.set(DataComponentTypes.PROFILE, ProfileComponent.ofStatic(gameProfile)) } val arbitraryUUID = UUID.fromString("d3cb85e2-3075-48a1-b213-a9bfb62360c1") @@ -63,7 +63,7 @@ fun ItemStack.setSkullOwner(uuid: UUID, url: String) { profileName = "nea89", ) ) - this.set(DataComponentTypes.PROFILE, ProfileComponent(gameProfile)) + this.set(DataComponentTypes.PROFILE, ProfileComponent.ofStatic(gameProfile)) } |
