Posted May 17, 20205 yr Okay so basically I've been working on this mod for a while, that changes you, the player's size after an action for example, each time you eat you gain height. Client sided it seems to be working fine, but the moment I add it to the server it won't even run the server. I'm trying to get it to work server-wise, so to my understanding I'll have to work on differently with proxies or idk.. I would really like a bit of help, where do I start lol
May 17, 20205 yr Rendering isn't done on server side. Just check on the server, if you for example ate something. Then, you have to send a Packet to the client. If you want to know how to implement packets, just read the forge documentation: https://mcforge.readthedocs.io/en/latest/networking/ Also, the forge docs have an article about clientside/serverside and what you should do on those sides: https://mcforge.readthedocs.io/en/latest/concepts/sides/
May 19, 20205 yr Author On 5/17/2020 at 11:59 PM, Budschie said: Rendering isn't done on server side. Just check on the server, if you for example ate something. Then, you have to send a Packet to the client. If you want to know how to implement packets, just read the forge documentation: https://mcforge.readthedocs.io/en/latest/networking/ Also, the forge docs have an article about clientside/serverside and what you should do on those sides: https://mcforge.readthedocs.io/en/latest/concepts/sides/ Hey thank you! I've managed to communicate between the server and client Issue is I don't understand how would I increase the size of the specific player who ate something. increasing everyone's size together is okay somewhat >.<
May 20, 20205 yr Make the player size a capability and sync it everywhere (not literally; only to tracking clients and self), and on the client, render the model based on that player's size capability. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 20, 20205 yr Author 9 hours ago, DavidM said: Make the player size a capability and sync it everywhere (not literally; only to tracking clients and self), and on the client, render the model based on that player's size capability. Thanks for replying! I have been playing a bit with capabilities, and I seem to be understanding a bit, but not quite enough In the giant.setHeight, I'm attempting to update the capability but it doesn't seem to do anything I've also tried to change it outside the dist.client Any idea why it wouldn't update? :c
May 20, 20205 yr Author Replying to myself sorry, Fixed that issue But when I try to load other players from a client's pov I can't reach others capabilities because I'm looking for ClientEntityPlayer and I'm getting RemoteClientEntityPlayer when I'm getting the render of another player in RenderPlayerEvent
May 21, 20205 yr You should sync capabilities of other players to the client. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 22, 20205 yr Author On 5/21/2020 at 3:41 AM, DavidM said: You should sync capabilities of other players to the client. On 5/20/2020 at 7:55 PM, Melodia said: Replying to myself sorry, Fixed that issue But when I try to load other players from a client's pov I can't reach others capabilities because I'm looking for ClientEntityPlayer and I'm getting RemoteClientEntityPlayer when I'm getting the render of another player in RenderPlayerEvent Sorry for being a newbie, really trying hard on this one I'm trying to sync the capabilities, is making a list of all the capabilities a good start? How would I send it as a server to the players? I don't really understand how would I encode/decode something that isn't primitive >.< Could you lead me a bit further? I would really appreciate that
May 23, 20205 yr 5 hours ago, Melodia said: I don't really understand how would I encode/decode something that isn't primitive >.< There are helper functions that allows you to encode complex data (such as ITextComponent and BlockPos) to NBT. 5 hours ago, Melodia said: I'm trying to sync the capabilities, is making a list of all the capabilities a good start? I personally store my capabilities in static fields marked with @CapabilityInject annotation so that the value of the capability is injected at runtime. An example is this. Here are some links to the capability part of my test mod if you need: My capability object. My capability provider. My capability storage. My event subscriber for attaching capabilities to player. My packet that syncs the data of capability to the client. Edited May 23, 20205 yr by DavidM Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 23, 20205 yr Author 19 hours ago, DavidM said: There are helper functions that allows you to encode complex data (such as ITextComponent and BlockPos) to NBT. I personally store my capabilities in static fields marked with @CapabilityInject annotation so that the value of the capability is injected at runtime. An example is this. Here are some links to the capability part of my test mod if you need: My capability object. My capability provider. My capability storage. My event subscriber for attaching capabilities to player. My packet that syncs the data of capability to the client. If possible could you explain this line? https://github.com/davidmaamoaix/AquaticExploration/blob/d83561ca633053127545d7518bfb50e243e779a1/src/main/java/cn/davidma/aquaticexploration/common/progress/AquaticProgresses.java#L19 How does it get updated? In the readNBT method you're using that declartion but I don't really understand how it get updated
May 23, 20205 yr Oh I'm just being lazy there. Instead of finding the registry reference during the appropriate time, I used a LazyValue to find it via GameRegistry.findRegistry the first time I call it. It is functionally the same with: if (registry == null) { registry = findRegistry(); } doStuffWithRegistry(); Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 25, 20205 yr Author On 5/24/2020 at 2:35 AM, DavidM said: Oh I'm just being lazy there. Instead of finding the registry reference during the appropriate time, I used a LazyValue to find it via GameRegistry.findRegistry the first time I call it. It is functionally the same with: if (registry == null) { registry = findRegistry(); } doStuffWithRegistry(); Thanks a lot. Eventually I've managed to fix my problems But for some reason as the player gets taller, I can't seem to break anything at a height higher than the regular reach radius Is it possible or is there any variable to change the reach radius to be around my hand at a certain player height?
May 26, 20205 yr 9 hours ago, Melodia said: Is it possible or is there any variable to change the reach radius to be around my hand at a certain player height? That is changeable in the player's attribute. Obtain the attribute via LivingEntity#getAttribute and pass in the REACH_DISTANCE in PlayerEntity to obtain the reach attribute. You can modify that to change block reach distance. Unfortunately I don't think there is a convenient method of changing the reach for entity interactions. You'll have to do some manual ray casting. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.