Jump to content

Recommended Posts

Posted

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

Posted

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/

Posted
  On 5/17/2020 at 8: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/

Expand  

 

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 >.<

Posted

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:

  Reveal hidden contents

 

Posted
  On 5/20/2020 at 5:56 AM, 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.

Expand  

Thanks for replying!

 I have been playing a bit with capabilities, and I seem to be understanding a bit, but not quite enough

image.png.fe3719c0bf805754e606a8297ec9b3f4.png

 

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

Posted

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

Posted

You should sync capabilities of other players to the client.

Some tips:

  Reveal hidden contents

 

Posted
  On 5/21/2020 at 12:41 AM, DavidM said:

You should sync capabilities of other players to the client.

Expand  

 

  On 5/20/2020 at 4: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

Expand  

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

Posted (edited)
  On 5/22/2020 at 7:39 PM, Melodia said:

I don't really understand how would I encode/decode something that isn't primitive >.<

Expand  

There are helper functions that allows you to encode complex data (such as ITextComponent and BlockPos) to NBT.

 

  On 5/22/2020 at 7:39 PM, Melodia said:

I'm trying to sync the capabilities, is making a list of all the capabilities a good start?

Expand  

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 by DavidM

Some tips:

  Reveal hidden contents

 

Posted
  On 5/23/2020 at 12:46 AM, 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.

Expand  

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

Posted

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:

  Reveal hidden contents

 

Posted
  On 5/23/2020 at 11:35 PM, 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();

 

Expand  

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?

Posted
  On 5/25/2020 at 2:54 PM, 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?

Expand  

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.

  • Like 1

Some tips:

  Reveal hidden contents

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • So, i'm hosting (or attempting to host) a port-forwarded modded server for 1.12.2. There's quite a few mods in this pack, but they all run and have no compatibility issues (besides something causing the game to crash if you go fullscreen, a problem ive given up trying to identify or fix). It can run on 6gb of ram or less, and works fine in singleplayer. All of my friends that want to join have the exact same mod/config/game setup as I do (I personally helped them set everything up). Just to be safe, we've all allocated 12 gigabytes of RAM to the installation, and I've also allocated 12GB to the server itself. I am able to join with no issue and it runs fine. However, when they try to join, it gets stuck in the 'logging in' screen before their game becomes unresponsive. When they close it, it gives them the exit code 805306369, which usually means not enough RAM, but this cant be the case. On my screen, in the server, it shows them joining, and then disconnecting, so I dont think its a port-forwarding issue. They can all run it just fine in singleplayer as well. The annoying bit about this particular issue is that it generates no crash log. Does anyone have any suggestions? Thanks! Here is my debug log, and his, starting from the same place. MINE: [132647] [Netty Client IO #5INFO] [FML] Attempting connection with missing mods [ctm, fusion] at SERVER 132653.817 [132653] [Client threadINFO] [minecraftGuiConnecting] Connecting to 0, 25565 132654.682 [132654] [Netty Client IO #9INFO] [STDOUT] [xaero.common.core.transformer.ClassNodeTransformertransform29] Transforming class brz net.minecraft.client.network.NetHandlerPlayClient 132654.684 [132654] [Netty Client IO #9INFO] [STDOUT] [xaero.map.core.transformer.ClassNodeTransformertransform29] Transforming class net.minecraft.client.network.NetHandlerPlayClient 132654.764 [132654] [Netty Client IO #9INFO] [FML] Server protocol version 2 132654.777 [132654] [Netty Client IO #9INFO] [FML] Attempting connection with missing mods [ctm, fusion] at SERVER 132656.193 [132656] [Client threadINFO] [FML] Injecting existing registry data into this client instance 132659.081 [132659] [Client threadINFO] [FML] Applying holder lookups 132659.082 [132659] [Client threadINFO] [FML] Holder lookups applied 132659.092 [132659] [Netty Client IO #9INFO] [FML] [Netty Client IO #9] Client side modded connection established HIS: [13:12:16] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [ctm, fusion] at SERVER 13:12:25.597 [13:12:25] [Client thread/INFO] [minecraft/GuiConnecting]: Connecting to (my IP address and the server port 25565) 13:12:26.805 [13:12:26] [Netty Client IO #1/INFO] [STDOUT]: [xaero.common.core.transformer.ClassNodeTransformer:transform:29]: Transforming class brz net.minecraft.client.network.NetHandlerPlayClient 13:12:26.808 [13:12:26] [Netty Client IO #1/INFO] [STDOUT]: [xaero.map.core.transformer.ClassNodeTransformer:transform:29]: Transforming class net.minecraft.client.network.NetHandlerPlayClient 13:12:26.936 [13:12:26] [Netty Client IO #1/INFO] [FML]: Server protocol version 2 13:12:27.114 [13:12:27] [Netty Client IO #1/INFO] [FML]: Attempting connection with missing mods [ctm, fusion] at SERVER 13:12:27.480 [13:12:27] [Client thread/INFO] [FML]: Injecting existing registry data into this client instance 13:12:30.669 [13:12:30] [Client thread/INFO] [FML]: Applying holder lookups 13:12:30.671 [13:12:30] [Client thread/INFO] [FML]: Holder lookups applied 13:13:04.700 Process crashed with exit code -805306369 P.S - Both mods "CTM" and "FUSION" are present in both our folders so idk what that's about.
    • Please read the FAQ (link is orange banner at top of page), and post logs as described there, to an external site such as https://mclo.gs  
    • Hi! I've got a modpack with about 56 mods that has, up until now, been running pretty well. Starting today, any world i try to open causes minecraft to crash. It isn't the game itself- the main menu opens up fine.  I tried changing the ram allocated with both the minecraft launcher, and the forge launcher. No success with either. I tried deleting the JEI folder and letting it remake itself. No success. I tried turning off multiple mods. No success. I tried turning off JEI incase that was the issue. No dice. If you need to know specifically which mods I have installed, let me know, and I'll send them all to you. I've included the very first crash log. Please let me know if there's anything I can do! https://pastebin.com/Zfv6gWN7 -- Crash log on Pastebin (if this doesnt work, let me know)
    • I had this issue on ftb-stoneblock-3-1.11.5 (most recent version right now, installed through CurseForge), but my friend didn't get it when installing the same pack in the same way. I tried reinstalling the modpack several times, didn't help. I later finally solved it by updating REI Plugin Compatibilities (REIPC) in my StoneBlock client from version 8.0.69 to 8.0.89 (the most recent one as of now).
    • Delete the personality-client.toml file in your config folder and add this mod: https://www.curseforge.com/minecraft/mc-mods/night-config-fixes  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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