Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PocketJobs 2.0

Introduces job into your world

  1. MinecrafterJPN
    Offline

    MinecrafterJPN Active Member Plugin Developer

    Joined:
    Aug 26, 2013
    Posts:
    154
    Plugins:
    9
    Minecraft User:
    MinecrafterJPN
    MinecrafterJPN submitted a new plugin:

    PocketJobs - Introduces job into your world

    Read more about this plugin...
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    jobs ignor protected areas and players get money too!!!!!!
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    I can't add new job or edit existing job. After reload job file is originĂ¡l and changes are deleted.
  4. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
    I must DOWLOAD economy ?
  5. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    No you must download pocket money
  6. Martin77Epic
    Offline

    Martin77Epic Banned

    Joined:
    Mar 6, 2015
    Posts:
    164
    Minecraft User:
    CookieMonsterPE
  7. Hitansh
    Offline

    Hitansh New Member

    Joined:
    Aug 10, 2015
    Posts:
    19
    Minecraft User:
    HitanshD
    what is meta?
  8. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Item metadata
  9. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Some suggestions and bugs:
    • miner and woodcutter always get added into config, but i wanted to change the names to mine/ wood
    • It would be nice if you could add an option to do meta: * (every block state)
    • Also, it seems like if you break wheat, but specify metadata as 7 (fully grown) and you break wheat which is not fully grown, you still get money.
    • In protected areas you still get money on breaking & placing
    • if you are not logged in you can still try to place blocks and you get money also.
    • Adding actions like fishing or crafting would be nice.
    • please add a generic config.yml, where you can disable/enable jobs
    • Add using special items (like shears on sheeps/hoe on dirt)
    pomee4 likes this.
  10. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    I fixed the bug with the config:
    PHP:
        public function onEnable(){
            @
    mkdir($this->getDataFolder());
            
    $this->saveResource("users.yml");
            
    $this->saveResource("joblist.yml");
            
    $this->users = new Config($this->getDataFolder() . "users.yml"Config::YAML);
            
    $this->joblist = new Config($this->getDataFolder() . "joblist.yml"Config::YAML);
            if(empty(
    $this->joblist->getAll())){
                
    $this->getLogger()->info("setting up default joblist");
                
    $this->joblist->set('woodcutter', array('break' => array(array('ID' => Block::WOOD,'meta' => 0,'amount' => 25),array('ID' => Block::WOOD,'meta' => 1,'amount' => 25),array('ID' => Block::WOOD,'meta' => 2,'amount' => 25),array('ID' => Block::WOOD,'meta' => 3,'amount' => 25)),
                        
    'place' => array(array('ID' => Block::SAPLING,'meta' => 0,'amount' => 1),array('ID' => Block::SAPLING,'meta' => 1,'amount' => 1),array('ID' => Block::SAPLING,'meta' => 2,'amount' => 1),array('ID' => Block::SAPLING,'meta' => 3,'amount' => 1))));
                
    $this->joblist->set('miner', array(
                        
    'break' => array(array('ID' => Block::STONE,'meta' => 0,'amount' => 3),array('ID' => Block::GOLD_ORE,'meta' => 0,'amount' => 25),array('ID' => Block::IRON_ORE,'meta' => 0,'amount' => 20),array('ID' => Block::LAPIS_ORE,'meta' => 0,'amount' => 17),
                                array(
    'ID' => Block::OBSIDIAN,'meta' => 0,'amount' => 9),array('ID' => Block::DIAMOND_ORE,'meta' => 0,'amount' => 80),array('ID' => Block::REDSTONE_ORE,'meta' => 0,'amount' => 10))));
                
    $this->joblist->save();
                
    $this->joblist->reload();
            }
         
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        }
    Also i took out the join jobs when player joins, because its not needed that its saved to the config, if a player does /jobs join miner, the config is updated.
    PHP:
        /*
         * public function onPlayerJoin(PlayerJoinEvent $event){
         * $name = $event->getPlayer()->getName();
         * if(!$this->users->exists($name)){
         * $this->users->set($name, array('slot1' => null));
         * $this->users->save();
         * }
         * }
         */
    I think i also fixed the bug that you can break blocks in protectet areas and get money:
    PHP:
        public function onPlayerBreakBlock(BlockBreakEvent $event){
            if(!
    $event->isCancelled()){
                
    $this->workCheck("break"$event->getPlayer()->getName(), $event->getBlock()->getId(), $event->getBlock()->getDamage());
            }
        }

        public function 
    onPlayerPlaceBlock(BlockPlaceEvent $event){
            if(!
    $event->isCancelled()){
                
    $this->workCheck("place"$event->getPlayer()->getName(), $event->getBlock()->getId(), $event->getBlock()->getDamage());
            }
        }
    Maybe you could add a config where you can define how many slots you would like the users to have.. i only want 1 slot.. so i removed everything for the second slot..
    Instead of slot1 / slot2 use 1, 2, 3..
    and testing if you can use more jobs would be
    PHP:
        private function joinJob($username$job){
            
    $slots $this->users->get($username);
            if(
    in_array($job$slots)){
                
    $this->getServer()->getPlayer($username)->sendMessage(TextFormat::RED "You already have the job $job");
                return;
            }
            if(
    count($slots)>=$this->getConfig()->getNested("slots.max")){
                
    $this->getServer()->getPlayer($username)->sendMessage(TextFormat::RED "Your job slots are full");
            }
            else{
                
    $this->users->set($username, array($slots(count($slots)) => $job));
                
    $this->users->save();
                
    $this->getServer()->getPlayer($username)->sendMessage(TextFormat::GREEN "You now have job $job");
            }
        }
    Took me some minutes to figure out the bugs and fixing them (maybe 30 minutes)
    Last edited: Sep 23, 2015
    Jelly9912 likes this.
  11. Crashfire
    Offline

    Crashfire New Member

    Joined:
    Oct 22, 2015
    Posts:
    3
    Minecraft User:
    Crashfire
    How do I give my players access to this plugin like to join jobs because I have pure perms and I'm still having trouble with it
  12. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Everyone can use the commands by default
  13. hihihoholalalolo
    Offline

    hihihoholalalolo New Member

    Joined:
    May 11, 2016
    Posts:
    33
    Minecraft User:
    hihihoho
    Can you make killmoney

Share This Page

Advertisement