lever bug

Discussion in 'Plugin Development' started by matter123, Jul 21, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    matter123

    can somone confirm that lever.setPowerd(true); doesnt work i cant get it to work and before i post as a bug it would be nice to know that im not just doing somthing wrong
     
  2. Offline

    bleachisback

    lever.setData(0x8)
     
  3. Offline

    The Angry kat

    Are you sure it isn't powered
     
  4. Offline

    matter123

    @bleachisback ill try that but the lever also uses its data for other things so that might harm it
    @The Angry kat yes i am
     
  5. Offline

    JoshuaBehrens

    So just combine it ?
    Code:
    boolean isLeverOn(Block b)
    {
        return b.getData() & 0x8 == b.getData();
    }
    void setLever(Block b, boolean on)
    {
        Byte d = b.getData() % 0x8;
        if (on)
            d = d | 0x8;
        b.setData(d);
    }
    It's just out of my head. But it should work.
     
Thread Status:
Not open for further replies.

Share This Page