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 have an ISBRH for a custom crop. In eclipse, it looks fine and renders the way it should, but outside eclipse, the block goes back and forth between rendering as a normal block and rendering the way it should.

Heres how its supposed to look:

 

 

e7619ea8-3577-11e4-8f03-816c999a14bc.png

 

 

And heres how it often looks:

 

 

04177e1e-3578-11e4-8a1c-d094eb10141c.png

 

 

 

Heres the rendering class:

public class RenderSoyPlant implements ISimpleBlockRenderingHandler{

public static int renderId;
private Tessellator t = Tessellator.instance;

public RenderSoyPlant(){
	renderId = RenderingRegistry.getNextAvailableRenderId();
}

@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 renderer) {

	IIcon icon = block.getIcon(0, world.getBlockMetadata(x, y, z));

	double u = icon.getMinU();
	double v = icon.getMinV();
	double U = icon.getMaxU();
	double V = icon.getMaxV();

	t.addTranslation(x, y, z);
	int lightValue = block.getMixedBrightnessForBlock(world, (int)x, (int)y, (int)z);
	t.setBrightness(lightValue);
	t.setColorOpaque_F(1.0F, 1.0F, 1.0F);
	renderer.renderStandardBlockWithAmbientOcclusion(block, (int)x, (int)y, (int)z, lightValue, lightValue, lightValue);

	renderModel(u, v, U, V);

	t.addTranslation(-x, -y, -z);

	return true;
}

private void renderModel(double u, double v, double U, double V){
	t.addVertexWithUV(0.5, 1, 1, u, v);
	t.addVertexWithUV(0.5, 1, 0, U, v);
	t.addVertexWithUV(0.5, 0, 0, U, V);
	t.addVertexWithUV(0.5, 0, 1, u, V);
	t.addVertexWithUV(0.5, 1, 0, U, v);
	t.addVertexWithUV(0.5, 1, 1, u, v);
	t.addVertexWithUV(0.5, 0, 1, u, V);
	t.addVertexWithUV(0.5, 0, 0, U, V);

	t.addVertexWithUV(1, 1, 0.5, u, v);
	t.addVertexWithUV(0, 1, 0.5, U, v);
	t.addVertexWithUV(0, 0, 0.5, U, V);
	t.addVertexWithUV(1, 0, 0.5, u, V);
	t.addVertexWithUV(0, 1, 0.5, U, v);
	t.addVertexWithUV(1, 1, 0.5, u, v);
	t.addVertexWithUV(1, 0, 0.5, u, V);
	t.addVertexWithUV(0, 0, 0.5, U, V);

	t.addVertexWithUV(0.825, 1, 0.825, u, v);
	t.addVertexWithUV(0.125, 1, 0.125, U, v);
	t.addVertexWithUV(0.125, 0, 0.125, U, V);
	t.addVertexWithUV(0.825, 0, 0.825, u, V);
	t.addVertexWithUV(0.125, 1, 0.125, U, v);
	t.addVertexWithUV(0.825, 1, 0.825, u, v);
	t.addVertexWithUV(0.825, 0, 0.825, u, V);
	t.addVertexWithUV(0.125, 0, 0.125, U, V);

	t.addVertexWithUV(0.825, 1, 0.125, u, v);
	t.addVertexWithUV(0.125, 1, 0.825, U, v);
	t.addVertexWithUV(0.125, 0, 0.825, U, V);
	t.addVertexWithUV(0.825, 0, 0.125, u, V);
	t.addVertexWithUV(0.125, 1, 0.825, U, v);
	t.addVertexWithUV(0.825, 1, 0.125, u, v);
	t.addVertexWithUV(0.825, 0, 0.125, u, V);
	t.addVertexWithUV(0.125, 0, 0.825, U, V);
}

@Override
public boolean shouldRender3DInInventory(int modelId) {
	return false;
}
@Override
public int getRenderId() {
	return renderId;
}
}

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Hi

 

That's quite odd.  It looks to me like it's trying to render as a standard cut-down block using your texture for all six sides.

 

What is this line in there for?

renderer.renderStandardBlockWithAmbientOcclusion(block, (int)x, (int)y, (int)z, lightValue, lightValue, lightValue);

 

First thing I would I suggest you try:

add System.out.println("renderWorldBlock()") to your method and see if is still getting called when the rendering goes strange.

 

-TGG

 

 

 

  • Author

It wasn't getting called, but it turns out it was an optifine problem, so sorry for wasting your time.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

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.