Jump to content

Recommended Posts

Posted

I'm trying to render a regular block model inside a TESR.

This is my code:

	@Override
	public void render(TileEntityRegeneratingOre te, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
	{

		IBlockState ore = te.getOre();

		Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
		BlockRendererDispatcher renderer = Minecraft.getMinecraft().getBlockRendererDispatcher();

		GlStateManager.pushMatrix();
		GlStateManager.translate(x, y, z);
		GlStateManager.rotate(-90, 0, 1, 0);

		renderer.renderBlockBrightness(te.getOre(), te.getWorld().getCombinedLight(new BlockPos(x, y, z), 0));
		
		GlStateManager.popMatrix();
	}

However, this produces a very dark block:

image.thumb.png.8eba501813ae7852e7ca2575e4124fa9.png

 

What can I do to fix this issue?

Also, how do I add the breaking animation and correct break particles? I tried looking at any of the vanilla TESR but didn't really get smarter from that...

 

Posted
  On 8/19/2019 at 2:07 PM, Tschipp said:

te.getWorld().getCombinedLight(new BlockPos(x, y, z), 0)

Expand  

The 0 you pass in there makes it always a 0. It will take which ever number is lower the actual light level or the passed in value.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 8/20/2019 at 11:38 AM, Animefan8888 said:

The 0 you pass in there makes it always a 0. It will take which ever number is lower the actual light level or the passed in value.

Expand  

I thought World#getCombinedLight uses which ever is larger, the passed in value or the neighbor block light.

 

Some tips:

  Reveal hidden contents

 

Posted
  On 8/20/2019 at 12:20 PM, DavidM said:

I thought World#getCombinedLight uses which ever is larger, the passed in value or the neighbor block light.

Expand  

Oops I read it reversed.
 

  On 8/19/2019 at 2:07 PM, Tschipp said:

renderBlockBrightness

Expand  

I think the actual problem is that this expects brightness to be a float 0-1 instead of 0-15. So divide by 15F.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.