Color on signs

Discussion in 'Plugin Development' started by RobotA69, Mar 8, 2012.

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

    RobotA69

    Will this work for adding colors onto a sign?

    PHP:
    @EventHandler
    public void onSignChange(SignChangeEvent event) {
    BlockState state event.getBlock().getState();
    if(
    state instanceof Sign) {
    Sign sign = (Signstate;
    if(
    event.getLine(0).contains("****")) {
    String line0 event.getLine(0);
    String nline0 line0.replaceAll("(&([a-f0-9]))""\u00A7$2");
    event.setLine(0nline0);
    sign.update(true);
     }
     
  2. Offline

    Njol

    Why don't you test it?
     
  3. Offline

    Zelnehlun

    I do not think you need to call sign.update() because you are modifying the lines in the event.
     
Thread Status:
Not open for further replies.

Share This Page