Skip to content

Commit

Permalink
[Refactor] Remove Doxygen uploading.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiracleM4n committed May 25, 2015
1 parent 8545b64 commit a61a5ed
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 80 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jdk: oraclejdk7
# Get files for use with build, namely the custom Maven settings.xml.
before_install:
- "git clone https://github.com/Q0rDev/travis-ci-resources.git target/travis"
- "git clone https://github.com/Q0rDev/q0rdev-javadocs.git -b gh-pages target/doxy"
#- "git clone https://github.com/Q0rDev/q0rdev-javadocs.git -b gh-pages target/doxy"
- "chmod +x target/travis/build.sh"
- "chmod +x target/travis/upload.sh"
- "chmod +x target/travis/doxy.sh"
#- "chmod +x target/travis/doxy.sh"

# Compile and package JAR and set build properties.
install: true
Expand All @@ -17,7 +17,7 @@ script: ./target/travis/build.sh
# Upload to DBO if release build / Upload to AWS always / Create Doxy files.
after_success:
- "./target/travis/upload.sh"
- "./target/travis/doxy.sh"
#- "./target/travis/doxy.sh"

# Upload to AWS Always
after_failure:
Expand Down
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>MChat</name>
<artifactId>MChat</artifactId>
<packaging>jar</packaging>
<version>1.7.9-R0.7-SNAPSHOT</version>
<version>1.8.0-R0.1-SNAPSHOT</version>
<url>https://github.com/Q0rDev/MChat</url>
<description>Chat Formatting for Bukkit</description>

