Add tooltips and commands for f invite command as specified in issue #73.

This commit is contained in:
drtshock 2014-10-13 14:10:18 -05:00
parent 272c35cda6
commit 04fd18f17a
3 changed files with 183 additions and 1 deletions

134
dependency-reduced-pom.xml Normal file
View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId>
<name>Factions</name>
<version>1.6.9.5-U0.1.5</version>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<defaultGoal>clean package install</defaultGoal>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<finalName>Factions</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<includes>
<include>mkremins:fanciful</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>mkremins.fanciful</pattern>
<shadedPattern>com.massivecraft.factions.shade.mkremins.fanciful</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
</repository>
<repository>
<id>ess-repo</id>
<url>http://repo.ess3.net/content/groups/public</url>
</repository>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>maven.sk89q.com</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<repository>
<id>fanciful-mvn-repo</id>
<url>https://raw.github.com/mkremins/fanciful/mvn-repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.10-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.7.10-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>5.8.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>5.6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>EssentialsChat</artifactId>
<version>LATEST</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

36
pom.xml
View File

@ -36,8 +36,35 @@
<target>1.6</target> <target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<configuration>
<artifactSet>
<includes>
<include>mkremins:fanciful</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>mkremins.fanciful</pattern>
<shadedPattern>com.massivecraft.factions.shade.mkremins.fanciful</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
@ -77,6 +104,11 @@
<version>LATEST</version> <version>LATEST</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>mkremins</groupId>
<artifactId>fanciful</artifactId>
<version>0.2.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>
@ -96,5 +128,9 @@
<id>maven.sk89q.com</id> <id>maven.sk89q.com</id>
<url>http://maven.sk89q.com/repo/</url> <url>http://maven.sk89q.com/repo/</url>
</repository> </repository>
<repository>
<id>fanciful-mvn-repo</id>
<url>https://raw.github.com/mkremins/fanciful/mvn-repo/</url>
</repository>
</repositories> </repositories>
</project> </project>

View File

@ -3,6 +3,8 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdInvite extends FCommand { public class CmdInvite extends FCommand {
@ -43,7 +45,17 @@ public class CmdInvite extends FCommand {
myFaction.invite(you); myFaction.invite(you);
you.msg("%s<i> 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<i> invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you));
myFaction.msg("%s<i> invited %s<i> to your faction.", fme.describeTo(myFaction, true), you.describeTo(myFaction)); myFaction.msg("%s<i> invited %s<i> to your faction.", fme.describeTo(myFaction, true), you.describeTo(myFaction));
} }