CleverNucleus / data-attributes

Minecraft Fabric mod that overhauls the entity attributes system and exposes it with datapacks.
MIT License
12 stars 15 forks source link

Can this be run serverside only? #1

Closed Neubulae closed 3 years ago

Neubulae commented 3 years ago

hm

CleverNucleus commented 3 years ago

No, it is required on both the client and the server. However, datapacks are only needed on the server - the server's attribute configuration is synced to the client.

Neubulae commented 3 years ago

I meam if the code is tweaked a bit, iirc Vanilla clients ignore unknown attributes

Neubulae commented 3 years ago

To rephrase, would force disable client check be possible? I guess if I only edit vanilla attributes nothing will go very wrong... maybe?

CleverNucleus commented 3 years ago

Sorry, I'm not quite sure what you're asking. If it's about how I could make the mod server-side only, I'm afraid that that is simply not possible.

Neubulae commented 3 years ago

Sorry, I'm not quite sure what you're asking. If it's about how I could make the mod server-side only, I'm afraid that that is simply not possible.

I mean I saw you implement a check of whether did the client install this mod, tho I guess if it's impossible then it's necessary?

CleverNucleus commented 3 years ago

Ah I see, I understand now. The check is there to prevent different versions of the mod existing on the client and the server. This is important because future versions may vary in how the networking is done; it's also a way to force updates - often times I've released a minor patch to fix some bugs, only to have very few people update to the latest version. Which results in repeated bug reports for issues I've fixed, and also reflects badly on the mod.

When a client joins a server, the server sends its attribute configuration to the client though a packet. In order to receive this packet (and more importantly process and use it), the client must have a copy of the mod. This is fundamental and is true of all mods that involve networking (bar some that are purely client sided but use external networks). If the version check wasn't present, a client without the mod installed could join a server with the mod installed, only to begin spamming errors and crashing.

Tl;dr; the version check that is performed during login is not strictly necessary, rather it exists to prevent problems down the line.

Thanks.

Neubulae commented 3 years ago

Ah I see then, thank you.