aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/lorenz/mod/mixinhooks
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-08 08:51:53 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-08 08:51:53 +0200
commitd188f0135b13ed23a77d46db4ed2040dc1b14bf7 (patch)
tree4c56d8f468038ef8b6c8aeeeca3af0a9c5bd738d /src/main/java/at/lorenz/mod/mixinhooks
parent31fbb9b41c7c3964b46a447c415bfc363fc22c5d (diff)
downloadskyhanni-d188f0135b13ed23a77d46db4ed2040dc1b14bf7.tar.gz
skyhanni-d188f0135b13ed23a77d46db4ed2040dc1b14bf7.tar.bz2
skyhanni-d188f0135b13ed23a77d46db4ed2040dc1b14bf7.zip
added ItemDisplayOverlayFeatures
Diffstat (limited to 'src/main/java/at/lorenz/mod/mixinhooks')
-rw-r--r--src/main/java/at/lorenz/mod/mixinhooks/RenderItemHook.kt85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/main/java/at/lorenz/mod/mixinhooks/RenderItemHook.kt b/src/main/java/at/lorenz/mod/mixinhooks/RenderItemHook.kt
new file mode 100644
index 000000000..0291782b7
--- /dev/null
+++ b/src/main/java/at/lorenz/mod/mixinhooks/RenderItemHook.kt
@@ -0,0 +1,85 @@
+package at.lorenz.mod.mixinhooks
+
+import at.lorenz.mod.events.GuiRenderItemEvent
+import net.minecraft.client.gui.FontRenderer
+import net.minecraft.item.ItemStack
+import net.minecraft.util.ResourceLocation
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
+
+val RES_ITEM_GLINT = ResourceLocation("textures/misc/enchanted_item_glint.png")
+
+var skipGlint = false
+
+//fun renderRarity(stack: ItemStack, x: Int, y: Int, ci: CallbackInfo) {
+// if (Utils.inSkyblock && Skytils.config.showItemRarity) {
+// if (mc.currentScreen != null) {
+// if (isStorageMenuActive || isTradeWindowActive || isCustomAHActive) {
+// renderRarity(stack, x, y)
+// }
+// }
+// }
+//}
+
+fun renderItemOverlayPost(
+ fr: FontRenderer,
+ stack: ItemStack?,
+ xPosition: Int,
+ yPosition: Int,
+ text: String?,
+ ci: CallbackInfo
+) {
+ GuiRenderItemEvent.RenderOverlayEvent.Post(
+ fr,
+ stack,
+ xPosition,
+ yPosition,
+ text
+ ).postAndCatch()
+}
+
+//fun renderItemPre(stack: ItemStack, model: IBakedModel, ci: CallbackInfo) {
+// if (!Utils.inSkyblock) return
+// if (stack.item === Items.skull) {
+// val scale = Skytils.config.largerHeadScale.toDouble()
+// GlStateManager.scale(scale, scale, scale)
+// }
+//}
+
+//fun modifyGlintRendering(stack: ItemStack, model: IBakedModel, ci: CallbackInfo) {
+// if (Utils.inSkyblock) {
+// val itemId = getSkyBlockItemID(stack)
+// if (GlintCustomizer.glintColors.containsKey(itemId)) {
+// val color = GlintCustomizer.glintColors[itemId]!!.toInt()
+// GlStateManager.depthMask(false)
+// GlStateManager.depthFunc(514)
+// GlStateManager.disableLighting()
+// GlStateManager.blendFunc(768, 1)
+// mc.textureManager.bindTexture(RES_ITEM_GLINT)
+// GlStateManager.matrixMode(5890)
+// GlStateManager.pushMatrix()
+// GlStateManager.scale(8.0f, 8.0f, 8.0f)
+// val f = (Minecraft.getSystemTime() % 3000L).toFloat() / 3000.0f / 8.0f
+// GlStateManager.translate(f, 0.0f, 0.0f)
+// GlStateManager.rotate(-50.0f, 0.0f, 0.0f, 1.0f)
+// (mc.renderItem as AccessorRenderItem).invokeRenderModel(model, color)
+// GlStateManager.popMatrix()
+// GlStateManager.pushMatrix()
+// GlStateManager.scale(8.0f, 8.0f, 8.0f)
+// val f1 = (Minecraft.getSystemTime() % 4873L).toFloat() / 4873.0f / 8.0f
+// GlStateManager.translate(-f1, 0.0f, 0.0f)
+// GlStateManager.rotate(10.0f, 0.0f, 0.0f, 1.0f)
+// (mc.renderItem as AccessorRenderItem).invokeRenderModel(model, color)
+// GlStateManager.popMatrix()
+// GlStateManager.matrixMode(5888)
+// GlStateManager.blendFunc(770, 771)
+// GlStateManager.enableLighting()
+// GlStateManager.depthFunc(515)
+// GlStateManager.depthMask(true)
+// mc.textureManager.bindTexture(TextureMap.locationBlocksTexture)
+// ci.cancel()
+//
+// //Since we prematurely exited, we need to reset the matrices
+// GlStateManager.popMatrix()
+// }
+// }
+//} \ No newline at end of file