Weird SignChangeEvent

Discussion in 'Plugin Help/Development/Requests' started by 16davidjm6, Jan 25, 2015.

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

    16davidjm6

    Code:
    @EventHandler
        public void makeSign(SignChangeEvent event){
            logToFile(event.getPlayer().getName() + ": changed the text on a sign");
           
            //check if the player has permission to make this sign
            if(!event.getPlayer().hasPermission("randomtp.sign.make")){
                logToFile(event.getPlayer().getName() + ": does not have permission to make a sign for this plugin");
                return;
            }
           
            //get the first line of the sign
            String line = event.getLines()[0];
            logToFile(event.getPlayer().getName() + ": first line: " + line)
           
            //check if the text is set correctly
            if(!line.equalsIgnoreCase("[randomtp]")){
                logToFile(event.getPlayer().getName() + ": has permission to make a sign for this plugin, but made a different sign");
                logToFile(event.getPlayer().getName() + ": sign's first line: " + line);
                return;
            }
           
            //change the color to blue
            event.setLine(0, ChatColor.DARK_BLUE + "[RandomTP]");
           
            //debug
            logToFile(event.getPlayer().getName() + ": made a sign");
        }
    So this code works perfectly on 99% of servers. A player creates a sign. If they have the correct permission, and the first line of the sign says [RandomTP], the text on the first line turns blue.

    However, of the thousands of downloads this plugin has, 1 person came with a report saying this didn't work. When looking at their debug file, it said that their first line was ?0[RandomTP].

    This only happens on 1 server and I can't figure out why. Does anyone have any idea? (I have tested this code on 18 other servers ranging from MC 1.5 to MC 1.8 with no issues)
     
  2. Offline

    Ambamore2000

    Well, because it said '?', that could mean something. Have you tested it on his server, or he just opened an issue with saying that?
     
  3. Offline

    16davidjm6

    he opened an issue with saying it. I've tried different things such as stripping the color code, which didn't work.
     
  4. Offline

    TehHypnoz

    Did he try disabling all other plugins and then testing it?
     
  5. Offline

    16davidjm6

    yes
     
  6. Offline

    567legodude

    Either they actually typed ?o.... On the sign or maybe they tried putting a color code on the sign.
     
  7. Offline

    Shevchik

    Probably he is using MAC, it sometimes adds this weird symbol to the sign text.
     
  8. Offline

    16davidjm6

    They had told me they were on the most recent version of bukkit. I had them actually give me their version number and they were on git-Bukkit-24557bc. This is before the thing that tells you how many versions behind you are was even added.

    They haven't replied since I had them update, so I assume it was some bug that existed somewhere along the way in bukkit.

    Issue solved.
     
Thread Status:
Not open for further replies.

Share This Page