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

Added InfoAPI support #103

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

Added InfoAPI support #103

wants to merge 7 commits into from

Conversation

SOF3
Copy link

@SOF3 SOF3 commented Sep 12, 2021

Please make sure your pull request complies with these guidelines:

    • Use same formatting
    • Changes must have been tested on PMMP.
    • I don't have a client to test
    • Unless it is a minor code modification, you must use an IDE.
    • Too lazy to setup coc.nvim php support, let's just try them out
    • Have a detailed title.

What does the PR change?

Provide InfoAPI support.

Testing Environment

  • PHP: 8.0
  • PMMP: 4.0.0-BETA1
  • OS: Linux

Extra Information

Alright I didn't properly test this PR, but this is a good starting point if you want to introduce InfoAPI support.

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()));
Copy link
Author

@SOF3 SOF3 Sep 12, 2021

Choose a reason for hiding this comment

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

Copy link

@xDidntPot xDidntPot left a comment

Choose a reason for hiding this comment

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

Seems good

@SOF3
Copy link
Author

SOF3 commented Sep 13, 2021

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 InfoAPI::resolve("{player faction} {player faction.rank}") so on before you merge it. Probably a few small glitches to fix too, and maybe a few usability problems because this is the first external pull request that uses InfoAPI. Let me know if you encounter any difficulties like bad error messages.

@IcyEndymion004

This comment has been minimized.

@Aericio Aericio deleted the branch DaPigGuy:master February 13, 2022 06:44
@Aericio Aericio closed this Feb 13, 2022
@Aericio
Copy link
Collaborator

Aericio commented Feb 13, 2022

oh shit

@Aericio Aericio reopened this Feb 13, 2022
@DaPigGuy DaPigGuy changed the base branch from pmmp-4.0.0 to master February 13, 2022 07:03
@SOF3
Copy link
Author

SOF3 commented Feb 13, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants