Solved Help me with sign

Discussion in 'Plugin Development' started by polak, Jan 31, 2020.

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

    polak

    PHP:
    fod1sign = new Location(Bukkit.getWorld("world"), (int) 16, (int) 116, (int) 7).getBlock();
            
    fod2sign = new Location(Bukkit.getWorld("world"), (int) 16, (int) 116, (int) 9).getBlock();
            
    fod1sign.setType(Material.WALL_SIGN);
            
    fod2sign.setType(Material.WALL_SIGN);
            
    fod1sign.setData((byte0x04);
            
    fod2sign.setData((byte0x04);
            ((
    Signfod1sign.getState()).setLine(0"some text");
            ((
    Signfod1sign.getState()).setLine(1"some text");
            ((
    Signfod1sign.getState()).setLine(2"some text");
            ((
    Signfod1sign.getState()).setLine(3"some text");
            ((
    Signfod1sign.getState()).update();
            
    this.getLogger().info("Sign placed");
            ((
    Signfod2sign.getState()).setLine(0"some text");
            ((
    Signfod2sign.getState()).setLine(1"some text");
            ((
    Signfod2sign.getState()).setLine(2"some text");
            ((
    Signfod2sign.getState()).setLine(3"some text");
            ((
    Signfod2sign.getState()).update();
    [​IMG]

    What i am do wrong?
     
  2. Online

    timtower Administrator Administrator Moderator

    @polak Please post the full method. And why all the casting?
     
  3. Offline

    Strahan

    What is the problem? Your image shows what should happen in console when a sign is placed according to the code, so that looks right. If the sign isn't getting set right, mentioning that would be of assistance, yes? In other words, elucidate on the problem. Also post the method as timtower asked; context can be helpful.

    Also what version of MC is this for?
     
  4. Offline

    polak

    Forgot to say a problem.
    setLine doesnt write on sign, but sign places on block
    1.7.10
     
  5. Offline

    KarimAKL

    @polak You didn't post the method.
     
    Xp10d3 likes this.
  6. Offline

    polak

    Its just a function that calling in onEnable
     
  7. Offline

    Xp10d3

    Please post the method/full class. We have no idea how to help if there isn't enough code for us to work with.
     
  8. Offline

    polak

    method of what?
     
  9. Online

    timtower Administrator Administrator Moderator

    Where that code is being used.
     
  10. Offline

    polak

    in my plugin
     
  11. Online

    timtower Administrator Administrator Moderator

    Post the entire method that contains the code that you posted.
     
  12. Offline

    Xp10d3

    Yes the FULL method. Not just a snippet; the whole method. Like
    Code:
    public static void onPing(PlayerPingEvent event) {
      msg.delete();
    }
    
     
    Last edited: Feb 10, 2020
  13. Offline

    polak

    Code:
    public void onEnable() {
            this.getServer().getPluginManager().registerEvents(this, this);
            this.placeAllSigns();
            if(Bukkit.getWorld("mainlobby") == null) {
                this.createWorld("mainlobby");
            }
            if(Bukkit.getWorld("fod-1") == null) {
                this.createWorld("fod-1");
            }
            if(Bukkit.getWorld("fod-2") == null) {
                this.createWorld("fod-2");
            }
        }
    Code:
        public void placeAllSigns() {
            fod1sign = new Location(Bukkit.getWorld("mainlobby"), (int) 16, (int) 116, (int) 7).getBlock();
            fod2sign = new Location(Bukkit.getWorld("mainlobby"), (int) 16, (int) 116, (int) 9).getBlock();
            fod1sign.setType(Material.WALL_SIGN);
            fod2sign.setType(Material.WALL_SIGN);
            fod1sign.setData((byte) 0x04);
            fod2sign.setData((byte) 0x04);
            ((Sign) fod1sign.getState()).setLine(0, "some text");
            ((Sign) fod1sign.getState()).setLine(1, "some text");
            ((Sign) fod1sign.getState()).setLine(2, "some text");
            ((Sign) fod1sign.getState()).setLine(3, "some text");
            ((Sign) fod1sign.getState()).update();
            this.getLogger().info("Sign placed");
            ((Sign) fod2sign.getState()).setLine(0, "some text");
            ((Sign) fod2sign.getState()).setLine(1, "some text");
            ((Sign) fod2sign.getState()).setLine(2, "some text");
            ((Sign) fod2sign.getState()).setLine(3, "some text");
            ((Sign) fod2sign.getState()).update();
            this.getLogger().info("Sign placed");
        }
     
    Xp10d3 likes this.
  14. Offline

    polak

    /del fixed
     
    Xp10d3 likes this.
Thread Status:
Not open for further replies.

Share This Page