Jump to content

Recommended Posts

Posted

So, i'm trying to render something above the players head. Here is my render code in my tick method:

if(player.inventory.getCurrentItem() != EMDItemManager.hangGlider.getContainerItem(null))
     {
         GL11.glPushMatrix();
     ModelHangGlider m = new ModelHangGlider();
     Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(MAssetManager.getEMDTexture("textures/misc/hangGlider.png")));
     int tick = 0;
     tick++;
     float rotateYaw = EMDEventHandler.interpolateRotation(player.prevRotationYaw, player.rotationYaw, tick);
     GL11.glRotatef(rotateYaw, 0, -1, 0);
     GL11.glRotatef(180F, 0, 0, 1);
     GL11.glTranslatef(0, 0, -0.5F);
     m.render(0.0625F);
     GL11.glPopMatrix();
     }

 

This is my crash:

java.lang.RuntimeException: No OpenGL context found in the current thread.
at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
at org.lwjgl.opengl.GL11.glPushMatrix(GL11.java:2582)
at sobiohazardous.minestrappolation.extramobdrops.handler.EMDPlayerTickHandler.playerUpdate(EMDPlayerTickHandler.java:52)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_10_EMDPlayerTickHandler_playerUpdate_PlayerTickEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
at cpw.mods.fml.common.FMLCommonHandler.onPlayerPreTick(FMLCommonHandler.java:327)
at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:244)
at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:321)
at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:310)
at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:137)
at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:211)
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:173)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:681)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:569)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:114)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:454)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:706)

 

The line number points to GL11.glPushMatrix();

I'm not sure why I am getting this crash, considering this worked in 1.6.4. Please note that my tick method is using PlayerTickEvent.

Any help would be greatly appreciated :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.