Development Assistance Fanciful 1.8?

Discussion in 'Plugin Help/Development/Requests' started by Peter25715, Jan 10, 2015.

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

    Peter25715

  2. Offline

    Skionz

    @Peter25715 You can always just write the json and send the packet yourself.
     
    Xtreme727 and ChipDev like this.
  3. Offline

    Peter25715

    I have tried this.. Doesn't work.

    Code:
    package me.PeterSa.Hub;
    
    import mkremins.fanciful.FancyMessage;
    
    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class HubInfo extends JavaPlugin implements Listener {
       
        public void onEnable() {
            PluginDescriptionFile pdf = getDescription();
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
            Bukkit.getServer().getLogger().info("[FlameHubInfo] has been enabled successfully by: " + pdf.getAuthors() + ", v" + pdf.getVersion());
            Bukkit.getServer().getLogger().info("[FlameHubInfo] " + pdf.getDescription());
        }
       
       
       
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
           
            String bending = new FancyMessage("§eClick me to see information about §bbending!")
            .tooltip("§bBending.. :"
                    , "§eBending AKA (ProjectKorra)."
                    , "§eIt is about manipulating 1 of the four elements."
                    , "§eThe four elements are :"
                    , "§fAir§e, §2Earth§e, §6Fire §eand §bWater§e."
                    , "§1------------------------------------------------"
                    , "Water is for offensive and defensive uses."
                    , "Earth requires a steady position."
                    , "Fire is for the aggressive ones."
                    , "Air is for the passive and peaceful people"
                    , "§1------------------------------------------------")
                    .toJSONString();
           
            if (cmd.getName().equalsIgnoreCase("bendinginfo")) {
                sender.sendMessage(bending);
            }
            return true;
        }
    
    }
     
  4. Offline

    NathanWolf

    I just switched to 0.3.1-SNAPSHOT and it seems to work fine in 1.8 without any code changes on my part.
     
  5. Offline

    Peter25715

    Do you have to put the Maven thing?
     
  6. Offline

    NathanWolf

    I use Maven because it's easy for me. If you don't use Maven, I think all you have to do is download that version and add it to your build path, in place of the one you're using now.
     
  7. Offline

    Peter25715

    Can't find 0.3.1-SNAPSHOT.. Could you please tell me where to get it?
     
  8. Offline

    NathanWolf

    Not needing to know where to go to download libs is why I use Maven :)

    You could just look in the Maven repo yourself, I suppose- it's just a website and they are generally browsable.

    http://repo.franga2000.com/artifactory/public
     
  9. Offline

    Peter25715

    Code:
        public void onJoin(PlayerJoinEvent e) {
           
            new FancyMessage("Click me to see information about ")
            .color(ChatColor.YELLOW)
            .then("Bending")
            .style(ChatColor.UNDERLINE)
            .color(ChatColor.AQUA)
            .link("http://projectkorra.com/forum/")
               .tooltip("§bBending.. :"
                    , "§eBending AKA (ProjectKorra)."
                    , "§eIt is about manipulating 1 of the four elements."
                    , "§eThe four elements are :"
                    , "§fAir§e, §2Earth§e, §6Fire §eand §bWater§e."
                    , "§1------------------------------------------------"
                    , "Water is for offensive and defensive uses."
                    , "Earth requires a steady position."
                    , "Fire is for the aggressive ones."
                    , "Air is for the passive and peaceful people"
                    , "§1------------------------------------------------")
            .send(e.getPlayer());
        }
    I've got the jar file and made this testing code.
    Anything wrong? :\

    Jar File > http://gyazo.com/369404b7c7b739374b33b7fc9c860ac3
     
  10. Offline

    glen3b

    I believe that will work (haven't tested it, haven't tested my code below), but it would probably be good to use JSON colors:


    Code:
        private FancyMessage colorTxt(char colorCode, string msg){
              return new FancyMessage(msg).color(ChatColor.getByChar(colorCode));
        }
    
        public void onJoin(PlayerJoinEvent e) {
         
            new FancyMessage("Click me to see information about ")
            .color(ChatColor.YELLOW)
            .then("Bending")
            .style(ChatColor.UNDERLINE)
            .color(ChatColor.AQUA)
            .link("http://projectkorra.com/forum/")
               .formattedTooltip(colorTxt('b', "Bending.. :")
                    , colorTxt('e', "Bending AKA (ProjectKorra).")
                    , colorTxt('e', "It is about manipulating 1 of the four elements.")
                    , colorTxt('e', "The four elements are :")
                    , colorTxt('f', "Air").then(", ").color(ChatColor.YELLOW).then("Earth").color(ChatColor.DARK_GREEN).then(", ").color(ChatColor.YELLOW).then("Fire").color(ChatColor.GOLD).then(" and ").color(ChatColor.YELLOW).then("Water").color(ChatColor.AQUA).then(".").color(ChatColor.YELLOW)
                    , colorTxt('1', "------------------------------------------------")
                    , new FancyMessage("Water is for offensive and defensive uses.")
                    , new FancyMessage("Earth requires a steady position.")
                    , new FancyMessage("Fire is for the aggressive ones.")
                    , new FancyMessage("Air is for the passive and peaceful people")
                    , colorTxt('1', "------------------------------------------------"))
            .send(e.getPlayer());
        }
    I'm thinking about writing a PR for this kind of thing, parsing a FancyMessage from a formatted string, which would effectively let you do something like FancyMessage.fromString("§bBending").

    Proud contributing developer to Fanciful :D
     
  11. Offline

    timtower Administrator Moderator

    Moved to Bukkit alternatives
     
Thread Status:
Not open for further replies.

Share This Page