Jump to content

How can I create a custom sign?


Flenix

Recommended Posts

Hey guys,

 

I want to make a few of my own signs (kind of similar to the vanilla signs)

The main difference will be shape, and the position/amount of lines or characters that can be written.

 

I tried copying the vanilla sign block + entity classes to experiment, but eclipse wasn't very happy about that (It kept telling me I had to create a constructor, then I'd create it and it'd tell me it was wrong...)  Can anyone point me in the right direction?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

"it'd tell me it was wrong"? How so?

 

Well, it'd ask me to create a constructor. I'd click the link to auto-make it, and get this:

 

    public TileEntityRoadSignBlock(int roadSignID, Class par2Class, boolean par3) {

    //Todo: Auto Generated Stub

}

 

So, obviously I needed to add a few things, so I added:

 

super(roadSignID, Material.iron);

this.isFreestanding = par3;

 

and also

    private Class signEntityClass;

(All of which are directly from the Sign's block class)

 

Then it accepts that as no errors, but back in my main block class it simply tells me I need a constructor again and would auto-create that same thing, going around in circles.

 

 

 

I'm not quite sure what I did, but I seem to have fixed it again now. However, when I try and place the sign in-game I get "Unable to locate sign at [coords]"

You seem to know literally everything about Forge.. any idea what I'm missing? :P I've registered the tile entity so I'm not sure what else there is. Maybe the sign has another class that I've not found yet?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

"it'd tell me it was wrong"? How so?

 

Well, it'd ask me to create a constructor. I'd click the link to auto-make it, and get this:

 

    public TileEntityRoadSignBlock(int roadSignID, Class par2Class, boolean par3) {

    //Todo: Auto Generated Stub

}

 

So, obviously I needed to add a few things, so I added:

 

super(roadSignID, Material.iron);

this.isFreestanding = par3;

 

and also

    private Class signEntityClass;

(All of which are directly from the Sign's block class)

 

Then it accepts that as no errors, but back in my main block class it simply tells me I need a constructor again and would auto-create that same thing, going around in circles.

 

 

 

I'm not quite sure what I did, but I seem to have fixed it again now. However, when I try and place the sign in-game I get "Unable to locate sign at [coords]"

You seem to know literally everything about Forge.. any idea what I'm missing? :P I've registered the tile entity so I'm not sure what else there is. Maybe the sign has another class that I've not found yet?

That would seem more like a Java problem or an Eclipse problem. Did you copy TESign or extend TESign? Because I just did both, and I didn't get any errors for either. Besides, TESign doesn't have a constructor (oddly enough, it gets intialized by reflection), and the constructor you wrote matched instead BlockSign. When I copy BlockSign, it works (no compile errors anyway), and when I extend it, it asks for the constructor, which I give to it, matching your code, and Eclipse is satisfied.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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.