[SLOVED] How to modify the player inventory size

I want to modify the size, how can I do that?
I have done in forge. But sponge dont support the reflection.

Sponge expects sizes of inventories to be correct, so your not able to modify directly from the sponge api. But if you wish to modify NMS code, you still can.

While you dont have the reflection helper that is provided with forge, there is one that is provided in Sponge Common (the code shared between SpongeForge and Sponge Vanilia) https://github.com/SpongePowered/SpongeCommon/blob/stable-7/src/main/java/org/spongepowered/common/util/ReflectionUtil.java

You can use that in replacement of forges version. Just remeber to depend on SpongeCommon. Dont want someone using your plugin on a lantern server and get crashes stating that the class isnt there.

Edit:
Just seen that util only has constructor. The other way is to build mixens (something sponge relays on to interact with NMS) for the inventory to add the method “setSize(int a);” and then build your plugin with gradle (so MCP is used). Ive never used mixens before and have a very basic understanding of them so im probably no help in constructing them.

The other thing you can do is what I see a lot of forge guys do and that is call the field directly (as in the f1045 field - instead of the MCP name) as this will be the same in sponge forge and vanilla.

I use Capability and modify the containers. Done.