Skip to content

Add vscode presetting and entity toggle swim event #1399

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Anatoliy057
Copy link
Contributor

I added presets for vscode, specifically the code formatting configuration. Tried to make it the best fit for the project, but there are inconsistencies in it project itself, and some of the rules just can't be turned off. Anyway this is only for vscode and only if you execute formating manually.

@Pieter12345
Copy link
Contributor

The project setup is described in the Maven pom file. Specific IDE setups should be generated from that, this is why there are no IntelliJ/Eclipse/NetBeans/VSC configuration files in this git. To apply the CheckStyle configuration of the project in VSC, there seems to be an extension that you can install: https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle. Why do you want to add these VSC-specific files?

@Anatoliy057
Copy link
Contributor Author

@Pieter12345 these files prompt vscode for a list of recommended extensions, one of which you mentioned and the settings for them (literally a couple of things and file paths).

the only thing questionable is the config file formatting, but added just as a why not

}

@Override
public boolean matches(Map<String, Mixed> filter, MCEntityToggleSwimEvent e) throws PrefilterNonMatchException {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of matches(), override the getPrefilterBuilder() method. This new method is much faster at runtime, and offers additional benefits such as better documentation. There are several examples of this, just search for "getPrefilterBuilder" to see some examples you can learn from (player_chat for instance has been converted), or see the PrefilterBuilder class. Once you implement that method, the matches() method goes away.

Copy link
Member

@LadyCailin LadyCailin left a comment

Choose a reason for hiding this comment

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

Everything looks good except the matches() method. Let me know if you have questions on how to implement that.

@LadyCailin
Copy link
Member

I definitely would like that configuration to be derived directly from the source of truth (in this case, the checkstyle file), rather than having an IDE specific configuration that has to be maintained. I do like the extension suggestion. Would be nice to enforce that some way better (if you use VSC, you MUST have this extension) but obviously that's bad for various reasons. In any case, the maintenance burden on this shouldn't be too high, and I do like batteries included things, so maybe it's fine to keep this. We don't change the code formatting standard often (ever), so once it's written, that should be it, unless the IDE itself changes the format of the file or something. In any case, I reserve the right to delete that config file later, but I think it's fine for now.

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.

3 participants