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

Plugin help

Comments in 'Plugin Development' started by PEMapModder, Nov 14, 2013.

  1. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I am developing a map on the server, and to make the facilities in every team equal, I tried to make a plugin that does things like this:
    Code:
     on tile.update at (x,y,z), sync (x,y,256-z), (256-x,y,z) and (256-x,y,256-z) 
    However this doesn't work:
    PHP:
    public function tileUpdate(&$data){
            
    $player=$this->api->player->get($data->data["creator"]);
            
    $level=$player->entity->level;
            
    $x=$data->data["x"];
            
    $y=$data->data["y"];
            
    $z=$data->data["z"];
            
    $posO=new Position($x,$y,$z,$level);
            
    $posDeltaX=new Position((256-$x),$y,$z,$level);
            
    $posDeltaZ=new Position($x,$y,(256-$z),$level);
            
    $posDeltaXZ=new Position((256-$x),$y,(256-$z),$level);;
            
    $items=$data->class;
            
    $level->setBlock($posDeltaX,$level->getBlock($posO));
            
    $level->setBlock($posDeltaZ,$level->getBlock($posO));
            
    $level->setBlock($posDeltaXZ,$level->getBlock($posO));
        }
    P.S. Where should I look at the src code about $this->api->addHandler() and $this->api->event()?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Another question:
    I know there is a function $this->api->plugin->load($scriptName), but is there a way to unload a script?
  3. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Take a look at my NetherQuick plugin, it does something like that
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What about my first question

Share This Page

Advertisement