Expand Down Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.9-R0.2</version>
<version>1.8-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Expand All @@ -60,6 +60,13 @@
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ru.tehkode</groupId>
<artifactId>PermissionsEx</artifactId>
<version>1.22.6</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.palmergames</groupId>
<artifactId>Towny</artifactId>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/ca/q0r/mchat/MChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public class MChat extends JavaPlugin {
// Default Plugin Data
Expand All @@ -45,7 +44,7 @@ public void onEnable() {
killEss();

// Initialize Metrics
getServer().getScheduler().runTaskLater(this, new BukkitRunnable() {
getServer().getScheduler().runTaskLater(this, new Runnable() {
@Override
public void run() {
try {
Expand Down Expand Up @@ -80,7 +79,7 @@ public void run() {

// Updater
if (ConfigType.MCHAT_UPDATE_CHECK.getBoolean()) {
getServer().getScheduler().runTaskLater(this, new BukkitRunnable() {
getServer().getScheduler().runTaskLater(this, new Runnable() {
@Override
public void run() {
MChat mchat = (MChat) Bukkit.getPluginManager().getPlugin("MChat");
Expand Down
1 change: 0 additions & 1 deletion src/main/java/ca/q0r/mchat/api/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class API {
public static void initialize() {
setupPlugins();

spying = new HashMap<String, Boolean>();
}

/**
Expand Down
162 changes: 106 additions & 56 deletions src/main/java/ca/q0r/mchat/api/Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,24 @@ public class Reader {
* @param info Info Variable being resolved.
* @return Raw Info.
*/
@Deprecated
public static String getRawInfo(UUID uuid, InfoType type, String world, String info) {
return getRawInfo(uuid, world, info);
}

/**
* Raw Info Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Name of the InfoType's World.
* @param info Info Variable being resolved.
* @return Raw Info.
*/
public static String getRawInfo(UUID uuid, String world, String info) {
if (uuid == null) {
return "";
}

if (type == null) {
type = InfoType.USER;
}

if (world == null) {
world = Bukkit.getServer().getWorlds().get(0).getName();
}
Expand All @@ -46,16 +55,16 @@ public static String getRawInfo(UUID uuid, InfoType type, String world, String i
}

if (API.isPluginEnabled(PluginType.VAULT_CHAT)) {
return getVaultChatInfo(uuid, type, world, info);
return getVaultChatInfo(uuid, world, info);
} else if (API.isPluginEnabled(PluginType.LEVELED_NODES)) {
return getLeveledInfo(uuid, info);
} else if (API.isPluginEnabled(PluginType.OLD_NODES)) {
return getBukkitInfo(uuid, info);
} else if (API.isPluginEnabled(PluginType.NEW_INFO)) {
return getMChatInfo(uuid, type, world, info);
return getMChatInfo(uuid, world, info);
}

return getMChatInfo(uuid, type, world, info);
return getMChatInfo(uuid, world, info);
}

/**
Expand All @@ -66,8 +75,20 @@ public static String getRawInfo(UUID uuid, InfoType type, String world, String i
* @param world Name of the InfoType's World.
* @return Raw Prefix.
*/
@Deprecated
public static String getRawPrefix(UUID uuid, InfoType type, String world) {
return getRawInfo(uuid, type, world, "prefix");
return getRawInfo(uuid, world, "prefix");
}

/**
* Raw Prefix Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Name of the InfoType's World.
* @return Raw Prefix.
*/
public static String getRawPrefix(UUID uuid, String world) {
return getRawInfo(uuid, world, "prefix");
}

/**
Expand All @@ -78,8 +99,20 @@ public static String getRawPrefix(UUID uuid, InfoType type, String world) {
* @param world Name of the InfoType's World.
* @return Raw Suffix.
*/
@Deprecated
public static String getRawSuffix(UUID uuid, InfoType type, String world) {
return getRawInfo(uuid, type, world, "suffix");
return getRawInfo(uuid, world, "suffix");
}

/**
* Raw Suffix Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Name of the InfoType's World.
* @return Raw Suffix.
*/
public static String getRawSuffix(UUID uuid, String world) {
return getRawInfo(uuid, world, "suffix");
}

/**
Expand All @@ -90,8 +123,20 @@ public static String getRawSuffix(UUID uuid, InfoType type, String world) {
* @param world Name of the InfoType's World.
* @return Raw Group.
*/
@Deprecated
public static String getRawGroup(UUID uuid, InfoType type, String world) {
return getRawInfo(uuid, type, world, "group");
return getRawInfo(uuid, world, "group");
}

/**
* Raw Group Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Name of the InfoType's World.
* @return Raw Group.
*/
public static String getRawGroup(UUID uuid, String world) {
return getRawInfo(uuid, world, "group");
}

/**
Expand All @@ -103,8 +148,21 @@ public static String getRawGroup(UUID uuid, InfoType type, String world) {
* @param info Info Variable being resolved.
* @return Raw Info.
*/
@Deprecated
public static String getInfo(UUID uuid, InfoType type, String world, String info) {
return MessageUtil.addColour(getRawInfo(uuid, type, world, info));
return MessageUtil.addColour(getRawInfo(uuid, world, info));
}

/**
* Raw Info Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Player's World.
* @param info Info Variable being resolved.
* @return Raw Info.
*/
public static String getInfo(UUID uuid, String world, String info) {
return MessageUtil.addColour(getRawInfo(uuid, world, info));
}

/**
Expand All @@ -115,8 +173,20 @@ public static String getInfo(UUID uuid, InfoType type, String world, String info
* @param world Name of the InfoType's World.
* @return Formatted Prefix.
*/
@Deprecated
public static String getPrefix(UUID uuid, InfoType type, String world) {
return getInfo(uuid, type, world, "prefix");
return getInfo(uuid, world, "prefix");
}

/**
* Formatted Prefix Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Name of the InfoType's World.
* @return Formatted Prefix.
*/
public static String getPrefix(UUID uuid, String world) {
return getInfo(uuid, world, "prefix");
}

/**
Expand All @@ -127,10 +197,23 @@ public static String getPrefix(UUID uuid, InfoType type, String world) {
* @param world Name of the InfoType's World.
* @return Formatted Suffix.
*/
@Deprecated
public static String getSuffix(UUID uuid, InfoType type, String world) {
return getInfo(uuid, type, world, "suffix");
return getInfo(uuid, world, "suffix");
}

/**
* Formatted Suffix Resolving
*
* @param uuid Defining value of the InfoType (Also known as name/uuid).
* @param world Name of the InfoType's World.
* @return Formatted Suffix.
*/
public static String getSuffix(UUID uuid, String world) {
return getInfo(uuid, world, "suffix");
}


/**
* Formatted Group Resolving
*
Expand All @@ -139,22 +222,20 @@ public static String getSuffix(UUID uuid, InfoType type, String world) {
* @return Formatted Group.
*/
public static String getGroup(UUID uuid, String world) {
return getInfo(uuid, InfoType.USER, world, "group");
return getInfo(uuid, world, "group");
}

private static String getMChatInfo(UUID uuid, InfoType type, String world, String info) {
private static String getMChatInfo(UUID uuid, String world, String info) {
if (info.equals("group")) {
return getMChatGroup(uuid);
}

String iType = type.getConfValue();

YamlConfiguration infoConfig = YmlManager.getYml(YmlType.INFO_YML).getConfig();

if (infoConfig.isSet(iType + "." + uuid.toString() + ".info." + info)) {
return infoConfig.getString(iType + "." + uuid.toString() + ".info." + info);
} else if (infoConfig.isSet(iType + "." + uuid.toString() + ".worlds." + world + "." + info)) {
return infoConfig.getString(iType + "." + uuid.toString() + ".worlds." + world + "." + info);
if (infoConfig.isSet("users." + uuid.toString() + ".info." + info)) {
return infoConfig.getString("users." + uuid.toString() + ".info." + info);
} else if (infoConfig.isSet("users." + uuid.toString() + ".worlds." + world + "." + info)) {
return infoConfig.getString("users." + uuid.toString() + ".worlds." + world + "." + info);
} else if (infoConfig.isSet("users." + uuid.toString() + ".group")) {
String group = infoConfig.getString("users." + uuid.toString() + ".group");

Expand Down Expand Up @@ -228,7 +309,7 @@ private static String getBukkitInfo(UUID uuid, String info) {
if (API.checkPermissions(uuid, entry.getKey())) {
String infoResolve = entry.getValue().toString();

if (infoResolve != null && !info.isEmpty()) {
if (!info.isEmpty()) {
return infoResolve;
}

Expand All @@ -240,21 +321,7 @@ private static String getBukkitInfo(UUID uuid, String info) {
return "";
}

private static String getVaultChatInfo(UUID uuid, InfoType type, String world, String info) {
String infoString = "";

if (type == InfoType.USER) {
infoString = getVaultChatUserInfo(uuid, world, info);
}

if (type == InfoType.GROUP || infoString.equals("")) {
getVaultChatGroupInfo(uuid, world, info);
}

return infoString;
}

private static String getVaultChatUserInfo(UUID uuid, String world, String info) {
private static String getVaultChatInfo(UUID uuid, String world, String info) {
OfflinePlayer player = Bukkit.getServer().getOfflinePlayer(uuid);
String infoString = "";

Expand All @@ -273,23 +340,6 @@ private static String getVaultChatUserInfo(UUID uuid, String world, String info)
return infoString;
}

private static String getVaultChatGroupInfo(UUID uuid, String world, String info) {
String name = Bukkit.getServer().getPlayer(uuid).getName();
String infoString = "";

if (!API.vChat.getName().equals("MChat")) {
if (info.equals("prefix")) {
infoString = API.vChat.getGroupPrefix(world, name);
} else if (info.equals("suffix")) {
infoString = API.vChat.getGroupSuffix(world, name);
} else {
infoString = API.vChat.getGroupInfoString(world, name, info, "");
}
}

return infoString;
}

/**
* Group Name Resolver
*
Expand All @@ -299,7 +349,7 @@ private static String getVaultChatGroupInfo(UUID uuid, String world, String info
public static String getGroupName(String group) {
YamlConfiguration infoConfig = YmlManager.getYml(YmlType.INFO_YML).getConfig();

if (group.isEmpty()) {
if (group == null || group.isEmpty()) {
return "";
}

Expand All @@ -319,7 +369,7 @@ public static String getGroupName(String group) {
public static String getWorldName(String world) {
YamlConfiguration infoConfig = YmlManager.getYml(YmlType.INFO_YML).getConfig();

if (world.isEmpty()) {
if (world == null || world.isEmpty()) {
return "";
}

Expand Down
Loading

0 comments on commit a61a5ed

Please sign in to comment.