Everything posted by rept1d
-
Open container with server side only
One more question has appeared. Is it possible to simplify this code? It's basically copy-pasted from EntityPlayerMP#displayGUIChest implementation, but it allows me to pass my custom Container to the client. Is there an existing method to do the same? P.S. Reminding that the mod should me server-sided only.
-
Open container with server side only
Finally. What has helped me is extending ContainerChest instead of Container. Thank you for your help. I would like this thread not to be closed yet in case i will have any more questions.
-
Open container with server side only
Container#transferStackInSlot cannot be called if i override Container#slotClick without calling super.slotClick Edit: technically it can, but is never called
-
Open container with server side only
Well, that fixed Q (dropping the item): However shift clicking still causes ghost items. Do i need to remember player's own inventory and replace it back on every click?
-
Open container with server side only
It's not a big problem to send a container to the player. The problem is that I don't know how to properly prevent any item movements (without custom GuiScreen). Overriding Slot.canTakeStack, Container.slotClick and Container.transferStackInSlot results in ghost items, that you was talking about. This is how i display menu to a player (kinda copy-pasted from EntityPlayerMP.displayGUIChest, but allows me to pass my custom container) However I still can't understand how to avoid the ghost items.
-
Open container with server side only
It's commonly known that chest-based menus are popular on vanilla servers. Therefore it should be possible to do the same thing using forge without client side. If someone doesn't know what these menus are: they're kinda "virtual" chests opened by a command or item right click, containing immovable items, that cause some actions when left/right clicking on them. What is needed there is: creating an inventory (container) with items in some slots; handling left/right clicks on these items in order to prevent any movements and do some actions instead; ability to send the menu to client. I was trying to do so, but was unsuccessful. What exactly did i try is overriding some methods in custom containers/slots. How can I achieve that? Thank you.
-
No cursor in a custom GUI
Thank you a lot for the explanation. I'm now sending a message (packet) to the Client on command execution to open the Gui so that cursor has became visible.
-
No cursor in a custom GUI
I am new in modding and I've created a custom GUI. However, when the GUI appears, I can't see the mouse cursor until I move it out of Minecraft window. Here's my GUI class (it's very simple): And that's how i display it: I've tried to find this problem on the internet, but didn't find any solution working for me.
IPS spam blocked by CleanTalk.