-
Notifications
You must be signed in to change notification settings - Fork 30
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
Added InfoAPI support #103
base: master
Are you sure you want to change the base?
Conversation
InfoAPI::provideInfo(self::class, StringInfo::class, "piggyfactions.faction.description", fn($info) => new StringInfo($info->faction->getDescription())); | ||
InfoAPI::provideInfo(self::class, StringInfo::class, "piggyfactions.faction.motd", fn($info) => new StringInfo($info->faction->getMotd())); | ||
InfoAPI::provideInfo(self::class, NumberInfo::class, "piggyfactions.faction.power", fn($info) => new NumberInfo($info->faction->getPower())); | ||
InfoAPI::provideInfo(self::class, NumberInfo::class, "piggyfactions.faction.maxPower", fn($info) => new NumberInfo($info->faction->getMaxPower())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider merging power
and maxPower
into a RatioInfo: https://github.com/SOF3/InfoAPI/blob/ae0e2ad01d3127c885d0d7bef9b9ec4d5fce9ebe/src/SOFe/InfoAPI/PlayerInfo.php#L80-L84
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good
Don't merge it without testing. This is just a starting point for you to implement InfoAPI support. I recommend running a script plugin that calls |
This comment has been minimized.
This comment has been minimized.
oh shit |
What's wrong with your branches? |
# Conflicts: # .github/workflows/main.yml # .poggit.yml # plugin.yml # src/DaPigGuy/PiggyFactions/PiggyFactions.php # src/DaPigGuy/PiggyFactions/addons/hrkchat/TagManager.php # src/DaPigGuy/PiggyFactions/claims/ClaimsListener.php # src/DaPigGuy/PiggyFactions/commands/subcommands/claims/claim/ClaimCircleSubCommand.php # src/DaPigGuy/PiggyFactions/commands/subcommands/claims/claim/ClaimSquareSubCommand.php # src/DaPigGuy/PiggyFactions/commands/subcommands/claims/claim/ClaimSubCommand.php # src/DaPigGuy/PiggyFactions/commands/subcommands/claims/unclaim/UnclaimCircleSubCommand.php # src/DaPigGuy/PiggyFactions/commands/subcommands/claims/unclaim/UnclaimSquareSubCommand.php # src/DaPigGuy/PiggyFactions/event/FactionEvent.php # src/DaPigGuy/PiggyFactions/event/FactionMemberEvent.php # src/DaPigGuy/PiggyFactions/event/management/FactionCreateEvent.php # src/DaPigGuy/PiggyFactions/factions/Faction.php # src/DaPigGuy/PiggyFactions/factions/FactionsManager.php # src/DaPigGuy/PiggyFactions/players/FactionsPlayer.php # src/DaPigGuy/PiggyFactions/players/PlayerManager.php # src/DaPigGuy/PiggyFactions/tasks/ShowChunksTask.php # src/DaPigGuy/PiggyFactions/utils/AsciiMap.php
Please make sure your pull request complies with these guidelines:
What does the PR change?
Provide InfoAPI support.
Testing Environment
Extra Information
Alright I didn't properly test this PR, but this is a good starting point if you want to introduce InfoAPI support.