1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Update To EconomyJob?

Discussion in 'Requests' started by ALLINSEO, Mar 26, 2017.

  1. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    EconomyJob has an option to use Place to give money, except when you place blocks like seeds and saplings you still get money when the place event is canceled. Allowing players to rack up alot of currency rather quickly.

    Code:
     
    public function onBlockPlace(BlockPlaceEvent $event){
           $player = $event->getPlayer();
           $block = $event->getBlock();
    
           $job = $this->jobs->get($this->player->get($player->getName()));
           if($job !== false){
               if(isset($job[$block->getID().":".$block->getDamage().":place"])){
                   $money = $job[$block->getID().":".$block->getDamage().":place"];
                   if($money > 0){
                       $this->api->addMoney($player, $money);
                   }else{
                       $this->api->reduceMoney($player, $money);
                   }
               }
           }
       }
    
     
  2. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Which exact version of EconomyJob, and which plugin is cancelling the BlockPlace event? It's probably the priority and @ignoreCancelled tags are not set correctly in one or both, so I'd need to see the full code of both.
     
  3. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    I never really thought of that, I use WorldProtect to stop the placement of some blocks, but thats not the case in this issue.

    the place event is canceled because you are only allowed to plant seeds in farmland, if you try to plant seeds anywhere else the place is canceled but you still get money.

    I use the current version of EconomyJob Plugin Found on Poggit

    I also use the latest Version of WorldProtect, I have tested both place and break items that have been banned+ unbreakable. you do not recive money when those items are placed,broken.

    I think its simply not registering that you are attempting to use seeds on not farmland.
     
    Last edited: Mar 27, 2017
  4. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    So it's pocketmine cancelling the event? The version of EconomyJob I use is set at @priority MONITOR for the BlockPlaceEvent, so I'd try changing that first.
     
  5. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    correct, I edited my above reply with some more info. im not the best with php, would you mind sharing / updating the Poggit plugin?
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    @Awzaw the @ignoreCancelled is set to true in EconomyJobs
     
    Last edited: Mar 29, 2017
  7. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    So in theory it should not be giving money when the place is cancled?
     
  8. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    @cancelIgnored indicates that EconomyJobs ignores when the action is cancelled and addes the money anyway. It was made to be like that.
     
  9. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    weird? not sure why. am I able to disable it?

    ps. I also sent you the map.zip you request
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.