Jump to content

[Solved][1.8.9] Dynamically change the texture of the vanilla sign


Aulig

Recommended Posts

Hello,

 

Id like to change the texture of the sign (either only if its on a wall or in both states) if it says a specified text in line 3.

My mod is clientside only and id like to keep it that way; i know its possible to do it as "labymod"(a clientside mod) does it.

	if(world.getBlockState(BlockPosCurr).getBlock() == Blocks.standing_sign || world.getBlockState(BlockPosCurr).getBlock() == Blocks.wall_sign){

		TileEntitySign sign = (TileEntitySign) world.getTileEntity(BlockPosCurr);
		IChatComponent text = sign.signText[2];
		IChatComponent searched = new ChatComponentText("test");

		if(text.equals(searched)){
		//edit texture
		}
	}

 

Link to comment
Share on other sites

You'll either need to create a new

TileEntitySpecialRenderer

that renders signs your way and register it for

TileEntitySign.class

using

ClientRegistry#bindTileEntitySpecialRenderer

or use ASM to modify

TileEntitySignRenderer

.

 

Side note: Why are you using 1.8.8? 1.8.9 has received far more updates and 1.9 is now the recommended version.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

good thing you pointed that out, ive been using 1.8.9 for a bit now but kept naming my questions 1.8.8 by habit. sorry about that  :-\. Does it make any difference in this case though? Also Im not using 1.9 as my mod is designed to help on minigame servers which mostly use 1.8 still. This feature is intended to make spotting servers that have a free slot available easier (If you have an easier idea than changing the signs color - Im open to suggestions  :) )

Link to comment
Share on other sites

good thing you pointed that out, ive been using 1.8.9 for a bit now but kept naming my questions 1.8.8 by habit. sorry about that  :-\. Does it make any difference in this case though?

There's no difference in this case, no.

 

Also Im not using 1.9 as my mod is designed to help on minigame servers which mostly use 1.8 still. This feature is intended to make spotting servers that have a free slot available easier (If you have an easier idea than changing the signs color - Im open to suggestions  :) )

I can't think of any better way to do what you want.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.