Solved Change a Slab to a other one

Discussion in 'Plugin Development' started by Seadragon91, Dec 30, 2011.

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

    Seadragon91

    Hello!

    I tried to change a slab to a other slab over setData(). I thought that It work like by the wool, but nothing happens.
    Here is my code on pastebin:
    http://pastebin.com/PJVMQdGS

    I maked 2 class the Main Class and a class for the Event PlayerListener. I do not see what I am doing wrong. Do I have to use a other method?
     
  2. Offline

    nisovin

    That's odd. I'd guess it's some kind of bug. However, you can get it to work by changing this:
    Code:
    b.setData((byte) PlayerActions.value);
    to this:
    Code:
    b.setTypeIdAndData(b.getTypeId(), (byte) PlayerActions.value, true);
    Just so you know, your code was actually working, it just wasn't sending the block update to the player. If you logged out and back in you would see that the block actually had changed.
     
  3. Offline

    Seadragon91

    Ty it works :), but whats the difference?
     
  4. Offline

    nisovin

    One of them is sending the updated block to the player and the other one isn't. I honestly don't know why.
     
  5. Offline

    Seadragon91

    Ok ty. Should I closed this as solved?
     
Thread Status:
Not open for further replies.

Share This Page