Jump to content

Johnson1893

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Johnson1893

  1. Just because slots are crouch here. Terminals has no slots actually, and it not storing items in this fake-slots - AE2,RS and same mods actually stored it somewhere else, not in slots. They needed slots only for displaying stacks. Also they makes another crouches on this crouches to prevent sorting, and another type of container interaction by another mods (InventoryTweaks etc.). So, if we not storing stacks in slots - we dont need slots, isnt it?
  2. Hey! I apologize for the quality of the language - English is not my main language and I use a translator. I will be glad if you will correct me and speak simply. For my purposes, to make a system like Applied Energystics, and at the moment I am solving the problem of the terminal GUI. In similar mods, the storage grid GUI is made of slots, which seems to me not very attractive and crutch. I just render GUI and stacks directly and capture mouse clicks. When I click on an item, I send a packet to the server indicating the item and button. Further, the network puts the item for storage, and everything that it has not stored (or an empty stack) points to the player’s server representation and sends it to the client, where the client representation is similarly affixed. Tell me, how bad is this method and what could I ignore? PckGridTransfer (from client to server) override fun onMessage(message: PckGridTransfer, ctx: MessageContext): IMessage? { val player = ctx.serverHandler.player val world = player.world as WorldServer world.addScheduledTask { // todo! check player has this item as holded val host = ((player.openContainer as? AFactoryContainerNew<*>)?.tileEntity as? AFactoryTileGrid)?.host ?: return@addScheduledTask // todo! message.push val resultStack = host.storageProxy.putItemStackToStorage(message.stack, message.mouseButton) player.inventory.itemStack = resultStack TheMyMod.packetToPlayer(PckGridTransferResult(resultStack), player) } return null } PckGridTransferResult (from server to client) override fun onMessage(message: PckGridTransferResult, ctx: MessageContext): IMessage? { Minecraft.getMinecraft().addScheduledTask { Minecraft.getMinecraft().player.inventory.itemStack = message.stack } return null }
×
×
  • Create New...

Important Information

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