Rendering issue with my mod [SOLVED]

This forum is for anything that doesn't specifically have to do with Better Than Wolves
Post Reply
User avatar
sargunv
Site Admin
Posts: 557
Joined: Mon Nov 22, 2010 11:46 am
Location: Seattle, WA, USA

Rendering issue with my mod [SOLVED]

Post by sargunv »

I've been making a mod recently, and I just finished making all the functionality I want. However, I've run into a problem with custom rendering for blocks. My block looks fine when it is just sitting there, but when I start breaking it, the colors look strange:

Normal:
Spoiler
Show
Image
While breaking:
Spoiler
Show
Image
Does anyone here know what's going on or how to fix it?

EDIT: The relevant code:
in mod_SVJuice:
Spoiler
Show

Code: Select all

	@Override
	public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess world, int x, int y, int z, Block block, int renderID) {
		if (renderID == blockJuiceContainerRenderID)
			return renderBlockJuiceContainerWorld(world, (SVBlockJuiceContainer) block, x, y, z, renderblocks);
		else if (renderID == blockJuiceMakerRenderID)
			return renderBlockJuiceMakerWorld(world, (SVBlockJuiceMaker) block, x, y, z, renderblocks);
		return false;
	}
	private boolean renderBlockJuiceMakerWorld(IBlockAccess world, SVBlockJuiceMaker block, int x, int y, int z, RenderBlocks renderblocks) {
		int tex = -1;

		tex = Block.stone.blockIndexInTexture;
		SVRenderHelper.renderWorldWalls(renderblocks, block, x, y, z, 0F, block.floor, 0.5F - block.hole / 2, tex);

		tex = Block.planks.blockIndexInTexture;
		SVRenderHelper.renderWorldWalls(renderblocks, block, x, y, z, block.floor, 1F, block.wall, tex);

		tex = Block.fenceIron.blockIndexInTexture;
		SVRenderHelper.renderWorldCube(renderblocks, block, x, y, z, block.wall, block.floor + 0.05F, block.wall, 1F - block.wall,
				block.floor + 0.1F, 1F - block.wall, tex);

		return true;
	}
In SVRenderHelper:
Spoiler
Show

Code: Select all

	public static void renderWorldCube(RenderBlocks renderblocks, Block block, int x, int y, int z, float minx, float miny, float minz, float maxx,
			float maxy, float maxz, int tex) {
		renderblocks.overrideBlockTexture = tex;
		block.setBlockBounds(minx, miny, minz, maxx, maxy, maxz);
		renderblocks.renderStandardBlock(block, x, y, z);
		renderblocks.overrideBlockTexture = -1;
	}
	public static void renderWorldWalls(RenderBlocks renderblocks, Block block, int x, int y, int z, float bottom, float top, float thick, int tex) {
		renderWorldCube(renderblocks, block, x, y, z, 0F, bottom, 0F, thick, top, 1F, tex);
		renderWorldCube(renderblocks, block, x, y, z, 1F - thick, bottom, 0F, 1F, top, 1F, tex);
		renderWorldCube(renderblocks, block, x, y, z, thick, bottom, 0F, 1F - thick, top, thick, tex);
		renderWorldCube(renderblocks, block, x, y, z, thick, bottom, 1F - thick, 1F - thick, top, 1F, tex);
	}
If you need any other parts, just ask. :)
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Rendering issue with my mod

Post by FlowerChild »

That's really weird man. I don't think I've run into that before.
User avatar
destineternel
Posts: 343
Joined: Wed Feb 15, 2012 9:09 pm
Location: lost in the dark reaches of my mind

Re: Rendering issue with my mod

Post by destineternel »

I've seen color change like that happen with block breaking when people are using the shaders mod.
<DaveYanakov> I know I overuse them and put them in inappropriate places but they just feel so good.
<icynewyear> shit is delicious
<MagikEh> Don't try to give me da D
User avatar
BinoAl
Posts: 2552
Joined: Mon Jul 04, 2011 9:39 pm
Location: Everywhere.

Re: Rendering issue with my mod

Post by BinoAl »

Anyone else incredibly curious about this mod? :)
Image
User avatar
Caboose
Posts: 281
Joined: Tue Jul 05, 2011 11:15 pm
Location: Dinotopia, Michigan

Re: Rendering issue with my mod

Post by Caboose »

BinoAl wrote:Anyone else incredibly curious about this mod? :)
My interest is totally piqued too.
User avatar
PureZaros
Posts: 151
Joined: Mon Jul 04, 2011 9:35 pm
Location: With a herd of alpaca in the La Raya mountains

Re: Rendering issue with my mod

Post by PureZaros »

Is the breaking animation not fully transparent? I've seen that happen before in a Texture Pack that screwed up the breaking animation. The blocks whitened.
Spoiler
Show
FlowerChild wrote:
Panda wrote:Edit: Thanks for the sticky good sir. <3
I really wish more women said things like this.
User avatar
sargunv
Site Admin
Posts: 557
Joined: Mon Nov 22, 2010 11:46 am
Location: Seattle, WA, USA

Re: Rendering issue with my mod

Post by sargunv »

PureZaros wrote:Is the breaking animation not fully transparent? I've seen that happen before in a Texture Pack that screwed up the breaking animation. The blocks whitened.
The animation doesn't show up at all. These weird colors happen instead. :/
BinoAl wrote:Anyone else incredibly curious about this mod? :)
The mod should be ready to release as soon as I fix this little issue. :)
FlowerChild wrote:That's really weird man. I don't think I've run into that before.
Hmm... I hate to ask this, but do you mind if I look at how you render some of your blocks (probably the Axle or Hopper) to see what I'm doing differently? I really can't think of anything else to try. :(
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Rendering issue with my mod

Post by FlowerChild »

sargunster wrote: Hmm... I hate to ask this, but do you mind if I look at how you render some of your blocks (probably the Axle or Hopper) to see what I'm doing differently? I really can't think of anything else to try. :(
Go for it man. After everything you've done for me, it's the absolute least I could do in return.

Let me know if you'd like any additional help BTW. Feel free to PM me with any specific questions you may have, as while I'm not generally into providing that kind of support, I owe you a debt of gratitude for these forums that I'd be very happy to be able to repay in some small way.
User avatar
sargunv
Site Admin
Posts: 557
Joined: Mon Nov 22, 2010 11:46 am
Location: Seattle, WA, USA

Re: Rendering issue with my mod [SOLVED]

Post by sargunv »

The problem was fixed with FC's help. I just want to do a little final testing before releasing it. I'll put a link here to the MCForum thread for those of you that are interested. :)
User avatar
sargunv
Site Admin
Posts: 557
Joined: Mon Nov 22, 2010 11:46 am
Location: Seattle, WA, USA

Re: Rendering issue with my mod [SOLVED]

Post by sargunv »

Here it is: http://www.minecraftforum.net/topic/124 ... sters-mod/

I'll make a thread on this forum once I make the BTW addon.
Post Reply