Jump to content

Changes in the users inventory


02JanDal

Recommended Posts

Hello,

 

I would like to do some changes the users inventory, namely adding another "armor" slot only allowing (and shift-click accepting only one (maybe more later) item. This should be a backpack slot, and depending on if and which item (backpack) is in the slot I want to adjust the number of slots available to the user. For the beginning I want no backpack to only be 9 items (the hot bar) and one backpack should be 3 rows (27 slots).

 

This is my first mod, but I have so far managed to create the backpack (and made it craftable), and the next step is to A. Add another armor slot and B. Be able to dynamically change the number of slots in the users inventory (when made smaller, items not fitting anymore should just be thrown on the floor).

 

I have read the "Containers and GUIs" tutorial, but I don't want to change everything (as that would mean a lot of duplicate code). Would it be possible to do this in someway with out changing everything? I think that I have created a working class that extends ContainerPlayer and I think I know how I should do for the InventoryPlayer to (and then I simply set EntityPlayer.inventory and EntityPlayer.inventoryContainer to my new classes), but how should I do for the GUI???

 

Here is my ContainerPlayer extending class: http://paste.minecraftforge.net/view/be8a71af

 

Thanks in advance

Link to comment
Share on other sites

instead of trying to edit the inventory screen you could just have it so that when you right click with the backpack you the equivilent of a chest and the you could have different size backpacks easier. i dont know how do that either but its a damn sight lot more easier than your prev ideas.

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

That would very likely be a lot easier, but it's for the first already done (I think Forestry) and second that's not the idea. The real idea is that the player should always have less inventory space than now, but have a bit more with a backpack, so I would still have to edit the inventory GUI.

Link to comment
Share on other sites

Ok first of all the idea of adding extra ingame menu slots wouldn't work unless you edit guiInGame and to add another slot you have to edit the inventory gui and container as well this is just something i though as the extra rows would take up a lot of the space in the game

Link to comment
Share on other sites

Ok, I took a look at the source for NEI which edits some base classes to change things and well...

Going to do something else...

I think I could get access transformers working, but... well...

 

Should at least a hook to add extra "armor" slots be something that would be nice to have in forge? There are loads of other mods too that are doing things like this too (I don't remember the name, but there was one that adds glowes, capes etc.)

Inventory size might be a bit to specific though.

 

Jan

Link to comment
Share on other sites

http://www.minecraftforum.net/topic/1688664-147-sspsmp-v71-rpg-inventory-mod-3d-items-jewelery-capes-and-much-more/

 

that one ?

 

only one i know with capes and jewels :P

mine btw.

 

I can tell for sure that adding an inventory like this is a real b*tch. not talking about smp compatibility x.x

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.