Jump to content

Rendering block and layering it with a texture. 1.15.2


AntonBespoiasov

Recommended Posts

public class UnderInstrumentsConstructionTileEntity extends ModTileEntity
{
	public static TileEntityType<UnderInstrumentsConstructionTileEntity> TYPE;
	
	public BlockState state;

	
	public UnderInstrumentsConstructionTileEntity(TileEntityType<?> tileEntityTypeIn)
	{
		super(TYPE);
	}


	@Override
	public CompoundNBT writeData(CompoundNBT nbt)
	{
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void readData(CompoundNBT nbt)
	{
		// TODO Auto-generated method stub
		
	}
	
	
	class ThisTER extends TileEntityRenderer<UnderInstrumentsConstructionTileEntity>
	{
		public ThisTER(TileEntityRendererDispatcher p_i226006_1_)
		{
			super(p_i226006_1_);
		}

		@Override
		public void func_225616_a_(UnderInstrumentsConstructionTileEntity te, float f, MatrixStack matrix,
				IRenderTypeBuffer buf, int i, int i2)
		{	
			Minecraft.getInstance().getBlockRendererDispatcher().renderBlock(te.state, matrix, buf, i, OverlayTexture.field_229196_a_, EmptyModelData.INSTANCE); // TODO: Find right 4th param
		}	
	}
}

I want to create a block that will store information about another block needed to render it(e.g. this block will store block state of a fence block and then using this block state to render right model of fence). Also I want the block to be layered with some texture.

Writing above code I was stuck finding a way to render the texture(I haven't written static field storing it yet) and make it wrap around cube in the world.
I thing that using TER in this case probably isn't the right way and I should do something with my own implementation of IBakedModel.

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.



×
×
  • Create New...

Important Information

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