Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wea_ondara
committed
Feb 9, 2016
1 parent
69b092f
commit 6ae327e
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/java/net/alpenblock/bungeeperms/testsuite/bukkit/tests/DisplayableTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.alpenblock.bungeeperms.testsuite.bukkit.tests; | ||
|
||
import net.alpenblock.bungeeperms.BungeePerms; | ||
import net.alpenblock.bungeeperms.User; | ||
import net.alpenblock.bungeeperms.testsuite.bukkit.BukkitTest; | ||
import net.alpenblock.bungeeperms.testsuite.bukkit.BukkitTestSuite; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.command.CommandSender; | ||
|
||
public class DisplayableTest extends BukkitTest | ||
{ | ||
|
||
@Override | ||
public boolean test(CommandSender sender) | ||
{ | ||
if (Bukkit.getPlayer(BukkitTestSuite.getTestplayer()) == null) | ||
{ | ||
throw new RuntimeException("test player " + BukkitTestSuite.getTestplayer() + " not found"); | ||
} | ||
|
||
User u = BungeePerms.getInstance().getPermissionsManager().getUser(BukkitTestSuite.getTestplayer()); | ||
if (u == null) | ||
{ | ||
throw new RuntimeException("test player " + BukkitTestSuite.getTestplayer() + " not found"); | ||
} | ||
|
||
sender.sendMessage("Prefix: " + u.buildPrefix().replaceAll("§", "&")); | ||
sender.sendMessage("Suffix: " + u.buildSuffix().replaceAll("§", "&")); | ||
|
||
return result(); | ||
} | ||
|
||
@Override | ||
public String getName() | ||
{ | ||
return "DisplayableTest"; | ||
} | ||
|
||
} |