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

help my plugins!!

Comments in 'Plugin Development' started by polakpl, Jul 5, 2016.

  1. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    Mam tez inne pytanie bo zrobilem plugin nie dziala mi prosze o pomoc to moj caly kod
    <?php __HALT_COMPILER(); ?>

    plugin.yml V e۶ src/lolek9/Main.php
    V
    ˡ? resources/config.ymlI VI %lDQ name: NowyDrop
    author: lolek9
    description: Simple plugin for create endless drop with any dropping items whatever you want! Fully customizable
    version: 1.0
    main: lolek9\Main
    api: [1.13.0]<?php

    namespace lolek9;

    use pocketmine\plugin\PluginBase as PluginBase;
    use pocketmine\event\Listener as Listener;
    use pocketmine\utils\TextFormat;
    use pocketmine\event\block\BlockBreakEvent;
    use pocketmine\event\block\BlockPlaceEvent;
    use pocketmine\utils\Config;
    use pocketmine\block\Block;
    use pocketmine\block\Air;
    use pocketmine\block\Drop;
    use pocketmine\math\Vector3;
    use pocketmine\item\Item;
    use pocketmine\level\particle\LavaParticle;
    use pocketmine\level\sound\BlazeShootSound;

    class Main extends PluginBase implements Listener{


    public function onEnable(){
    $this->getServer()->getPluginManager()->registerEvents($this,$this);
    $this->saveDefaultConfig();
    $this->getServer()->getLogger()->info(TextFormat::GREEN . "Nowy Plugin Nowy Drop");
    }

    public function onPlace(BlockPlaceEvent $event){
    $blok = $event->getBlock();
    $gracz = $event->getPlayer();
    $y = $blok->getFloorY();
    $x = $blok->getFloorX();
    $z = $blok->getFloorZ();

    if($blok->getId() == 121){
    if(!($event->isCancelled())){
    $gracz->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1, $blok->getFloorZ()), new Stone());
    $gracz->sendMessage(TextFormat::YELLOW . "[NowyDrop] " . TextFormat::GREEN . "Postawiłeś nowydrop!");
    $center = new Vector3($x, $y, $z);
    $particle = new LavaParticle($center);
    for($yaw = 0, $y = $center->y; $y < $center->y + 3; $yaw += (M_PI * 2) / 20, $y += 1 / 20) {
    $x = -sin($yaw) + $center->x;
    $z = cos($yaw) + $center->z;
    $particle->setComponents($x, $y, $z);
    $gracz->getLevel()->addParticle($particle);
    $gracz->getLevel()->addSound(new BlazeShootSound ( $gracz->getPosition () ), array($gracz) );
    }
    }else{
    $gracz->sendMessage(TextFormat::YELLOW . "[NowyDrop] " . TextFormat::RED . "Nie możesz postawić tutaj NowegoDropu, ten teren jest zabezpieczony");
    }
    }
    }

    public function onBreak(BlockBreakEvent $event){
    $blok = $event->getBlock();
    $gracz = $event->getPlayer();
    $y = $blok->getFloorY();
    $x = $blok->getFloorX();
    $z = $blok->getFloorZ();
    if($blok->getId() == 1){
    if($gracz->getLevel()->getBlock(new Vector3($x, $y-1, $z))->getId() == 121) {
    $event->setCancelled();
    if($this->getConfig()->get("rzeczy-do-eq") == "tak"){
    $gracz->getInventory()->addItem(Item::get($this->getConfig()->get("item"), 0, $this->getConfig()->get("ilosc")));
    }elseif($this->getConfig()->get("rzeczy-do-eq") == "nie"){
    $gracz->getLevel()->dropItem(new Vector3($x, $y, $z), Item::get($this->getConfig()->get("item"), 0, $this->getConfig()->get("ilosc")));
    }
    }
    }elseif($blok->getId() == 121){
    $gracz->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1, $blok->getFloorZ()), new Air());
    $gracz->sendMessage(TextFormat::YELLOW . "[NowyDrop] " . TextFormat::RED . "NowyDrop usunięta!");
    $center = new Vector3($x, $y, $z);
    $particle = new LavaParticle($center);
    for($yaw = 0, $y = $center->y; $y < $center->y + 3; $yaw += (M_PI * 2) / 20, $y += 1 / 20) {
    $x = -sin($yaw) + $center->x;
    $z = cos($yaw) + $center->z;
    $particle->setComponents($x, $y, $z);
    $gracz->getLevel()->addParticle($particle);
    $gracz->getLevel()->addSound(new BlazeShootSound ( $gracz->getPosition () ), array($gracz) );
    }
    }
    }
    }#NowyDrop by lolek9

    #Jeśli opcja "rzeczy-do-eq" będzie ustawiona na "tak" - rzeczy z NowegoDropu
    #będą trafiały do eq, jeśli na "nie" - rzeczy będą dropił normalnie

    rzeczy-do-eq: tak

    #Item, który będzie dropił z kamienia, domyślnie - block of diamond

    item: 4

    #Ilość wydobywanego itemu, domyślnie - 1

    ilosc: 1 (*g /처 W R GBMB i nie wiem czemu nie dziala prosze napisac co gdzie mam dopisac
  2. luke7153
    Offline

    luke7153 Active Member

    Joined:
    Jun 9, 2016
    Posts:
    26
    Minecraft User:
    luke7153
  3. TheDeibo
    Offline

    TheDeibo Notable Member Plugin Developer

    Joined:
    Sep 8, 2014
    Posts:
    692
    Plugins:
    1
    Minecraft User:
    TheDeibo
    Non of us understand your language, and I doubt you would be able to understand this... Keep different languages within the International part of the forum.

    Also

    Your API may need to change to 2.0.0
  4. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
  5. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    A oto blad z consoli [14:49:51] [Server thread/ERROR]: Could not load '/home/data/mod2060/558732.pocketmp/plugins/StoneFarm_v1.phar' in folder '/home/data/mod2060/558732.pocketmp/plugins/': internal corruption of phar "/home/data/mod2060/558732.pocketmp/plugins/StoneFarm_v1.phar" (truncated manifest header)
    [14:49:51] [Server thread/CRITICAL]: UnexpectedValueException: "internal corruption of phar "/home/data/mod2060/558732.pocketmp/plugins/StoneFarm_v1.phar" (truncated manifest header)" (EXCEPTION) in "/src/pocketmine/plugin/PharPluginLoader" at line 65​
  6. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Stop your thread go Google translate.
  7. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
  8. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Chyba powědaś Polski. Proszę używać Google Translator do komunikowania się z nami.
    Wódaj śo, njamam powědaś Polski, powědam Serbski... ;)
  9. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Survingo likes this.
  10. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    please go to International forum.
  11. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    PHP:
    $gracz->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1$blok->getFloorZ()), new Stone());
    //WTF!?
    Replace with
    $gracz
    ->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1$blok->getFloorZ()), Block::get(Block::STONE));
  12. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    So it has to be as if you posted me an example ?
  13. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Don't edit a phar directly. Also, talk in english here. This is an english only forum, if you don't want to talk in english, then use https://forums.pocketmine.net/international/.
    Please understand error messages, PHP and the PM-API.
    Survingo likes this.
  14. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    Good<?php __HALT_COMPILER(); ?>

    plugin.yml����V���e۶src/mafia/Main.php�
    ���V�
    �ˡ?�resources/config.ymlI���VI%lDQ�name: NowyDrop
    author: mafia
    description: Simple plugin for create endless stone with any dropping items whatever you want! Fully customizable
    version: 1
    main: mafia\Main
    api: [2.0.0]<?php

    namespace mafia;

    use pocketmine\plugin\PluginBase as PluginBase;
    use pocketmine\event\Listener as Listener;
    use pocketmine\utils\TextFormat;
    use pocketmine\event\block\BlockBreakEvent;
    use pocketmine\event\block\BlockPlaceEvent;
    use pocketmine\utils\Config;
    use pocketmine\block\Block;
    use pocketmine\block\Air;
    use pocketmine\block\Stone;
    use pocketmine\math\Vector3;
    use pocketmine\item\Item;
    use pocketmine\level\particle\LavaParticle;
    use pocketmine\level\sound\BlazeShootSound;


    class Main extends PluginBase implements Listener{


    public function onEnable(){
    $this->getServer()->getPluginManager()->registerEvents($this,$this);
    $this->saveDefaultConfig();
    $this->getServer()->getLogger()->info(TextFormat::GREEN . "Wszelkie błędy zgłaszaj do Jelly'ego");
    }
    public function onPlace(BlockPlaceEvent $event){
    $blok = $event->getBlock();
    $gracz = $event->getPlayer();
    $y = $blok->getFloorY();
    $x = $blok->getFloorX();
    $z = $blok->getFloorZ();

    if($blok->getId() == 121){
    if(!($event->isCancelled())){
    $gracz->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1, $blok->getFloorZ()), new Stone());
    $gracz-
    >sendMessage(TextFormat::YELLOW . "[StoneFarm] " . TextFormat::GREEN . "Postawiłeś stoniarke!");
    $center = new Vector3($x, $y, $z);
    $particle = new LavaParticle($center);
    for($yaw = 0, $y = $center->y; $y < $center->y + 3; $yaw += (M_PI * 2) / 20, $y += 1 / 20) {
    $x = -sin($yaw) + $center->x;
    $z = cos($yaw) + $center->z;
    $particle->setComponents($x, $y, $z);
    $gracz->getLevel()->addParticle($particle);
    $gracz->getLevel()->addSound(new BlazeShootSound ( $gracz->getPosition () ), array($gracz) );
    }
    }else{
    $gracz->sendMessage(TextFormat::YELLOW . "[StoneFarm] " . TextFormat::RED . "Nie możesz postawić tutaj stoniarki, ten teren jest zabezpieczony");
    }
    }
    }

    public function onBreak(BlockBreakEvent $event){
    $blok = $event->getBlock();
    $gracz = $event-> Replace with
    $gracz->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1, $blok->getFloorZ()), Block::get(Block::STONE)); ($x, $y-1, $z))->getId() == 121) {
    $event->setCancelled();
    if($this->getConfig()->get("rzeczy-do-eq") == "tak"){
    $gracz->getInventory()->addItem(Item::get($this->getConfig()->get("item"), 0, $this->getConfig()->get("ilosc")));
    }elseif($this->getConfig()->get("rzeczy-do-eq") == "nie"){
    $gracz->getLevel()->dropItem(new Vector3($x, $y, $z), Item::get($this->getConfig()->get("item"), 0, $this->getConfig()->get("ilosc")));
    }
    }
    }elseif($blok->getId() == 121){
    $gracz->getLevel()->setBlock(new Vector3($blok->getFloorX(), $blok->getFloorY()+1, $blok->getFloorZ()), new Air());
    $gracz->sendMessage(TextFormat::YELLOW . "[StoneFarm] " . TextFormat::RED . "Stoniarka usunięta!");
    $center = new Vector3($x, $y, $z);
    $particle = new LavaParticle($center);
    for($yaw = 0, $y = $center->y; $y < $center->y + 3; $yaw += (M_PI * 2) / 20, $y += 1 / 20) {
    $x = -sin($yaw) + $center->x;
    $z = cos($yaw) + $center->z;
    $particle->setComponents($x, $y, $z);
    $gracz->getLevel()->addParticle($particle);
    $gracz->getLevel()->addSound(new BlazeShootSound ( $gracz->getPosition () ), array($gracz) );
    }
    }
    }
    }#StoneFarm by mafia


    #Jeśli opcja "rzeczy-do-eq" będzie ustawiona na "tak" - rzeczy ze stoniarki
    #będą trafiały do eq, jeśli na "nie" - rzeczy będą dropił normalnie

    rzeczy-do-eq: tak

    #Item, który będzie dropił z kamienia, domyślnie - cobblestone

    item: 4

    #Ilość wydobywanego itemu, domyślnie - 1

    ilosc: 1���(*g�/처�W�R�GBMB
  15. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Lol I 'm just help. I correct this error
  16. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    I do not work so please txt example, in every turn he writes to tell kom mcpe 0.14.3 plug on his serve because I got the code on skype and I do not know where to add so please instance where add
  17. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    In php and pm - api what I write ?? Please provide a detailed description and php and add me where to enter
  18. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    use pmt.mcpe.me for extract your Plugin.
  19. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
  20. polakpl
    Offline

    polakpl New Member

    Joined:
    Jul 19, 2015
    Posts:
    22
    Minecraft User:
    zombiePl
    So pocket apk use the mine to extract ?

Share This Page

Advertisement