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

[Helper] Please tell me your errors and I will try to fix it for you

Comments in 'Plugin Development' started by VanishedKevin, Sep 23, 2013.

  1. VanishedKevin
    Offline

    VanishedKevin Banned

    Joined:
    Aug 27, 2013
    Posts:
    279
    Minecraft User:
    VanishedKevin
    [Helper]
    Please tell me your errors and I will try to fix it for you.
  2. 99leonchang
    Offline

    99leonchang Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    165
    Plugins:
    2
    Minecraft User:
    99leonchang
    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 :)
  3. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    392
    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($downBlockAPI::get(71$meta), truefalsetrue);
                    return 
    true;
                }
                return 
    false;
            }else{
                
    $door->meta ^= 0x04;
                
    $level->setBlock($this$thistruefalsetrue);
            }
            return 
    true;
        }
    Last edited: Sep 25, 2013
  4. 99leonchang
    Offline

    99leonchang Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    165
    Plugins:
    2
    Minecraft User:
    99leonchang
    Ah thanks very much!
    You are indeed one of the best plugin programmers in this community :)
  5. InusualZ
    Offline

    InusualZ Active Member Plugin Developer

    Joined:
    Aug 23, 2013
    Posts:
    220
    Plugins:
    1
    Minecraft User:
    Inusu4lZ
    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
  6. spencer596
    Offline

    spencer596 New Member

    Joined:
    Sep 9, 2013
    Posts:
    9
    Minecraft User:
    spencer5980
    I have a problem with one of your plugins I try to use disguise command and the server crashed
  7. VanishedKevin
    Offline

    VanishedKevin Banned

    Joined:
    Aug 27, 2013
    Posts:
    279
    Minecraft User:
    VanishedKevin
    Lol, there always a way to prevent changing src but I am stupid... XD

Share This Page

Advertisement