Jump to content

[SOLVED][1.7.10] - Problem with getIcon


Agravaine

Recommended Posts

Hello.

public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
	return FMLClientHandler.instance().getClientPlayerEntity().capabilities.isCreativeMode ? super.getIcon(world, x, y, z, side) : iconEmpty;
}

Block texture changes only when I update the blocks in the chunk (destroy, put etc).

How to make it so that when the player was of creative mode texture change immediately?

Link to comment
Share on other sites

Thanks!

 

public class TextureBarrier extends TextureAtlasSprite{

public TextureBarrier(String name){
	super(name);
}

public void updateAnimation(){
	if(!framesTextureData.isEmpty()){
		Minecraft minecraft = Minecraft.getMinecraft();

		int prevFrameCount;

		if(minecraft.thePlayer != null && minecraft.thePlayer.capabilities.isCreativeMode){
			prevFrameCount = 0;
		}else{
			prevFrameCount = 1;
		}

		if(prevFrameCount != frameCounter){
			frameCounter = prevFrameCount;
			TextureUtil.uploadTextureMipmap((int[][])framesTextureData.get(frameCounter), width, height, originX, originY, false, false);
		}
	}
}
}

 

Solved.

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.

Announcements



×
×
  • Create New...

Important Information

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