Jump to content

Large rectangle appears when entity shot?


Fruitsalid

Recommended Posts

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-

Link to comment
Share on other sites

<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-

Link to comment
Share on other sites

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-

Link to comment
Share on other sites

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;
}
}

Link to comment
Share on other sites

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-

Link to comment
Share on other sites

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.