Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental client-to-server component messaging API #161

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

Pyrofab
Copy link
Member

@Pyrofab Pyrofab commented Aug 26, 2023

In many instances, a mod that implements synced components also needs to send back messages to the server to affect the state of said components - typically in reaction to a key press or to a GUI click.

This PR aims to simplify those interactions by removing the need to create and register a custom packet type. As most use cases apply to a player component sending a message to itself, the new C2SSelfMessagingComponent interface is tailored for that. Future improvements may include a more generic component Client-To-Server messaging API, which is why C2SComponentPacketWriter was made part of the base module.

# Conflicts:
#	cardinal-components-entity/src/main/java/org/ladysnake/cca/api/v3/entity/C2SSelfMessagingComponent.java
#	cardinal-components-entity/src/main/java/org/ladysnake/cca/internal/entity/CardinalComponentsEntity.java
#	cardinal-components-entity/src/main/java/org/ladysnake/cca/mixin/entity/common/MixinEntity.java
#	src/testmod/java/org/ladysnake/componenttest/content/vita/sync/C2SComponentPacketWriter.java
@Pyrofab Pyrofab changed the base branch from 1.20 to 1.20.5 April 19, 2024 20:58
@Pyrofab Pyrofab merged commit 51c9c60 into 1.20.5 Apr 19, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant