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 26, 2013.

  1. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What is the wrong thing in this script?
    No errors dumped at console/LOG files. Runs perfectly except ....... this function does nothing.
    Code:
    public function init(){
                $this->api->addHandler("player.block.place",array($this,"blockPlace"));
    ########
    }
    ########
        public function blockPlace(&$data,$event){
            $player=$data["player"];
            $level=$player->entity->level;
            if ($level->getName()==="lobby2" and $this->syncOn($player->username)===true) {
                $oB=$data["target"];
                $vT=new Vector3($oB->x,$oB->y,$oB->z);
                $block=$level->getBlock(new Vector3($oB->x,$oB->y,$oB->z));
                $vX=new Vector3(255-$block->x,$block->y,$block->z);
                $vXZ=new Vector3($block->x,$block->y,255-$block->z);
                $vZ=new Vector3(255-$block->x,$block->y,255-$block->z);
                $level->setBlockRaw($vX,$block);
                $level->setBlockRaw($vXZ,$block);
                $level->setBlockRaw($vZ,$block);
            }
        }
    
  2. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,434
    Plugins:
    14
    Um, does it have something to do with the random "&" in the function?
  3. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    Also known as a reference.
  4. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    Oh shit, I just realised how old this is...
    hoyinm14mc, Exxarion and Jon like this.
  5. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,434
    Plugins:
    14
    I know that now. XD

Share This Page

Advertisement