Posted July 4, 201312 yr Hello! I need to be able to display text or an image over a mob. Is there a way to do this? Text most likely won't be as much of an issue, but I have absolutely no idea of how to render an image over a mob like a nameplate.
July 4, 201312 yr please consult javadoc before asking anything RenderLivingEvent is the event you want to use good luck have fun how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 5, 201312 yr Author RenderLivingEvent doesn't seem to be what I want, or I might just not be understanding it. I found this method inside of RenderLiving: /** * Draws the debug or playername text above a living */ protected void renderLivingLabel(EntityLiving par1EntityLiving, String par2Str, double par3, double par5, double par7, int par9) { double d3 = par1EntityLiving.getDistanceSqToEntity(this.renderManager.livingPlayer); if (d3 <= (double)(par9 * par9)) { FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); float f = 1.6F; float f1 = 0.016666668F * f; GL11.glPushMatrix(); GL11.glTranslatef((float)par3 + 0.0F, (float)par5 + par1EntityLiving.height + 0.5F, (float)par7); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GL11.glScalef(-f1, -f1, f1); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Tessellator tessellator = Tessellator.instance; byte b0 = 0; if (par2Str.equals("deadmau5")) { b0 = -10; } GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); int j = fontrenderer.getStringWidth(par2Str) / 2; tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); tessellator.addVertex((double)(-j - 1), (double)(-1 + b0), 0.0D); tessellator.addVertex((double)(-j - 1), (double)(8 + b0), 0.0D); tessellator.addVertex((double)(j + 1), (double)(8 + b0), 0.0D); tessellator.addVertex((double)(j + 1), (double)(-1 + b0), 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); fontrenderer.drawString(par2Str, -fontrenderer.getStringWidth(par2Str) / 2, b0, 553648127); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); fontrenderer.drawString(par2Str, -fontrenderer.getStringWidth(par2Str) / 2, b0, -1); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } } This seems to be how names are rendered above a mob. Is this correct, and how can I adapt it to work with images?
July 5, 201312 yr technicly its more like this with some billboarding before so that the image always faces the player (if thats what you want what you really really want...wtf ?) mc.renderEngine.bindTexture("path/to/image"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x, y, z, 0, 0); tessellator.addVertexWithUV(x, y, z+height, 0, 1); tessellator.addVertexWithUV(x+width, y+height, z, 1, 1); tessellator.addVertexWithUV(x,+width y, z, 1, 0); tessellator.draw(); how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 6, 201312 yr yes renderLivingEvent is what you want no they are the coordinates to your nameplate yes you will need some openGL knowledge how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 6, 201312 yr Author What do you mean by coordinates to your nameplate? Do you mean the location of the image relative to the mob?
August 6, 201312 yr yeah how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 6, 201312 yr Author OK, I have made progress.... however, it seems to be glitching out. Here are the relevant files: package village.mechanics; import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.entity.passive.EntityVillager; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.Event; import net.minecraftforge.event.ForgeSubscribe; public class VillagerBubbleHandler extends Event { VillageMechanics mechanics; public VillagerBubbleHandler() { mechanics = new VillageMechanics(); } @ForgeSubscribe public void onVillagerRender(RenderLivingEvent event) { System.out.println(event.entity); if(event.entity instanceof EntityVillager) { mechanics.updateTradeBubble(FMLClientHandler.instance().getClient()); } } } package village.mechanics; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderManager; import org.lwjgl.opengl.GL11; /** * Contains information about the new Mechanics for the past * @author Charsmud * */ public class VillageMechanics { /** * Updates Paradox Bar and Renders * @param minecraft * @param amtOfParadox */ public void updateTradeBubble(Minecraft minecraft) { Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)1, (double)1, (double)0, (double)0, (double)0); tessellator.addVertexWithUV((double)1, (double)1, (double)0+600, (double)0, (double)1); tessellator.addVertexWithUV((double)1+776, (double)1+600, (double)0, (double)1, (double)1); tessellator.addVertexWithUV((double)1+776, (double)1, (double)0, (double)1, (double)0); tessellator.draw(); } } package village.core; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.common.MinecraftForge; import village.mechanics.VillagerBubbleHandler; import village.proxies.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; @Mod(modid = "Charsmud_VillageUpgrades", name = "Village Upgrades", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) /** * Main laucher for VillageUpgrades * @author Charsmud * */ public class VillageUpgrades { @SidedProxy(clientSide = "village.proxies.ClientProxy", serverSide = "village.proxies.CommonProxy") public static CommonProxy proxy; @Instance public static VillageUpgrades instance = new VillageUpgrades(); public static final String modid = "Charsmud_VillageUpgrades"; /** * Initiates mod, registers block and item for use. Generates the necessary folders. */ @Init public void load(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new VillagerBubbleHandler()); proxy.registerRenderThings(); TickRegistry.registerTickHandler(new TickerClient(), Side.CLIENT); } } I am also getting this error upon start, but the game runs fine: 2013-08-06 13:51:03 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.737 for Minecraft 1.5.2 loading 2013-08-06 13:51:03 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_09, running on Windows 7:amd64:6.1, installed at C:\Users\Will\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\jre 2013-08-06 13:51:03 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation 2013-08-06 13:51:05 [iNFO] [sTDOUT] 229 recipes 2013-08-06 13:51:05 [iNFO] [sTDOUT] 27 achievements 2013-08-06 13:51:06 [iNFO] [Minecraft-Client] Setting user: Player343 2013-08-06 13:51:06 [iNFO] [sTDOUT] (Session ID is -) 2013-08-06 13:51:06 [iNFO] [sTDERR] Client asked for parameter: server 2013-08-06 13:51:06 [iNFO] [Minecraft-Client] LWJGL Version: 2.4.2 2013-08-06 13:51:06 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization 2013-08-06 13:51:06 [iNFO] [sTDOUT] MinecraftForge v7.8.1.737 Initialized 2013-08-06 13:51:06 [iNFO] [ForgeModLoader] MinecraftForge v7.8.1.737 Initialized 2013-08-06 13:51:06 [iNFO] [sTDOUT] Replaced 85 ore recipies 2013-08-06 13:51:06 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization 2013-08-06 13:51:06 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Will\Desktop\minecraftforge-src-1.5.2-7.8.1.737 - Villager\forge\mcp\jars\config\logging.properties 2013-08-06 13:51:06 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL 2013-08-06 13:51:06 [iNFO] [ForgeModLoader] Searching C:\Users\Will\Desktop\minecraftforge-src-1.5.2-7.8.1.737 - Villager\forge\mcp\jars\mods for mods 2013-08-06 13:51:08 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2013-08-06 13:51:08 [iNFO] [mcp] Activating mod mcp 2013-08-06 13:51:08 [iNFO] [FML] Activating mod FML 2013-08-06 13:51:08 [iNFO] [Forge] Activating mod Forge 2013-08-06 13:51:08 [iNFO] [Charsmud_VillageUpgrades] Activating mod Charsmud_VillageUpgrades 2013-08-06 13:51:08 [iNFO] [ForgeModLoader] Registering Forge Packet Handler 2013-08-06 13:51:08 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler 2013-08-06 13:51:08 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0 2013-08-06 13:51:08 [iNFO] [sTDOUT] 2013-08-06 13:51:08 [iNFO] [sTDOUT] Starting up SoundSystem... 2013-08-06 13:51:08 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2013-08-06 13:51:08 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2013-08-06 13:51:09 [iNFO] [sTDOUT] OpenAL initialized. 2013-08-06 13:51:09 [iNFO] [sTDOUT] 2013-08-06 13:51:09 [iNFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled 2013-08-06 13:51:09 [iNFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt 2013-08-06 13:51:09 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt 2013-08-06 13:51:10 [iNFO] [sTDERR] java.lang.InstantiationException 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at net.minecraftforge.event.EventBus.register(EventBus.java:76) 2013-08-06 13:51:10 [iNFO] [sTDERR] at net.minecraftforge.event.EventBus.register(EventBus.java:58) 2013-08-06 13:51:10 [iNFO] [sTDERR] at village.core.VillageUpgrades.load(VillageUpgrades.java:46) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-08-06 13:51:10 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192) 2013-08-06 13:51:10 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-08-06 13:51:10 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-08-06 13:51:10 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103) 2013-08-06 13:51:10 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) 2013-08-06 13:51:10 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:213) 2013-08-06 13:51:10 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:448) 2013-08-06 13:51:10 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) 2013-08-06 13:51:10 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:733) 2013-08-06 13:51:10 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) 2013-08-06 13:51:10 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt 2013-08-06 13:51:10 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt 2013-08-06 13:51:12 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2 2013-08-06 13:51:12 [iNFO] [Minecraft-Server] Generating keypair 2013-08-06 13:51:13 [iNFO] [ForgeModLoader] Loading dimension 0 (ds) (net.minecraft.server.integrated.IntegratedServer@75d811e7) 2013-08-06 13:51:13 [iNFO] [ForgeModLoader] Loading dimension 1 (ds) (net.minecraft.server.integrated.IntegratedServer@75d811e7) 2013-08-06 13:51:13 [iNFO] [ForgeModLoader] Loading dimension -1 (ds) (net.minecraft.server.integrated.IntegratedServer@75d811e7) 2013-08-06 13:51:13 [iNFO] [Minecraft-Server] Preparing start region for level 0 2013-08-06 13:51:14 [iNFO] [sTDOUT] loading single player 2013-08-06 13:51:14 [iNFO] [Minecraft-Server] Player343[/127.0.0.1:0] logged in with entity id 403 at (-78.67326373669563, 64.0, 313.677763770806) 2013-08-06 13:51:23 [iNFO] [Minecraft-Server] Saving and pausing game... 2013-08-06 13:51:23 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Overworld 2013-08-06 13:51:23 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Nether 2013-08-06 13:51:23 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/The End 2013-08-06 13:51:24 [iNFO] [Minecraft-Server] Saving and pausing game... 2013-08-06 13:51:24 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Overworld 2013-08-06 13:51:24 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Nether 2013-08-06 13:51:24 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/The End 2013-08-06 13:51:25 [iNFO] [Minecraft-Server] Saving and pausing game... 2013-08-06 13:51:25 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Overworld 2013-08-06 13:51:25 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Nether 2013-08-06 13:51:25 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/The End 2013-08-06 13:51:28 [iNFO] [Minecraft-Server] Saving and pausing game... 2013-08-06 13:51:28 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Overworld 2013-08-06 13:51:28 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Nether 2013-08-06 13:51:28 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/The End 2013-08-06 13:52:05 [iNFO] [Minecraft-Client] [CHAT] Saved screenshot as 2013-08-06_13.52.05.png 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving and pausing game... 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Overworld 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Nether 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/The End 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Stopping server 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving players 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving worlds 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Overworld 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/Nether 2013-08-06 13:52:06 [iNFO] [Minecraft-Server] Saving chunks for level 'ds'/The End 2013-08-06 13:52:07 [iNFO] [ForgeModLoader] Unloading dimension 0 2013-08-06 13:52:07 [iNFO] [ForgeModLoader] Unloading dimension -1 2013-08-06 13:52:07 [iNFO] [ForgeModLoader] Unloading dimension 1 2013-08-06 13:52:08 [iNFO] [Minecraft-Client] Stopping! 2013-08-06 13:52:08 [iNFO] [sTDOUT] 2013-08-06 13:52:08 [iNFO] [sTDOUT] SoundSystem shutting down... 2013-08-06 13:52:08 [iNFO] [sTDOUT] Author: Paul Lamb, www.paulscode.com 2013-08-06 13:52:08 [iNFO] [sTDOUT] I also tried using the nameplate rendering code directly from EntityLiving.java, but that just glitched out and did not have the results that I want. Any idea?
August 6, 201312 yr yeah you need to translate to teh position of the entity before drawing how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 6, 201312 yr Author Do you know how to do that? I'm guessing you get the x, y, and z coordinates of a mob but I'm not sure what to do from there.... I'm a bit of a noob at OpenGL, as I haven't really delved that deep into it.
August 6, 201312 yr I'm a bit of a noob at OpenGL nah that ok, a lot of ppl mod without having any ogl knowledge (and it bites them in the ass alter but ) basicly when youre calling your updateTradeBubble also pass the event that comes with it becuase it hold which entity is being rendered. now take the difference between the local player and the entity and translate by that amount code ish EntityPlayer localPlayer = Minecraft.getMinecraft().thePlayer; double x = localPlayer.posX - event.entity.posX; same for y, smae for z GL11.glPushMatrix(); GL11.glTranslated(x, y, z); //your render code here GL11.glPopMatrix(); it might be event.entity.posX-localPlayer.posX or the other way aroudn, try both if one doesnt work how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 6, 201312 yr Author Hm.... neither of those worked. Nothing now appears. Here's what I have edited: package village.mechanics; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.client.event.RenderLivingEvent; import org.lwjgl.opengl.GL11; /** * Contains information about the new Mechanics for the past * @author Charsmud * */ public class VillageMechanics { /** * Updates Paradox Bar and Renders * @param minecraft * @param amtOfParadox */ public void updateTradeBubble(Minecraft minecraft, RenderLivingEvent event) { Tessellator tessellator = Tessellator.instance; GL11.glRotatef(-RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F); EntityPlayer localPlayer = Minecraft.getMinecraft().thePlayer; double x = event.entity.posX - localPlayer.posX; double y = event.entity.posY - localPlayer.posY; double z = event.entity.posZ - localPlayer.posZ; //double x = localPlayer.posX - event.entity.posX; //double y = localPlayer.posY - event.entity.posY; //double z = localPlayer.posZ - event.entity.posZ; GL11.glPushMatrix(); GL11.glTranslated(x, y, z); minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)1, (double)1, (double)0, (double)0, (double)0); tessellator.addVertexWithUV((double)1, (double)1, (double)0+600, (double)0, (double)1); tessellator.addVertexWithUV((double)1+776, (double)1+600, (double)0, (double)1, (double)1); tessellator.addVertexWithUV((double)1+776, (double)1, (double)0, (double)1, (double)0); tessellator.draw(); GL11.glPopMatrix(); } } package village.mechanics; import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.entity.passive.EntityVillager; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.Event; import net.minecraftforge.event.ForgeSubscribe; public class VillagerBubbleHandler extends Event { VillageMechanics mechanics; public VillagerBubbleHandler() { mechanics = new VillageMechanics(); } @ForgeSubscribe public void onVillagerRender(RenderLivingEvent event) { if(event.entity instanceof EntityVillager) { mechanics.updateTradeBubble(FMLClientHandler.instance().getClient(), event); } } } I was going to learn OGL but then I settled with Direct3D instead. Have any idea why it's not rendering?
August 7, 201312 yr Author I feel like I messed up somewhere.... now the image doesn't even render, even messed up...
August 7, 201312 yr revert back to the "messed up" phase and press f5, is it above your head ? or just on the screen ? how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 7, 201312 yr Author Now I cannot get it to render at all! Here are my files: package village.mechanics; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiIngame; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderManager; import org.lwjgl.opengl.GL11; /** * Contains information about the new Mechanics for the past * @author Charsmud * */ public class VillageMechanics { /** * Updates Paradox Bar and Renders * @param minecraft * @param amtOfParadox */ public void updateTradeBubble(Minecraft minecraft) { Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.draw(); } } package village.mechanics; import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.entity.passive.EntityVillager; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.Event; import net.minecraftforge.event.ForgeSubscribe; public class VillagerBubbleHandler { public VillagerBubbleHandler() { } @ForgeSubscribe public void onVillagerRender(RenderLivingEvent event) { VillageMechanics mechanics = new VillageMechanics(); if(event.entity instanceof EntityVillager) { mechanics.updateTradeBubble(FMLClientHandler.instance().getClient()); } } } package village.core; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.common.MinecraftForge; import village.mechanics.VillagerBubbleHandler; import village.proxies.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; @Mod(modid = "Charsmud_VillageUpgrades", name = "Village Upgrades", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) /** * Main laucher for VillageUpgrades * @author Charsmud * */ public class VillageUpgrades { @SidedProxy(clientSide = "village.proxies.ClientProxy", serverSide = "village.proxies.CommonProxy") public static CommonProxy proxy; @Instance public static VillageUpgrades instance = new VillageUpgrades(); public static final String modid = "Charsmud_VillageUpgrades"; /** * Initiates mod, registers block and item for use. Generates the necessary folders. */ @PreInit public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new VillagerBubbleHandler()); } @Init public void load(FMLInitializationEvent event) { proxy.registerRenderThings(); TickRegistry.registerTickHandler(new TickerClient(), Side.CLIENT); } } I have NO idea why it's not working when Its a copy-paste of what I had before. The image is in the right place.
August 7, 201312 yr 3 things first: tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); this square is WAY too big, basicly this would mean 776 block long in minecraft world by 600 block long 2 try System.out.println("i executed from "+*insert class name*); try to see if: - the event handler is being registered correctly -the event is called --your code makes it to the render code change this: public void updateTradeBubble(Minecraft minecraft) { Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.draw(); } to this: (it will allow you to see both side of the quad) public void updateTradeBubble(Minecraft minecraft) { Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.draw(); } how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 7, 201312 yr Author OK, I added prints here: public void updateTradeBubble(Minecraft minecraft) { System.out.println("EXECUTED FROM VILLAGEMECHANICS"); Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/bubble1.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+2, 0, 1); tessellator.addVertexWithUV(1+1, 1+2, 0, 1, 1); tessellator.addVertexWithUV(1, 1+1, 0, 1, 0); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1+1, 0, 1, 0); tessellator.addVertexWithUV(1+1, 1+2, 0, 1, 1); tessellator.addVertexWithUV(1, 1, 0+2, 0, 1); tessellator.draw(); } public void onVillagerRender(RenderLivingEvent event) { VillageMechanics mechanics = new VillageMechanics(); if(event.entity instanceof EntityVillager) { System.out.println("EXECUTED FROM VILLAGERBUBBLEHANDLER"); mechanics.updateTradeBubble(FMLClientHandler.instance().getClient()); } } None of those prints print. I also added some in the main mod file, but those print just fine. I also edited the tesselator addVertexWithUVs... is this a more reasonable size?
August 7, 201312 yr about the size, youll see when it renders for real, but it might be too big anyway, but its deffinitelly in the "reasonable size" well then now you knwo that you dont register it correctly did you change something there ? make a println before MinecraftForge.EVENT_BUS.register(Object); if it doesnt print, then you know the method that is SUPPOSE to register it isnt being called, try to see why (if you cant find anything, use code tag to paste your main mod class, common proxy and client proxy how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 7, 201312 yr Author I put prints in the @PreInit. package village.core; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.common.MinecraftForge; import village.mechanics.VillagerBubbleHandler; import village.proxies.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler; import cpw.mods.fml.common.registry.TickRegistry; import cpw.mods.fml.relauncher.Side; @Mod(modid = "Charsmud_VillageUpgrades", name = "Village Upgrades", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) /** * Main laucher for VillageUpgrades * @author Charsmud * */ public class VillageUpgrades { @SidedProxy(clientSide = "village.proxies.ClientProxy", serverSide = "village.proxies.CommonProxy") public static CommonProxy proxy; @Instance public static VillageUpgrades instance = new VillageUpgrades(); public static final String modid = "Charsmud_VillageUpgrades"; /** * Initiates mod, registers block and item for use. Generates the necessary folders. */ @PreInit public void preInit(FMLPreInitializationEvent event) { System.out.println("EXECUTED FRMO VILLAGEUPGRADES"); MinecraftForge.EVENT_BUS.register(new VillagerBubbleHandler()); System.out.println("EXECUTED FROM VILLAGEUPGRADES PRINT 2"); } @Init public void load(FMLInitializationEvent event) { proxy.registerRenderThings(); TickRegistry.registerTickHandler(new TickerClient(), Side.CLIENT); } } Both print just fine. My CommonProxy and ClientProxy: package village.proxies; public class CommonProxy { public void registerRenderThings() { } } package village.proxies; public class ClientProxy extends CommonProxy { @Override public void registerRenderThings() { } } I believe that it is initializing correctly, but I get this error on load, but the game still loads: 2013-08-07 10:41:39 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.737 for Minecraft 1.5.2 loading 2013-08-07 10:41:39 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_09, running on Windows 7:amd64:6.1, installed at C:\Users\Will\Desktop\eclipse-jee-juno-SR2-win32-x86_64\eclipse\jre 2013-08-07 10:41:39 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation 2013-08-07 10:41:42 [iNFO] [sTDOUT] 229 recipes 2013-08-07 10:41:42 [iNFO] [sTDOUT] 27 achievements 2013-08-07 10:41:42 [iNFO] [Minecraft-Client] Setting user: Player659 2013-08-07 10:41:42 [iNFO] [sTDOUT] (Session ID is -) 2013-08-07 10:41:42 [iNFO] [sTDERR] Client asked for parameter: server 2013-08-07 10:41:42 [iNFO] [Minecraft-Client] LWJGL Version: 2.4.2 2013-08-07 10:41:43 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization 2013-08-07 10:41:43 [iNFO] [sTDOUT] MinecraftForge v7.8.1.737 Initialized 2013-08-07 10:41:43 [iNFO] [ForgeModLoader] MinecraftForge v7.8.1.737 Initialized 2013-08-07 10:41:43 [iNFO] [sTDOUT] Replaced 85 ore recipies 2013-08-07 10:41:43 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization 2013-08-07 10:41:43 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Will\Desktop\minecraftforge-src-1.5.2-7.8.1.737 - Villager\forge\mcp\jars\config\logging.properties 2013-08-07 10:41:43 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL 2013-08-07 10:41:43 [iNFO] [ForgeModLoader] Searching C:\Users\Will\Desktop\minecraftforge-src-1.5.2-7.8.1.737 - Villager\forge\mcp\jars\mods for mods 2013-08-07 10:41:44 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2013-08-07 10:41:44 [iNFO] [mcp] Activating mod mcp 2013-08-07 10:41:44 [iNFO] [FML] Activating mod FML 2013-08-07 10:41:44 [iNFO] [Forge] Activating mod Forge 2013-08-07 10:41:44 [iNFO] [Charsmud_VillageUpgrades] Activating mod Charsmud_VillageUpgrades 2013-08-07 10:41:44 [iNFO] [ForgeModLoader] Registering Forge Packet Handler 2013-08-07 10:41:44 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler 2013-08-07 10:41:44 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0 2013-08-07 10:41:44 [iNFO] [sTDOUT] EXECUTED FRMO VILLAGEUPGRADES 2013-08-07 10:41:44 [iNFO] [sTDERR] java.lang.InstantiationException 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at net.minecraftforge.event.EventBus.register(EventBus.java:76) 2013-08-07 10:41:44 [iNFO] [sTDERR] at net.minecraftforge.event.EventBus.register(EventBus.java:58) 2013-08-07 10:41:44 [iNFO] [sTDERR] at village.core.VillageUpgrades.preInit(VillageUpgrades.java:47) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-08-07 10:41:44 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192) 2013-08-07 10:41:44 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-08-07 10:41:44 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-08-07 10:41:44 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103) 2013-08-07 10:41:44 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:515) 2013-08-07 10:41:44 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:163) 2013-08-07 10:41:44 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:411) 2013-08-07 10:41:44 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) 2013-08-07 10:41:44 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:733) 2013-08-07 10:41:44 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) 2013-08-07 10:41:44 [iNFO] [sTDOUT] EXECUTED FROM VILLAGEUPGRADES PRINT 2 2013-08-07 10:41:45 [iNFO] [sTDOUT] 2013-08-07 10:41:45 [iNFO] [sTDOUT] Starting up SoundSystem... 2013-08-07 10:41:45 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2013-08-07 10:41:45 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2013-08-07 10:41:45 [iNFO] [sTDOUT] OpenAL initialized. 2013-08-07 10:41:45 [iNFO] [sTDOUT] 2013-08-07 10:41:46 [iNFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled 2013-08-07 10:41:46 [iNFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt 2013-08-07 10:41:46 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt 2013-08-07 10:41:46 [iNFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt 2013-08-07 10:41:47 [iNFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt 2013-08-07 10:41:47 [iNFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt 2013-08-07 10:42:11 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2 2013-08-07 10:42:11 [iNFO] [Minecraft-Server] Generating keypair 2013-08-07 10:42:11 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@66bf349f) 2013-08-07 10:42:11 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@66bf349f) 2013-08-07 10:42:11 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@66bf349f) 2013-08-07 10:42:11 [iNFO] [Minecraft-Server] Preparing start region for level 0 2013-08-07 10:42:13 [iNFO] [sTDOUT] loading single player 2013-08-07 10:42:13 [iNFO] [Minecraft-Server] Player659[/127.0.0.1:0] logged in with entity id 346 at (-126.2266029604828, 70.0, 246.11333630926705) 2013-08-07 10:42:28 [iNFO] [Minecraft-Server] Saving and pausing game... 2013-08-07 10:42:28 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2013-08-07 10:42:28 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2013-08-07 10:42:28 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End 2013-08-07 10:42:29 [iNFO] [Minecraft-Server] Stopping server 2013-08-07 10:42:29 [iNFO] [Minecraft-Server] Saving players 2013-08-07 10:42:29 [iNFO] [Minecraft-Server] Saving worlds 2013-08-07 10:42:29 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2013-08-07 10:42:29 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2013-08-07 10:42:29 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End 2013-08-07 10:42:29 [iNFO] [ForgeModLoader] Unloading dimension 0 2013-08-07 10:42:29 [iNFO] [ForgeModLoader] Unloading dimension -1 2013-08-07 10:42:29 [iNFO] [ForgeModLoader] Unloading dimension 1 2013-08-07 10:42:31 [iNFO] [Minecraft-Client] Stopping! 2013-08-07 10:42:31 [iNFO] [sTDOUT] 2013-08-07 10:42:31 [iNFO] [sTDOUT] SoundSystem shutting down... 2013-08-07 10:42:31 [iNFO] [sTDOUT] Author: Paul Lamb, www.paulscode.com 2013-08-07 10:42:31 [iNFO] [sTDOUT]
August 7, 201312 yr before i dig in further, can you move it from preinit to init ? and try again ? (specially look out for the error in the logs ) it wouldnt be bad trying it but in my case it didnt trigger any error :\ how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 7, 201312 yr aaaaaaaaahhhhhhhhhhhh nvm i foudn it, turn out you cannot make a RenderLivingEvent because its an abstract class you must either make a RenderLivingEvent.Pre or RenderLivingEvent.Post (use pre) aka @ForgeSubscribe public void handlerRenderLiving(RenderLivingEvent.Pre event){ //usual render code } how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
August 7, 201312 yr I think I might use ogl for something like this. It's a little dirtier, but you're allowed more flexibility. here's some example code: @ForgeSubscribe public void render(RenderWorldLastEvent event) { //allows for rendering relative to you EntityClientPlayerMP player = mc.thePlayer; double playerX = player.prevPosX + (player.posX - player.prevPosX) * event.partialTicks; double playerY = player.prevPosY + (player.posY - player.prevPosY) * event.partialTicks; double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * event.partialTicks; //keep in mind that the event.partial ticks is important - it's taken from the event RenderWorldLastEvent //you can just put the partial ticks in your function call if you dont want to render from the same //function that you subscribe to the event system. //starts ogl rendering and things GL11.glPushMatrix(); //makes sure we get the right type of render GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glLineWidth(6); //translates your draw space to wherever you are GL11.glTranslated(-playerX, -playerY, -playerZ); GL11.glColor3ub((byte)253,(byte)0,(byte)0); //sets our draw focus relaltive to us. Just a stupid little variable. In this case, //I'm drawing a line at 9,9,9. However, you can just draw whatever you want using what //-ever coordinates you choose. float mx = 9; float my = 9; float mz = 9; //drawing stuff. OGL should have a text draw function, as well as texture rendering. //you'll have to look up how to import textures and stuff with ogl. //also, you'll need to learn more about ogl. It's probably worth it in the end. GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST ); GL11.glBegin(GL11.GL_LINE_STRIP); GL11.glVertex3f(mx,my,mz+1f); GL11.glVertex3f(mx,my,mz-1f); GL11.glEnd(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); } You'll also need to learn a little about forge events and how they're handled. It's good experience though.
August 7, 201312 yr the tessellator is an api build on top of opengl , when you're using the tessellator, you're using opengl directly also, hes trying to draw triangles (2 to make a quad) GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST ); GL11.glBegin(GL11.GL_LINE_STRIP); not lines yet it reassures me to see someone else with openGL knowledge. how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
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.