aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/mc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/util/mc')
-rw-r--r--src/main/kotlin/util/mc/CustomRenderPassHelper.kt3
-rw-r--r--src/main/kotlin/util/mc/NbtUtil.kt5
-rw-r--r--src/main/kotlin/util/mc/SkullItemData.kt4
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))
}