Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I just made a CustomBlockRenderer(ISimpleBlockRenderingHandler),beacos i want to make somting like vine,but it will be not based on metadata,but on the is there block or no.From my tryes,i did rendering just of 2 sides(Z pos and neg).But now,when i did add X pos and neg,it just dont want to work...just dont rendering them...at all...My render code:


public class LightRenderer implements ISimpleBlockRenderingHandler {

@Override
public void renderInventoryBlock(Block block, int metadata, int modelID,
		RenderBlocks renderer) {
}

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks r) {
	float f19 = 0.1F;
	Tessellator tessellator = Tessellator.instance;
//		if (world.getBlockId(x+1, y, z)!=0) {
	        tessellator.addTranslation(f19, 0.0F,0.0F);
	 	r.renderFaceXNeg(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		r.renderFaceXPos(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		tessellator.addTranslation(-f19, 0.0F,0.0F);
//		}
//		if (world.getBlockId(x-1, y, z)!=0) {
		tessellator.addTranslation(-f19+1, 0.0F,0.0F);
		r.renderFaceXNeg(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		r.renderFaceXPos(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		tessellator.addTranslation(f19-1, 0.0F,0.0F);
//		}
//		if (world.getBlockId(x, y, z-1)!=0) { 
		tessellator.addTranslation(0.0f, 0.0f,f19);
		r.renderFaceZPos(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		r.renderFaceZNeg(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		tessellator.addTranslation(0.0f, 0.0f,-f19); 
//		}
//		if (world.getBlockId(x, y, z+1)!=0) {
		tessellator.addTranslation(0.0f, 0.0f,-f19+1);
		r.renderFaceZPos(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		r.renderFaceZNeg(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));
		tessellator.addTranslation(0.0f, 0.0f,f19-1);
//		}
	return true;
}

@Override
public boolean shouldRender3DInInventory() {
	return false;
}

@Override
public int getRenderId() {
	return ClientProxy.LightRenderID;
}

}

All other code works fine(its registrading kk,and works all fine),but the render X pos+neg...its just dont wont to work...

beacos

somting

tryes

registrading

 

Ow, my English. >..x

I have no idea what your problem actually is.  I can't read your post.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

X pos,and X neg sides dont render,but Z pos+Z neg sides work fine(X pos side-side that you can see from X+1 block,and it the nearest side)

 

edit:forgot to add a screen shot:

http://snag.gy/uVUnm.jpg

X pos,and X neg sides dont render,but Z pos+Z neg sides work fine(X pos side-side that you can see from X+1 block,and it the nearest side)

 

edit:forgot to add a screen shot:

http://snag.gy/uVUnm.jpg

 

Zpos and Zneg are not working correctly if you have both rendering with only a block at Zpos and none at Zneg (or vice versa if you're facing north).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

so are you want to say,what side can be "seen" only from one of the its "sides"?) What is a problem with rendering only- you will see it only from one side,let me explain what i mean...beacos i'm bad in englesh.

                                                  ___

My block                                  > |      | < My block

We will not see oposite side  > |___| < If we are stading here,we will see that side

 

soo,i need to render Z pos,and Z neg in one place at the same time...i think what will be easyer to me-just use pure OpenGL,and not MC's render engine....

soo,i need to render Z pos,and Z neg in one place at the same time...i think what will be easyer to me-just use pure OpenGL,and not MC's render engine....

 

His code is doing that, actually.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Oh I see, the if statements are commented, didn't notice that.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

that is normal,for a lot of people ;)

 

p.s. if you see evrything-you not a man,you a computer/machine/robot =)

 

 

 

 

Beep beep boop boop.  Errorͤͬͬͦͬ parsing post.ͬͦͬͬͤ̄ͤͩͦͨ̄ͦͨͣͬͩ

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Hi

 

There's  a few things here about custom rendering that might help (see the Block Rendering sections)

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

 

Are you rendering in pass 0 or pass 1?

 

From looking at your code I don't see an obvious problem

 

A couple of suggestions to try -

* you could try rendering in pass 1 - all faces are double-sided in pass 1 unlike pass 0 - so you only need to render one

* you could try turning off cull face

        GL11.glDisable(GL11.GL_CULL_FACE);

(don't forget to reenable after)

        GL11.glEnable(GL11.GL_CULL_FACE);

* you could try moving the two faces slightly apart

        tessellator.addTranslation(f19, 0.0F,0.0F);

r.renderFaceXNeg(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));

tessellator.addTranslation(0.001F, 0.0F, 0.0F);

r.renderFaceXPos(block, (double)x, (double)y, (double)z, r.getBlockIcon(block, r.blockAccess, x, y, z, 0));

tessellator.addTranslation(-f19-0.001F, 0.0F,0.0F);

 

-TGG

 

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.