Jump to content

Recommended Posts

Posted

I have a block with a custom amount of "power" in it, and I want the block to get brighter as there is more power.  I have three textures I want to use for different power ranges, but when the block gets into a new power range, it dosen't update.  If I place a block next to it, or force it to update, it works, but it won't work on it's own.  I think it might have something to do with textures being client-side and tile entities being server-side, but I dont know how to fix it.  Thanks in advance for any help.

 

Block:

 

  Reveal hidden contents

 

 

TileEntity:

 

  Reveal hidden contents

 

Posted

Hi

 

Block textures only update when there is a change.  When rendering Blocks, minecraft uses a 'cached renderlist'  that is only refreshed when the block changes.  So if you try to animate your Block using the Block rendering methods above, you won't see anything until the Block is changed or updated.

If you want your Block to be animated without updating it, you need to either use an animated texture for your Block, or use a TileEntity with TileEntitySpecialRender.

 

For more info see here

http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-world-more-details-including.html

 

-TGG

Posted

Actually all you have to do is update the block when you want the texture to change using

worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);

Just make sure you are also synchronising the client tile data with the server using

@Override
public Packet getDescriptionPacket() {
NBTTagCompound tagCompound = new NBTTagCompound();
this.writeToNBT(tagCompound);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tagCompound);
}

@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
readFromNBT(pkt.func_148857_g());
}

I am the author of Draconic Evolution

Posted

I have the renderer, but the texture flickers, and sometimes disapears.

 

Here's my code:

Renderer:

 

  Reveal hidden contents

 

Block:

 

  Reveal hidden contents

 

Posted

You probably have z-fighting. That's when two textures are fighting to get rendered. You see stripes of both textures and they change if you move. You can fix that by changing the z-level.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Thanks, I'm prety sure that's what it is, but now I'm using a model, which I like better anyway.

 

Does anyone know a way to get the texture not to float (like with redstone,where the texture is one pixel above the base block)?

Posted

The redstone block just has a small hitbox, and the part of the texture you see is the transparant part of the texture.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.