Posted July 18, 201312 yr When I aim at the ground and shoot the gun I made, a large rectangle, the same color as the entity (bullet) just flashes in front of my view. In third person I can see it's roughly 4 blocks wide and 3 high. Completely flat. How can I fix this?
July 18, 201312 yr you would have to 1 change the entity size and 2 make a renderer (like i said earlier). EntityThrowable will always be rendered in a way that will make them look like the image is facing the player, if you want to have more realistic bullet you're gonna have to make a class extends Render and register it in your client proxy how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 18, 201312 yr Author I've already made a render class for the bullet. It works fine and looks like I want it to. When I shoot it fires and does damage and interacts with mobs. I've registered it in the proxy. But when I look down and shoot the white rectangle flashes.
July 18, 201312 yr <troll> pic or it didnt happen </troll> no no just kidding, but srly can we have some pic / video so we can understand whats going on because since you are usign a renderer, the problem can now be anything, maybe its you graphic card, maybe your opengl 1 setting are in an odd state causing this effect etc etc how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 18, 201312 yr Author It seems to appear on random living entities. But only one at a time. And how do I use this insert image thing? lol
July 18, 201312 yr It seems to appear on random living entities It : the visual problem ? as like, randomly cows will start flickering/changing color or wtv is it that your visual bug do ? how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 18, 201312 yr use imagebin or wtv how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 18, 201312 yr damn, can you show us the render code ? how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 18, 201312 yr Author public class RenderLaser extends Render { int red = 200; int green = 40; int blue = 40; int alpha = 250; @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { this.func_110777_b(entity); GL11.glPushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glTranslatef((float)d0, (float)d1, (float)d2); GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1 - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); Tessellator tessellator = Tessellator.instance; tessellator.setColorRGBA(red, green, blue, alpha); byte b0 = 0; float f2 = 0.0F; float f3 = 0.5F; float f4 = (float)(0 + b0 * 10) / 32.0F; float f5 = (float)(5 + b0 * 10) / 32.0F; float f6 = 0.0F; float f7 = 0.15625F; float f8 = (float)(5 + b0 * 10) / 32.0F; float f9 = (float)(10 + b0 * 10) / 32.0F; float f10 = 0.05625F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); GL11.glScalef(f10, f10, f10); GL11.glTranslatef(-4.0F, 0.0F, 0.0F); GL11.glNormal3f(f10, 0.0F, 0.0F); for (int i = 0; i < 4; ++i) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, f10); tessellator.startDrawingQuads(); tessellator.setColorRGBA(red, green, blue, alpha); tessellator.addVertex(-8.0D, -2.0D, 0.0D); tessellator.addVertex(8.0D, -2.0D, 0.0D); tessellator.addVertex(8.0D, 2.0D, 0.0D); tessellator.addVertex(-8.0D, 2.0D, 0.0D); tessellator.draw(); } GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } @Override protected ResourceLocation func_110775_a(Entity entity) { return null; } }
July 18, 201312 yr ok, well 2 things, either this code is copy pasted, either you name your variable in very weird ways (f1, f2, f3, f4, f5, f6) in either case im not suuure exactly where the problem is because im not sure hat youre trying to do but honestly by looking at the code it seems that the picture is doign EXACTLY what you asked it to do... tessellator.addVertex(-8.0D, -2.0D, 0.0D); tessellator.addVertex(8.0D, -2.0D, 0.0D); tessellator.addVertex(8.0D, 2.0D, 0.0D); tessellator.addVertex(-8.0D, 2.0D, 0.0D); ^ this is a pretty big rectangle actually GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); ^ blending is enabled so you expect your bolt to be transparent, texture2D are DISABLED, so no image on your bullets and lighting disabled... result may vary since its LWJGL and opengl1 i would try to play with glEnable/glDisable those 3 thing above. other then that, if you want to play if safe, remove a MAX ammount of code and add little by little and hum ..... if you dont know what the code is doing ... try understanding first ... usually copy paste dont get prople very far ..... sorry if its mean :\ how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 18, 201312 yr Author I was rushing so I didn't bother looking it over but thanks and no it's not mean lol.
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.