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 a new command "nostamina" #877

Merged
5 commits merged into from
May 14, 2022
Merged

Add a new command "nostamina" #877

5 commits merged into from
May 14, 2022

Conversation

tiantian520tt
Copy link
Contributor

Description

Please carefully read the Contributing note and Code of conduct before making any pull requests.
And, Do not make a pull request to merge into stable unless it is a hotfix. Use the development branch instead.

Issues fixed by this PR

I added a new command "nostamina". The function of this command allows players to maintain maximum endurance through commands. I understand that unlimited endurance can be set in the configuration file in the new version, but I think it will be more convenient for players to operate unlimited endurance with instructions. This part of the code imitates godmodecommand Written in Java.
(Baidu translation is used)

Type of changes

  • Bug fix
  • New feature
  • Enhancement
  • Documentation

Checklist:

  • My code follows the style guidelines of this project
  • My pull request is unique and no other pull requests have been opened for these changes
  • I have read the Contributing note and Code of conduct
  • I am responsible for any copyright issues with my code if it occurs in the future.

@BaiSugar
Copy link
Contributor

Why does English appear in zh-cn.json?

@tiantian520tt
Copy link
Contributor Author

Sorry, I used the old version of ZH CN when submitting JSON, resulting in content mismatch. I'm updating to the new version.

@BaiSugar
Copy link
Contributor

The stamina of all players is controlled in the config, and the stamina of a single player is controlled by the command. I wonder if it is feasible?

@tiantian520tt
Copy link
Contributor Author

I think we may need to continue our research now. I need further tests.

@tiantian520tt
Copy link
Contributor Author

Done

@tiantian520tt
Copy link
Contributor Author

Don't test for the time being. I'm resetting.

@mugenkof2022
Copy link

goooood,love it!!!


@Command(label = "nostamina", usage = "nostamina [on|off]", permission = "player.nostamina", permissionTargeted = "player.nostamina.others", description = "commands.nostamina.description")
public final class NoStaminaCommand implements CommandHandler {
public static boolean StaminaState = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

public static boolean StaminaState = false;
should be write inside player class instead of the command

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I‘m busy now.I will fix it.Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have fixed it.But I eat out now and need to go back and update later.be sorry.

@tiantian520tt
Copy link
Contributor Author

All the work is ready. The new version has finished disabling the physical strength of a single player.

@@ -753,7 +754,14 @@ public void addShopLimit(int goodsId, int boughtCount, int nextRefreshTime) {
}
this.save();
}

public boolean getstamina() {
Copy link

Choose a reason for hiding this comment

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

Please use proper camelcase naming convention. (Ex. getstamina -> getStamina) Other than that, everything looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.Thanks.

tiantian520tt and others added 2 commits May 14, 2022 20:20
Fix an existing language expression error.
@ghost ghost merged commit f1b12cc into Grasscutters:development May 14, 2022
Birdulon pushed a commit to Birdulon/Grasscutter that referenced this pull request Aug 21, 2022
* Add a new command " nostamina\

* Fix

* Fix 2

* Renamed some names.

* Update zh-CN.json

Fix an existing language expression error.
This pull request was closed.
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.

None yet

4 participants