electrodynamics/src/main/scala/edx/quantum/gate/RenderQuantumGlyph.scala

33 lines
1.2 KiB
Scala
Raw Normal View History

2015-01-14 12:06:03 +01:00
package edx.quantum.gate
2014-07-30 00:48:32 +02:00
import codechicken.lib.vec.Cuboid6
2015-01-14 12:06:03 +01:00
import edx.core.Reference
2014-07-30 00:48:32 +02:00
import net.minecraft.client.renderer.texture.TextureMap
import net.minecraft.init.Blocks
import net.minecraft.item.ItemStack
import net.minecraftforge.client.IItemRenderer
import org.lwjgl.opengl.GL11
2015-01-26 13:17:04 +01:00
import resonantengine.api.item.ISimpleItemRenderer
2015-01-26 12:40:32 +01:00
import resonantengine.lib.render.RenderUtility
2014-07-30 00:48:32 +02:00
2014-09-16 06:50:42 +02:00
object RenderQuantumGlyph extends ISimpleItemRenderer
2014-09-07 05:50:03 +02:00
{
def render(part: PartQuantumGlyph, x: Double, y: Double, z: Double)
{
2014-07-30 00:48:32 +02:00
GL11.glPushMatrix
GL11.glTranslated(x, y, z)
val bound: Cuboid6 = part.getBounds
RenderUtility.bind(TextureMap.locationBlocksTexture)
RenderUtility.renderCube(bound.min.x, bound.min.y, bound.min.z, bound.max.x, bound.max.y, bound.max.z, Blocks.stone, RenderUtility.getIcon(Reference.prefix + "glyph_" + part.number))
GL11.glPopMatrix
}
2014-09-07 05:50:03 +02:00
def renderInventoryItem(`type`: IItemRenderer.ItemRenderType, itemStack: ItemStack, data: AnyRef*)
{
2014-07-30 00:48:32 +02:00
GL11.glPushMatrix
GL11.glTranslated(-0.25, -0.25, -0.25)
RenderUtility.bind(TextureMap.locationBlocksTexture)
RenderUtility.renderCube(0, 0, 0, 0.5, 0.5, 0.5, Blocks.stone, RenderUtility.getIcon(Reference.prefix + "glyph_" + itemStack.getItemDamage))
GL11.glPopMatrix
}
}