Franckyi
Members-
Posts
130 -
Joined
-
Last visited
Franckyi's Achievements
Creeper Killer (4/8)
7
Reputation
-
[1.13.2] Optional client/server mod : Handshake issues
Franckyi replied to Franckyi's topic in Modder Support
I figured out that I could send the packets during the PlayerEvent.PlayerLoggedInEvent event. It works too. -
Hello, I'm creating a mod that is optional on the server and on the client. Basically, a player using my mod can join a vanilla server, and a vanilla player can join a server where my mod is installed. The only thing my mod registers are network channels, and they are made to accept any version on the server and the client. But I want to find a way to detect if a player has installed my mod (from the server) and if the server has installed my mod (from the client). Someone told me to use a handshake packet. On the client I would simply create a boolean variable that equals true if the client correctly recieves the handshake from the server. On the server I would create a Set<UUID> to tell which player has the mod installed. If the server correctly recieves the handshake from the client, it adds the player to the set. When the player disconnects, he's removed from the set. I've looked at how Forge manages the handshake. I created my own SimpleChannel for the handshake and I registered the S2C and the C2S message using the MessageBuilder. For the S2C one I used buildLoginPacketList. In the S2C message handler, I reply with the C2S message. In both handlers, I mark the packet as handled. When I start my SP world, I see the handshake in the log. But after my handshake is done, the screen is stuck on the "Loading world" screen, and it disconnects me because it "Took too long to log in". I think I forgot something but I don't know what. I have to somehow tell that the handshake is done, but I can't find how. Does someone know what could I have forgot ? Packet registration : https://github.com/Franckyi/IBE-Editor/blob/c54278cbdd6164ee85feaa1305a8cc38722e9a75/src/main/java/com/github/franckyi/ibeeditor/network/IBENetworkHandler.java#L63 Packet handling : https://github.com/Franckyi/IBE-Editor/blob/c54278cbdd6164ee85feaa1305a8cc38722e9a75/src/main/java/com/github/franckyi/ibeeditor/network/IBEHandshakeMessages.java#L41 Handshake log : https://hastebin.com/fopirelaxu.cs
-
[1.11.2] [Partially Solved] Update player inventory from the client
Franckyi replied to Franckyi's topic in Modder Support
Then I guess I'll use custom packets for now until I find a solution. -
Try without Optifine. Optifine is known for causing some issues in modpacks.
-
[1.11.2] [Partially Solved] Update player inventory from the client
Franckyi replied to Franckyi's topic in Modder Support
Huh, I'm having trouble updating the inventory on the server side. It seems that the modified item is being placed in the survival crafting grid, instead of where it should be. I used debug mode and the slot ID used when instantiating CPackedCreativeInventoryAction is correct. In NetHandlerPlayServer::processCreativeInventoryAction, the packet data is still correct. When this.player.inventoryContainer.putStackInSlot is called, the Container::getSlot returns a slot from an InventoryCrafting inventory. Which is strange because the item should be in my main hand. Any thoughts about this ? Am I not using CPackedCreativeInventoryAction correctly ? Also, I don't understand this line in NetHandlerPlayServer::processCreativeInventoryAction : boolean flag1 = packetIn.getSlotId() >= 1 && packetIn.getSlotId() <= 45; Why is it checking for a slot ID higher or equal to 1 ? Why is the item dropped if my slot ID is equal to 0 (representing the first hotbar slot) ? -
[1.11.2] [Partially Solved] Update player inventory from the client
Franckyi replied to Franckyi's topic in Modder Support
Great, thanks a lot -
[1.11.2] [Partially Solved] Update player inventory from the client
Franckyi replied to Franckyi's topic in Modder Support
That's what I was looking for, thanks ! Another question, can I modify a block (placed in the world) or an entity without using custom packets from the client ? -
Hi. I'm working on a client-side-only mod which allows the user to edit an item in his inventory when he's in Creative Mode. Since I'm not adding any content (blocks, items) and only a GUI, I guess I don't have to handle the server part. But when I edit an item, the changes are saved on the client side but not on the server side. Which means that when I drop the edited item and take it back in my inventory, changes don't apply. Is there a way to tell to the server that the item has to be updated, without using custom packets so my mod can stay client-side-only ? Or must I do all the changes on the server side and use Custom Packets ?
-
I deleted the file and recreated it, and the problem was solved. It probably was an encoding error or something like that, because the file was generated by IntelliJ IDEA's Minecraft Development plugin. And on Linux I had no error, whereas I had an error on Windows.
-
Hi, I've paused modding for a few months, and I'm now developing a new simple mod for MC 1.12.2. But in my development environment, when I go in the Mods menu, it says "No mod information found. Ask your mod author to provide a mod mcmod.info file". I tried to build the mod and to launch it, but it didn't load the mod. Development environment : mcmod.info : https://pastebin.com/9yAbgemR game log : https://pastebin.com/Nmfjt8gg fml-client-latest.log : https://pastebin.com/tRwBLtRt After building the mod, using MultiMC : mcmod.info : https://pastebin.com/N50HKHUp game log : https://pastebin.com/Fguq0E1d fml-client-latest.log : https://pastebin.com/P96z8nHH As the logs say, I'm using the latest version of Forge (1.12.2-14.23.0.2546). Thanks for helping.
-
[1.12] How to activate a block with an item
Franckyi replied to IlTosaerba's topic in Modder Support
Override Block::onBlockActivated in your Card Reader Block class, and check if playerIn.getHeldItemMainHand().getItem() is an instance of ItemPersonalCard, and do what you want.- 1 reply
-
- 1
-
Yes. And this is not the good forum. And we don't support 1.7.10.
-
https://www.take-a-screenshot.org/ Really. If you don't know how to take a screenshot or even how to search on Google you should't be doing what you're trying to do.
-
He probably wasn't totally awake.
-
You uploaded all your code to a github repo, but that's not how you do it. You have to install git, then add your github repository as a remote, then commit and push. I can't even see your lang file.