Hi Kevin, Since I saw that you made a modified version of wies's redstone plugin, I was wondering how to make it in a plugin so that tapping a torch opens the iron door next to it, tapping again closes it... I tried for around 2 hours today, modifying the redstone plugin but I still can't figure it out. I know I need to add a player.block.touch handler and how to make the plugin, but I just can't figure out how to make the iron door move/change faces. Any help will be appreciated Thanks in advance
It's dissabled in the src code of pocketmine. open the file PocketMine-MP\src\material\block\nonfull\IronDoor.php and remove // from the 25 line. when that's done, you can open irondoors by touching it. But that's not what you want in a redstone plugin, so I dissabled activating a iron door in the plugin by handling "player.block.activate". You could propebly do it without changing the src code, but I was to stupid for that edit: You could do it without changing the code with this script: PHP: if(($door->meta & 0x08) === 0x08){ $down = $door->getSide(0); $level = $this->api->level->getDefault(); if($down->getID() == 71){ $meta = $down->getMetadata() ^ 0x04; $level->setBlock($down, BlockAPI::get(71, $meta), true, false, true); return true; } return false; }else{ $door->meta ^= 0x04; $level->setBlock($this, $this, true, false, true); } return true; }
Sorry, but this not helpful because if you have a error and i post the error here and your internet is down if the problem is not solved his going to make a post and duplicate the question