diff --git a/.poggit.yml b/.poggit.yml index e2d4c4f..6f0d742 100644 --- a/.poggit.yml +++ b/.poggit.yml @@ -1,6 +1,7 @@ --- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/DaPigGuy/libPiggyEconomy branches: - master +- pmmp-4.0.0 projects: libPiggyEconomy: model: virion diff --git a/src/DaPigGuy/libPiggyEconomy/providers/EconomyProvider.php b/src/DaPigGuy/libPiggyEconomy/providers/EconomyProvider.php index 1ea317e..b4274a7 100644 --- a/src/DaPigGuy/libPiggyEconomy/providers/EconomyProvider.php +++ b/src/DaPigGuy/libPiggyEconomy/providers/EconomyProvider.php @@ -3,13 +3,8 @@ namespace DaPigGuy\libPiggyEconomy\providers; +use pocketmine\player\Player; -use pocketmine\Player; - -/** - * Interface EconomyProvider - * @package DaPigGuy\libPiggyEconomy\providers - */ abstract class EconomyProvider { public static function checkDependencies(): bool diff --git a/src/DaPigGuy/libPiggyEconomy/providers/EconomySProvider.php b/src/DaPigGuy/libPiggyEconomy/providers/EconomySProvider.php index b840e2b..1b1ad31 100644 --- a/src/DaPigGuy/libPiggyEconomy/providers/EconomySProvider.php +++ b/src/DaPigGuy/libPiggyEconomy/providers/EconomySProvider.php @@ -5,7 +5,7 @@ namespace DaPigGuy\libPiggyEconomy\providers; use onebone\economyapi\EconomyAPI; -use pocketmine\Player; +use pocketmine\player\Player; use pocketmine\Server; class EconomySProvider extends EconomyProvider diff --git a/src/DaPigGuy/libPiggyEconomy/providers/MultiEconomyProvider.php b/src/DaPigGuy/libPiggyEconomy/providers/MultiEconomyProvider.php index 7ddacb5..acdbf60 100644 --- a/src/DaPigGuy/libPiggyEconomy/providers/MultiEconomyProvider.php +++ b/src/DaPigGuy/libPiggyEconomy/providers/MultiEconomyProvider.php @@ -5,7 +5,7 @@ namespace DaPigGuy\libPiggyEconomy\providers; use DaPigGuy\libPiggyEconomy\exceptions\UnknownMultiEconomyCurrencyException; -use pocketmine\Player; +use pocketmine\player\Player; use pocketmine\Server; use Twisted\MultiEconomy\Currency; use Twisted\MultiEconomy\MultiEconomy; diff --git a/src/DaPigGuy/libPiggyEconomy/providers/XPProvider.php b/src/DaPigGuy/libPiggyEconomy/providers/XPProvider.php index c0afd32..d58de8a 100644 --- a/src/DaPigGuy/libPiggyEconomy/providers/XPProvider.php +++ b/src/DaPigGuy/libPiggyEconomy/providers/XPProvider.php @@ -5,7 +5,7 @@ namespace DaPigGuy\libPiggyEconomy\providers; use pocketmine\entity\utils\ExperienceUtils; -use pocketmine\Player; +use pocketmine\player\Player; class XPProvider extends EconomyProvider { @@ -16,14 +16,14 @@ public function getMonetaryUnit(): string public function getMoney(Player $player): float { - return $player->getXpLevel() + $player->getXpProgress(); + return $player->getXpManager()->getXpLevel() + $player->getXpManager()->getXpProgress(); } public function giveMoney(Player $player, float $amount): void { $levels = (int)floor($amount); - $player->addXpLevels($levels); - $player->addXp((int)(ExperienceUtils::getXpToCompleteLevel($player->getXpLevel()) * ($amount - $levels))); + $player->getXpManager()->addXpLevels($levels); + $player->getXpManager()->addXp((int)(ExperienceUtils::getXpToCompleteLevel($player->getXpManager()->getXpLevel()) * ($amount - $levels))); } public function takeMoney(Player $player, float $amount): void @@ -34,7 +34,7 @@ public function takeMoney(Player $player, float $amount): void public function setMoney(Player $player, float $amount): void { $levels = (int)floor($amount); - $player->setXpLevel($levels); - $player->setXpProgress($amount - $levels); + $player->getXpManager()->setXpLevel($levels); + $player->getXpManager()->setXpProgress($amount - $levels); } } \ No newline at end of file diff --git a/virion.yml b/virion.yml index 7a5aaaf..9ade286 100644 --- a/virion.yml +++ b/virion.yml @@ -1,5 +1,5 @@ name: libPiggyEconomy version: 2.0.0 antigen: DaPigGuy\libPiggyEconomy -api: 3.0.0 +api: 4.0.0 author: DaPigGuy \ No newline at end of file