Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

client side double chest?


Recommended Posts

upon testing for a while, i finally figured out a way to display client side chests. now, the problem is trying to open a double chest.

 

does anyone know how i could do this without creating a whole new class just for a custom client side chest?

Link to post
Share on other sites
3 hours ago, diesieben07 said:

What is a client-side chest? You cannot make custom inventories with just a client-side mod... inventories need storage, which requires a server-side mod.

Elaborate.

TileEntityChest chest = (TileEntityChest) Utils.mc.theWorld.getTileEntity(CopyChest.chestPos);
chest.setInventorySlotContents(20, new ItemStack(Items.apple, 64));
Utils.mc.thePlayer.displayGUIChest(chest);

this is an example. i'm opening a Tile Entity Chest client side and inserting client side items. however, this is a single chest, and im trying to figure out how to open a double.

Link to post
Share on other sites
19 hours ago, D0XY said:

TileEntityChest chest = (TileEntityChest) Utils.mc.theWorld.getTileEntity(CopyChest.chestPos);
chest.setInventorySlotContents(20, new ItemStack(Items.apple, 64));
Utils.mc.thePlayer.displayGUIChest(chest);

this is an example. i'm opening a Tile Entity Chest client side and inserting client side items. however, this is a single chest, and im trying to figure out how to open a double.

This doesn't work.

Inventory manipulation must be done server-side to persist.

Link to post
Share on other sites
On 3/1/2020 at 5:37 AM, diesieben07 said:

This doesn't work.

Inventory manipulation must be done server-side to persist.

it doesn't need to persist.

 

i have already come up with a solution, which was to copy paste the InventoryEnderChest class and create and edit it to my liking. the point of my mod is to be able to open a chest you've opened previously from anywhere to check your contents. obviously you cant take items out as it is all client side.

Link to post
Share on other sites
On 3/2/2020 at 10:46 AM, D0XY said:

it doesn't need to persist.

 

i have already come up with a solution, which was to copy paste the InventoryEnderChest class and create and edit it to my liking. the point of my mod is to be able to open a chest you've opened previously from anywhere to check your contents. obviously you cant take items out as it is all client side.

Ok, it don‘t make much sense, but it is your mod. If here was one thing that i do not recommend is to copy a entire class and then simply change the name: never do this. If you really need to do it with that class the simply extends and override, else you will receive problems with Mojang then you have violate the copyright terms.

 

On 3/2/2020 at 10:46 AM, D0XY said:

obviously you cant take items out as it is all client side.

Ok, i never worked with chest, but i think that this was incorrect. You can put things while you are in the client side, yes, but first the items are not synchronized with the server. I don‘t know if this was true, but i think that this can cause that when a new chunk was loaded and the chunk, in them was your chest, was lose, then you will lose all your items that are in the chest since the don‘t are stored in the server. Second: yes, maybe you can‘t take out items (as you don‘t stored it in the server), but then the chest don‘t will have much sense: A Chest is to contain items, not a sort of trash in them you simply can put you items (like diamonds) and never can retrieve that what you have put in (yes, i know: bad english, and else you are making a troll mod i don‘t much understand).

Edited by DragonITA

New in Modding? == Still learning!

Link to post
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.

Guest
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 Privacy Policy.