Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • trakos

trakos

Members
 View Profile  See their activity
  • Content Count

    2
  • Joined

    January 18, 2014
  • Last visited

    February 15, 2014

Community Reputation

0 Neutral

About trakos

  • Rank
    Tree Puncher

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!
  1. trakos started following *SOLVED* rendering item icon to bitmap February 1, 2017
  2. trakos

    [1.6.4] resizing window

    trakos posted a topic in Modder Support

    Hi, is there any good way to resize Minecraft window during startup with mod? I am doing a little util that will save all recipes, and I need to resize window to render icons in desired size. What I found to work: Minecraft.getMinecraft().toggleFullscreen(); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, Minecraft.getMinecraft(), 160, "tempDisplayWidth", "field_71436_X"); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, Minecraft.getMinecraft(), 160, "tempDisplayHeight", "field_71435_Y"); Minecraft.getMinecraft().toggleFullscreen(); But I wonder, is it possible to achieve it without toggling fullscreen (causes annoying flashing)? Thanks in advance.
    • January 19, 2014
    • 1 reply
  3. trakos

    *SOLVED* rendering item icon to bitmap

    trakos posted a topic in Modder Support

    Hi, I'm trying to make a little util mod to document all loaded recipes. Currently, I'm stuck at trying to save item icons as images. I'm thinking of rendering icon to FBO buffer, and then saving it to bitmap. I'm not that good with opengl, so I've tried something simple like that: https://gist.github.com/trakos/f9a71a5910452c5e14a8 Used like: MyClass.initFbo(); for (ItemStack item : ItemList.items) { MyClass.renderItem(item); } But, obviously it doesn't work - the image is saved, but only the background (glClear) is rendered - the icon is not visible. Is it the right approach? Any advices on how could I make it work? Thanks in advance for your time! e: if anyone's wondering, I'm using mc 1.6.4. e2: this works fine when called in tick end after world is loaded: static protected void renderItem(ItemStack itemStack) { if (Tessellator.instance.isDrawing) { Tessellator.instance.draw(); } GL11.glClearColor(1, 1, 1, 0); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GL11.glEnable(GL12.GL_RESCALE_NORMAL); drawItemStack(itemStack, 0, 0, "overlay"); String directory = "C:/test/"; ScreenShotHelper.saveScreenshot(new File(directory), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); moveImageTo(new File(directory + itemStack.getDisplayName() + ".png"), directory); } protected static RenderItem renderItem = new RenderItem(); static private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) { RenderHelper.enableGUIStandardItemLighting(); renderItem.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), par1ItemStack, par2, par3); //renderItem.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : , par4Str); RenderHelper.disableStandardItemLighting(); } (moveImageTo just renames the file, and the window needs to have desired icon size) imports: import net.minecraft.client.Minecraft; import net.minecraft.util.ScreenShotHelper; import net.minecraft.item.ItemStack; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderItem; import java.io.File; import java.io.FilenameFilter;
    • January 18, 2014
  • All Activity
  • Home
  • trakos
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community