Fix #87
Fix #85
Fix #81
Added suggestion for changing green colors from #65
This commit is contained in:
Rsl1122 2017-05-11 20:56:31 +03:00
parent a75447a77b
commit c1c77b55a8
6 changed files with 36 additions and 6 deletions

View File

@ -45,6 +45,11 @@ public enum Settings {
COLOR_SEC("Customization.Colors.Commands.Secondary"),
COLOR_TER("Customization.Colors.Commands.Highlight"),
//
HCOLOR_MAIN("Customization.HTML.UI.Main"),
HCOLOR_MAIN_DARK("Customization.HTML.UI.MainDark"),
HCOLOR_SEC("Customization.HTML.UI.Secondary"),
HCOLOR_TER("Customization.HTML.UI.Tertiary"),
HCOLOR_TER_DARK("Customization.HTML.UI.TertiaryDark"),
HCOLOR_ACT_ONL("Customization.Colors.HTML.ActivityGraph.OnlinePlayers"),
HCOLOR_ACT_ONL_FILL("Customization.Colors.HTML.ActivityGraph.OnlinePlayersFill"),
HCOLOR_ACTP_ACT("Customization.Colors.HTML.ActivityPie.Active"),

View File

@ -5,6 +5,7 @@ import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.cache.DataCacheHandler;
import main.java.com.djrapitops.plan.data.handling.info.DeathInfo;
import main.java.com.djrapitops.plan.data.handling.info.KillInfo;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -42,7 +43,17 @@ public class PlanDeathEventListener implements Listener {
Player killer = dead.getKiller();
boolean killerIsPlayer = killer != null;
if (killerIsPlayer) {
handler.addToPool(new KillInfo(killer.getUniqueId(), time, dead, killer.getInventory().getItemInMainHand().getType().name()));
Material itemInHand;
try {
itemInHand = killer.getInventory().getItemInMainHand().getType();
} catch (Throwable e) {
try {
itemInHand = killer.getInventory().getItemInHand().getType();
} catch (Throwable e2) {
itemInHand = Material.AIR;
}
}
handler.addToPool(new KillInfo(killer.getUniqueId(), time, dead, itemInHand.name()));
}
if (dead instanceof Player) {
handler.addToPool(new DeathInfo(((Player) dead).getUniqueId()));

View File

@ -81,7 +81,7 @@ public class Response {
try {
String dataHtml = requestHandler.getInspectHtml(uuid);
String htmlDef = "HTTP/1.1 200 OK\r\n"
+ "Content-Type: text/html; charset=utf-8\r\n"
+ "Content-Type: text/html;\r\n"
+ "Content-Length: " + dataHtml.length() + "\r\n"
+ "\r\n";
output.write((htmlDef + dataHtml).getBytes());
@ -101,7 +101,7 @@ public class Response {
if (requestHandler.checkIfAnalysisIsCached()) {
String analysisHtml = requestHandler.getAnalysisHtml();
String htmlDef = "HTTP/1.1 200 OK\r\n"
+ "Content-Type: text/html; charset=utf-8\r\n"
+ "Content-Type: text/html;\r\n"
+ "Content-Length: " + analysisHtml.length() + "\r\n"
+ "\r\n";
output.write((htmlDef + analysisHtml).getBytes());

View File

@ -41,7 +41,8 @@ public class ManageUtils {
final Collection<UUID> uuids = ManageUtils.getUUIDS(copyFromDB);
if (uuids.isEmpty()) {
return false;
}
}
backupDB.init();
return clearAndCopy(backupDB, copyFromDB, uuids);
}
@ -58,7 +59,7 @@ public class ManageUtils {
for (UUID uuid : onTimeData.keySet()) {
OfflinePlayer player = getOfflinePlayer(uuid);
if (!plugin.getDB().wasSeenBefore(uuid)) {
handler.newPlayer(player);
}
DBCallableProcessor importer = new DBCallableProcessor() {

View File

@ -112,6 +112,13 @@ public class PlaceholderUtils {
String pluginsTabHtml = plugin.getHookHandler().getPluginsTabLayoutForAnalysis();
String replacedOnce = HtmlUtils.replacePlaceholders(pluginsTabHtml, data.getAdditionalDataReplaceMap());
replaceMap.put("%plugins%", HtmlUtils.replacePlaceholders(replacedOnce, data.getAdditionalDataReplaceMap()));
String[] colors = new String[]{Settings.HCOLOR_MAIN.toString(), Settings.HCOLOR_MAIN_DARK.toString(), Settings.HCOLOR_SEC.toString(), Settings.HCOLOR_TER.toString(), Settings.HCOLOR_TER_DARK.toString()};
String[] defaultCols = new String[]{"348e0f", "267F00", "5cb239", "89c471", "5da341"};
for (int i = 0; i < colors.length; i++) {
if (!defaultCols[i].equals(colors[i])) {
replaceMap.put("#"+defaultCols[i], "#"+colors[i]);
}
}
return replaceMap;
}
@ -194,7 +201,7 @@ public class PlaceholderUtils {
String pluginsTabHtml = plugin.getHookHandler().getPluginsTabLayoutForInspect();
Map<String, String> additionalReplaceRules = plugin.getHookHandler().getAdditionalInspectReplaceRules(uuid);
String replacedOnce = HtmlUtils.replacePlaceholders(pluginsTabHtml, additionalReplaceRules);
replaceMap.put("%plugins%", HtmlUtils.replacePlaceholders(replacedOnce, additionalReplaceRules));
replaceMap.put("%plugins%", HtmlUtils.replacePlaceholders(replacedOnce, additionalReplaceRules));
return replaceMap;
}
}

View File

@ -38,6 +38,12 @@ Customization:
Secondary: '&7'
Highlight: '&f'
HTML:
UI:
Main: 348e0f
MainDark: 267F00
Secondary: 5cb239
Tertiary: 89c471
TertiaryDark: 5da341
ActivityGraph:
OnlinePlayers: '1E90FF'
OnlinePlayersFill: '75BBFF'