Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Development - Third Party Commands #1351

Open
SteveCookTU opened this issue May 9, 2019 · 1 comment
Open

Development - Third Party Commands #1351

SteveCookTU opened this issue May 9, 2019 · 1 comment

Comments

@SteveCookTU
Copy link

Affected Plugin

  • Affected Plugin Name: Factions
  • Affected Plugin Version: 2.14

Describe your Environment

  • Server Version: 1.13.2

I am currently developing a third party plugin that links with factions. I was hoping to be able to add the command into the factions command system but it seems that system has been reworked since the last time I was able to do so. (Not sure the version but the line was something like P.p.cmdBase). If there is any helpful hints on how commands are registered now within the plugin, I would greatly appreciate them. If the ability to do this is no longer supported I'd also love to know that.

Thank you.

@markhughes
Copy link
Contributor

P.p was a really bad approach because it was terrible with memory cleanup.

Create a command by extending FactionsCommand, here is an example:
https://github.com/magnusulf/Factions/blob/master/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java

Then use FactionsCommand and add it as a child

YourCommand yourCommand = YourCommand.get();

// com.massivecraft.factions.cmd.FactionsCommand 
FactionsCommand.get().addChild(yourCommand);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants