Plugin developers may want to cancel processing packages until players have logged in (HereAuth), until custom player data is fetched asynchronously...
public function onTebexOnlinePlayerPurchase(TebexOnlinePlayerPurchaseEvent $event) : void{
if($this->manager->isLocked($event->getPlayer())){
// Will keep trying to process this package
// everytime plugin checks for pending packages
// until the event isn't cancelled.
$event->setCancelled();
}
}
to implement a custom rewarding system that does not rely on tebex's enforced command execution...
public const PACKAGE_RANDOM_LOOT = 1337;
/**
* @param TebexOnlinePlayerPurchaseEvent $event
* @priority MONITOR
* @ignoreCancelled true
*/
public function onTebexOnlinePlayerPurchase(TebexOnlinePlayerPurchaseEvent $event) : void{
if($event->getPackage()->getId() === self::PACKAGE_RANDOM_LOOT){
LootTables::getRandom()->reward($event->getPlayer());
}
}
Plugin developers may want to cancel processing packages until players have logged in (HereAuth), until custom player data is fetched asynchronously...
to implement a custom rewarding system that does not rely on tebex's enforced command execution...
or simply logging.