Shock95 / AuctionHouse

Feature-packed auction house plugin for PocketMine-MP (pmmp)
GNU General Public License v3.0
43 stars 34 forks source link

AuctionHouse v1.2.0 #45

Closed Shock95 closed 3 years ago

Shock95 commented 4 years ago
rjworks commented 4 years ago

/ah about returns undefined getPlugin()

Shock95 commented 4 years ago

Works fine for me, did you download the plugin from the releases tab?

screenshot

rjworks commented 4 years ago

i did, but i had to decompile it to work it with my economy plugin because it’s not economyS

Shock95 commented 4 years ago

You can always use AuctionHouse::setEconomyProvider() to implement your own economy system, running the plugin from source isn't recommended

use pocketmine\plugin\PluginBase;
use shock95x\auctionhouse\AuctionHouse;
use shock95x\economy\economy\ExampleProvider;

class MainClass extends PluginBase {

    public function onEnable() : void {
        if($this->getServer()->getPluginManager()->getPlugin("AuctionHouse") != null) {
            $plugin = $this->getServer()->getPluginManager()->getPlugin("AuctionHouse");
            if($plugin instanceof AuctionHouse) {
                $plugin->setEconomyProvider(new ExampleProvider());

                $this->getLogger()->info(get_class($plugin->getEconomyProvider())); //outputs current economy provider
            }
        }
    }
}
use shock95x\auctionhouse\economy\EconomyProvider;

class ExampleProvider implements EconomyProvider {

        public function addMoney($player, int $amount): void {
            // implement
        }

        public function subtractMoney($player, int $amount): void {
            // implement
        }

        public function getMoney($player): int{
            // implement
        }

        public function getMonetaryUnit(): string {
            // implement
        }
}