Jump to content

[1.8.9] How can I move around a player's inventory client-side and send it to the server?


Recommended Posts

Posted

First off... I do have to use 1.8.9 because that's what the server is on. I'm using Forge 1.8.9-11.15.1.1722 with the classpaths from the 2.1 snapshot.

 

I'm trying to make a client-side inventory managing mod. I can move ItemStacks around fine in single-player, but I don't think that's gonna cut it for multiplayer. I've looked through the mod InventoryTweaks (1.8.9 version), but none of the packets reveal anything. I'd rather not look through the entire mod because it's pretty complex. I looked at the vanilla packets, but I can't find anything either.

 

Two vanilla packet types are sort of similar, C09PacketHeldItemChange and C10PacketCreativeInventoryAction, but neither handle moving items around in the inventory of a survival player. GuiInventory doesn't handle the moving of the items. GuiContainer seems to handle it, but only client-side, and doesn't send anything to the server.

 

It looks like the most likely option is using the InventoryPlayer class to change the player inventory, and the ContanerChest and similar container classes to change container inventories. The boolean inventoryChanged and method markDirty seem to be sort of what I'm looking for, but I can't find where they're used in the vanilla code—my IDE (Intellij) can't find them, but maybe I'm not searching it correctly.

Posted

1.8 is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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