Jump to content

Recommended Posts

Posted

Hello everybody,

 

my mod is growing and i am thinking of making a "book" like the one from Tinker Construct or Draconic Evolution, but i am programming in 1.8.

Is there any guide or something like that where i can learn it? Or can someone tell me how to do it?

 

Thanks for the answers,

 

Kaneka

Posted

All right, here are some of the requirements:

[*]The item you intent to become your book

[*]A IGuiHandler

[*]The book's gui

[*]Some content to test the gui (I suggest lorem ipsum)

 

Those are the things you need. Can you figure out from these how to do it or do you want some more help.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

All right, here are some of the requirements:

[*]The item you intent to become your book

[*]A IGuiHandler

[*]The book's gui

[*]Some content to test the gui (I suggest lorem ipsum)

 

Those are the things you need. Can you figure out from these how to do it or do you want some more help.

 

Not quite. You don't need an IGuiHandler if your GUI doesn't have a Container (i.e. if it doesn't contain slots with items in it).

 

A book like this only needs to function on the client side. So all you need to do is create a class that extends GuiScreen and uses an image background that is like paper of a book, and has buttons to flip the pages. Then you just draw the text and change the text displayed when a page turning button is pressed.

 

I have some explanation of how to create and open a GUI here: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-gui-and-input.html

 

If you want an example of a book GUI, you can check out my Magic Beans mod code where I tell the story of Jack and the Beanstalk in a book-like GUI: https://github.com/jabelar/MagicBeans-1.8fixed/blob/master/src/main/java/com/blogspot/jabelarminecraft/magicbeans/gui/GuiFamilyCow.java

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

All right, here are some of the requirements:

[*]The item you intent to become your book

[*]A IGuiHandler

[*]The book's gui

[*]Some content to test the gui (I suggest lorem ipsum)

 

Those are the things you need. Can you figure out from these how to do it or do you want some more help.

 

Not quite. You don't need an IGuiHandler if your GUI doesn't have a Container (i.e. if it doesn't contain slots with items in it).

 

Really? Well if that's the case, just follow what Jabelar here said. But I seriously remember that you need an IGuiHandler for even just client-only GUIs. Oh well.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

Really? Well if that's the case, just follow what Jabelar here said. But I seriously remember that you need an IGuiHandler for even just client-only GUIs. Oh well.

I don't think 'need' is the correct term, but it doesn't hurt anything if you do, and then you can open all of your GUIs using the player#openGui method. Personally, I would recommend having an IGuiHandler for all GUIs, not just Container-based ones.

Posted

Thanks all for the answers, i already got a IGuiHandler in my mod, cause i have planty machines in it with GUI. Hope i can manage to add this to my mod, cause it is complex enought and if you have to go to my minecraftforum thread to check everything, this isnt effectiv :D

 

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.

×
×
  • Create New...

Important Information

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