Solved Hologram problem?

Discussion in 'Spigot Plugin Development' started by zbturtle, May 21, 2016.

  1. I am using holographic displays and yesterday my plugin was working on this portion but today it is just creating the hologram with the barriers and it has ullnull ullnull where the lines for the hologram were yesterday and still should be.

    Here is this section of code:
    Code (Text):
        public void onPlayerJoinHologramWelcome(PlayerJoinEvent event) {
            Player p = event.getPlayer();
            Location location = p.getLocation().add(0.0, 4.0, 0.0);
            //if(getConfig().getBoolean("Welcome-new-players-with-hologram")) {
                //if(p.hasPlayedBefore() == false||p.getName().equalsIgnoreCase("zbturtle")) {
            Hologram hologram = HologramsAPI.createHologram(this, location);
            TextLine welcomelineone = hologram.appendTextLine("§" + getConfig().getString("Welcome-new-players-with-hologram-message-color-line-one") + getConfig().getString("Welcome-new-players-with-hologram-message-line-one"));
            TextLine welcomelineonetwo = hologram.insertTextLine(1, "§" + getConfig().getString("Welcome-new-players-with-hologram-message-color-line-two") + getConfig().getString("Welcome-new-players-with-hologram-message-line-two"));
            ItemLine welcomeitemlineone = hologram.appendItemLine(new ItemStack(Material.BARRIER));
            ItemLine welcomeitemlineonetwo = hologram.insertItemLine(0, new ItemStack(Material.BARRIER));
            //Hologram hologram = HologramAPI.createHologram(location, "§" + getConfig().getString("Welcome-new-players-with-hologram-message-color") + getConfig().getString("Welcome-new-players-with-hologram-message"));
            int seconds = 10;
            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
            public void run() {
            }, (seconds * 20));

      //  }
    Thanks in advance!
  2. The reason for the "ullnull" is because the section symbol and the first "n" in "nullnull" translates to ullnull - does "Welcome-new-players-with-hologram-message-color-line-one" and "Welcome-new-players-with-hologram-message-line-one" *definitely* exist in your config? same for line two.
  3. Tried that, didn't see a difference.
  4. Anyone have any ideas why this is happening to me?
  5. Please, someone, I really need to fix this I just can't focus and work on more functions in the plugin until I know everything so far is working correctly and from yesterday to today this became a problem and it was working so I am clueless. Please help me.
  6. Literally any ideas to fix it are appreciated...
  7. Also, I believe everything matches one another.
  8. Omg! You've waited a whole 5 HOURS and no one has helped you!?!? I feel sorry for you man :(.
  9. I have constantly been trying to fix it during this time. Searched many different things hoping to find similar problems others have had, found nothing.
  10. Also, I can't tell if that is sarcasm or not.
  11. I almost want to report this guy for bumping a thread 6 times in 3 hours, but i have this feeling he has no idea it is wrong..
    • Agree Agree x 2
  12. Btw, it has been up more then 3 hours.
  13. TextLine welcomelineonetwo = hologram.insertTextLine(1, "§" + getConfig().getString("Welcome-new-players-with-hologram-message-color-line-two") + getConfig().getString("Welcome-new-players-with-hologram-message-line-two"));

    The Strings you get from config are null.
  14. Fine, but if they print §nullnull, they are § + null + null. Does the class extend JavaPlugin or is getConfig() a different method?
  15. Doesn't make it any less wrong. You should only bump a thread after 24 hours. Not everyone has all day to reply to every thread, so just be patient.
  16. This is all my code:

    getConfig() is not another method in it as you can see, and it does extend JavaPlugin.

    PS: This is my main class.
  17. getConfig().addDefault("Welcome-new-players-with-hologram-message-line-one", Integer.valueOf(getConfig().getInt("Welcome-new-players-with-hologram-message-line-one")));

    I never use addDefault() myself, but it seems to me that this can't work. You're setting the value to itself which is kinda redundant and you use a numeric data format, Integer, but try to to get a character sequence: A String. There are a lot of things you could improve in your code, maybe get through it step by step and try to actually understand what exactly your code does?
  18. Truthfully, that completely flew over my head when I was looking for it, I expected it to be further down in the hologram itself. Also, why had this worked for me earlier then?
  19. Yep, that fixed it, thanks, I didn't even realize I had it as integer's there, I had changed some aspects in the plugin and just replaced some of the parts in the getConfig()'s not even realizing I still had them as integers.