From 04fd18f17acf48fb3f7f56d8fd1afab0aeb35839 Mon Sep 17 00:00:00 2001 From: drtshock Date: Mon, 13 Oct 2014 14:10:18 -0500 Subject: [PATCH] Add tooltips and commands for f invite command as specified in issue #73. --- dependency-reduced-pom.xml | 134 ++++++++++++++++++ pom.xml | 36 +++++ .../massivecraft/factions/cmd/CmdInvite.java | 14 +- 3 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 dependency-reduced-pom.xml diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml new file mode 100644 index 00000000..04f78b32 --- /dev/null +++ b/dependency-reduced-pom.xml @@ -0,0 +1,134 @@ + + + 4.0.0 + com.massivecraft + Factions + Factions + 1.6.9.5-U0.1.5 + + ${basedir}/src/main/java + clean package install + + + . + true + ${basedir}/src/main/resources/ + + *.yml + + + + Factions + + + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + maven-shade-plugin + 2.2 + + + package + + shade + + + + + + + mkremins:fanciful + + + + + mkremins.fanciful + com.massivecraft.factions.shade.mkremins.fanciful + + + + + + + + + vault-repo + http://nexus.theyeticave.net/content/repositories/pub_releases + + + ess-repo + http://repo.ess3.net/content/groups/public + + + bukkit-repo + http://repo.bukkit.org/content/groups/public/ + + + maven.sk89q.com + http://maven.sk89q.com/repo/ + + + fanciful-mvn-repo + https://raw.github.com/mkremins/fanciful/mvn-repo/ + + + + + org.bukkit + bukkit + 1.7.10-R0.1-SNAPSHOT + compile + + + org.bukkit + craftbukkit + 1.7.10-R0.1-SNAPSHOT + compile + + + net.milkbowl.vault + VaultAPI + 1.4 + provided + + + com.sk89q + worldguard + 5.8.1-SNAPSHOT + compile + + + com.sk89q + worldedit + 5.6.1 + compile + + + net.ess3 + Essentials + LATEST + provided + + + net.ess3 + EssentialsChat + LATEST + provided + + + lombok + org.projectlombok + + + + + + UTF-8 + + + diff --git a/pom.xml b/pom.xml index d83e71a1..94a091f5 100644 --- a/pom.xml +++ b/pom.xml @@ -36,8 +36,35 @@ 1.6 + + org.apache.maven.plugins + maven-shade-plugin + 2.2 + + + + mkremins:fanciful + + + + + mkremins.fanciful + com.massivecraft.factions.shade.mkremins.fanciful + + + + + + package + + shade + + + + + org.bukkit @@ -77,6 +104,11 @@ LATEST provided + + mkremins + fanciful + 0.2.0-SNAPSHOT + @@ -96,5 +128,9 @@ maven.sk89q.com http://maven.sk89q.com/repo/ + + fanciful-mvn-repo + https://raw.github.com/mkremins/fanciful/mvn-repo/ + diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java b/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java index 35b9b3f0..f6197d2a 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java @@ -3,6 +3,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Conf; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.struct.Permission; +import mkremins.fanciful.FancyMessage; +import org.bukkit.ChatColor; public class CmdInvite extends FCommand { @@ -43,7 +45,17 @@ public class CmdInvite extends FCommand { myFaction.invite(you); - you.msg("%s invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you)); + // Tooltips, colors, and commands only apply to the string immediately before it. + FancyMessage message = new FancyMessage(fme.describeTo(you, true)) + .tooltip("Click to join!").command("f join " + myFaction.getTag()) + .then(" has invited you to join ").color(ChatColor.YELLOW) + .tooltip("Click to join!").command("f join " + myFaction.getTag()) + .then(myFaction.describeTo(you)) + .tooltip("Click to join!").command("f join " + myFaction.getTag()); + + message.send(you.getPlayer()); + + //you.msg("%s invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you)); myFaction.msg("%s invited %s to your faction.", fme.describeTo(myFaction, true), you.describeTo(myFaction)); }