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

Code refactor for better plugin development #500

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

suprohub
Copy link
Contributor

Description

This refactor includes:
Change bounding box floats to vector with floats, because its more intuitive and readable.

Remove oneshot dependency, because its not needed anymore.

Add more derives for data struct for plugin developers.
(Me needed it)

Rename files and remove typos.

Testing

clippy and fmt, also unit all unit tests

Please follow our Coding Guidelines

@Snowiiii
Copy link
Member

I don't like having things named with an "s", For example naming Packet to Packets or others

@suprohub
Copy link
Contributor Author

Why? Its more intuitive, because its a module with packets, not with single packet and inppementation for it

@Snowiiii
Copy link
Member

Why? Its more intuitive, because its a module with packets, not with single packet and inppementation for it

nah, its not. Also now everything is inconsistent. You rename like 3 things into multiple and all other are still single. Just leave it as it is please

@suprohub
Copy link
Contributor Author

Ok

@suprohub
Copy link
Contributor Author

I revert it

Comment on lines +10 to +22
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct RawChatType {
id: u32,
components: ChatType,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct ChatType {
chat: Decoration,
narration: Decoration,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes no sense since its only used internally and is not exposed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not internally. i use it in plugins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like for example playsound

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything in there is only available at build time, All struct have to be parsed to the token stream to be included as final rust code


use crate::ident;

#[derive(Deserialize)]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes no sense since its only used internally and is not exposed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anf this tok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this too


use crate::ident;

#[derive(Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes no sense since its only used internally and is not exposed

@Snowiiii
Copy link
Member

BoundingBox changed and i left some comments @suprohub

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.

2 participants