Skip to content

Plugin Hooks#38

Open
Korrivyn wants to merge 9 commits into
St3venAU:masterfrom
Lost-Fables:master
Open

Plugin Hooks#38
Korrivyn wants to merge 9 commits into
St3venAU:masterfrom
Lost-Fables:master

Conversation

@Korrivyn

@Korrivyn Korrivyn commented Nov 14, 2020

Copy link
Copy Markdown
Contributor
  • Can now get an instance of ASTools (Main, renamed for clarity in other plugins)
  • From said instance can forcibly turn ASTools off for a given player, returning their inventory.
  • Add a new method for returning inventories wherein it doesn't keep the extras items in an inventory.
  • Add a new method which toggles whether a player has ASTools active, and returns a boolean based on the result.

With these changes, we as developers can instead hook into ASTools directly to turn it on and off, limiting the number of changes that need to be made to ASTools to accommodate other plugins. An example of this could be dealing with player inventories. With these minor changes another plugin author could do something like this;

public void modifyInventory(Player player) {
    ASTools asTools = ASTools.get();
    asTools.restoreInventoryHard(player);

    // Do stuff with player inventories.
}

@Korrivyn

Copy link
Copy Markdown
Contributor Author

3.7.1 has come out so this would need to have version bumped but the exact number doesn't really matter.

@Korrivyn Korrivyn changed the title 3.7.1 - Plugin Hooks Plugin Hooks Nov 19, 2020
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.

1 participant