Merge pull request #439 from Rsl1122/4.1.1

Pull Request for 4.1.1
This commit is contained in:
Rsl1122 2017-12-02 20:11:20 +02:00 committed by GitHub
commit 1ece719019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 101 additions and 20 deletions

View File

@ -92,7 +92,13 @@ public class PlayerProfile implements OfflinePlayer {
long threeWeeksAgo = date - 3L * week;
long activePlayThreshold = Settings.ACTIVE_PLAY_THRESHOLD.getNumber() * TimeAmount.MINUTE.ms();
if (activePlayThreshold <= 0) {
activePlayThreshold = 1;
}
int activeLoginThreshold = Settings.ACTIVE_LOGIN_THRESHOLD.getNumber();
if (activeLoginThreshold <= 0) {
activeLoginThreshold = 1;
}
List<Session> sessionsWeek = getSessions(weekAgo, date).collect(Collectors.toList());
List<Session> sessionsWeek2 = getSessions(twoWeeksAgo, weekAgo).collect(Collectors.toList());

View File

@ -169,7 +169,9 @@ public class ServerProfile {
}
public double getNewPlayersPerDay(long after, long before) {
return getNewPlayers(after, before) * 1.0 / AnalysisUtils.getNumberOfDaysBetween(after, before);
long days = AnalysisUtils.getNumberOfDaysBetween(after, before);
long newPlayers = getNewPlayers(after, before);
return days == 0 ? newPlayers : newPlayers * 1.0 / days;
}
public Stream<PlayerProfile> getPlayersWhoPlayedBetween(long after, long before) {

View File

@ -44,6 +44,9 @@ public class ThemeConfig extends Config {
private static String getFileLocation(String fileName) {
switch (fileName.toLowerCase()) {
case "soft":
case "soften":
return "themes/soft.yml";
case "mute":
case "lowsaturation":
return "themes/mute.yml";

View File

@ -186,23 +186,31 @@ public class AnalysisUtils {
double probability = 1.0;
int stickM = 0;
for (StickyData stickyData : stickyStuckM) {
if (similarM.contains(stickyData)) {
stickM++;
}
if (similarM.isEmpty() && similarW.isEmpty()) {
return 0;
}
probability *= (stickM / similarM.size());
int stickW = 0;
for (StickyData stickyData : stickyStuckW) {
if (similarW.contains(stickyData)) {
stickW++;
if (!similarM.isEmpty()) {
int stickM = 0;
for (StickyData stickyData : stickyStuckM) {
if (similarM.contains(stickyData)) {
stickM++;
}
}
probability *= (stickM / similarM.size());
}
if (!similarW.isEmpty()) {
int stickW = 0;
for (StickyData stickyData : stickyStuckW) {
if (similarW.contains(stickyData)) {
stickW++;
}
}
probability *= (stickW / similarW.size());
}
probability *= (stickW / similarW.size());
return probability;
}

View File

@ -7,6 +7,7 @@ package main.java.com.djrapitops.plan.utilities.file.export;
import com.djrapitops.plugin.api.utility.log.Log;
import java.io.IOException;
import java.util.ConcurrentModificationException;
import java.util.UUID;
/**
@ -34,7 +35,7 @@ public class AnalysisExport extends SpecificExport {
} finally {
try {
this.cancel();
} catch (IllegalArgumentException ignore) {
} catch (ConcurrentModificationException | IllegalArgumentException ignore) {
}
}
}

View File

@ -73,7 +73,7 @@ public class HtmlExport extends SpecificExport {
} finally {
try {
this.cancel();
} catch (IllegalArgumentException ignore) {
} catch (ConcurrentModificationException | IllegalArgumentException ignore) {
}
}
}

View File

@ -7,6 +7,7 @@ package main.java.com.djrapitops.plan.utilities.file.export;
import com.djrapitops.plugin.api.utility.log.Log;
import java.io.IOException;
import java.util.ConcurrentModificationException;
import java.util.UUID;
/**
@ -34,7 +35,7 @@ public class PlayerExport extends SpecificExport {
} finally {
try {
this.cancel();
} catch (IllegalArgumentException ignore) {
} catch (ConcurrentModificationException | IllegalArgumentException ignore) {
}
}
}

View File

@ -1,4 +1,4 @@
name: Plan
author: Rsl1122
main: main.java.com.djrapitops.plan.PlanBungee
version: 4.1.0
version: 4.1.1

View File

@ -1,7 +1,7 @@
name: Plan
author: Rsl1122
main: main.java.com.djrapitops.plan.Plan
version: 4.1.0
version: 4.1.1
softdepend:
- EssentialsX
- Towny

View File

@ -0,0 +1,57 @@
# Default Theme bar color when user has not chosen a color
DefaultColor: "light-green"
Font:
# Location of the FontStyleSheet, eg. https://fonts.googleapis.com/css?family=Quicksand:300,400
FontStyleSheet: https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext
# Name of the Font for CSS eg "'Quicksand', sans-serif"
FontFamily: '"Roboto", sans-serif'
# Color codes for each theme element color
# These affect icons & backgrounds of all elements of this color.
Colors:
red: "#F43D2C"
pink: "#C41744"
purple: "#791C70"
deep-purple: "#4C286F"
indigo: "#2F376F"
blue: "#3293D5"
light-blue: "#1CA9DD"
cyan: "#27BFC8"
teal: "#007B63"
green: "#69B54C"
light-green: "#BAD364"
lime: "#EFEF84"
yellow: "#FFFAA8"
amber: "#FFDF5C"
orange: "#FFB527"
deep-orange: "#FE5A1F"
brown: "#623F2F"
grey: "#C1B5A9"
blue-grey: "#617372"
black: "#000000"
Extra:
White: "#fff"
# Useful tool for html colors
# https://www.w3schools.com/colors/colors_picker.asp
GraphColors:
PunchCard: "#0A0908"
PlayersOnline: "#298ADA"
TPS:
High: "#1C5601"
Medium: "#F5E461"
Low: "#9F352F"
CPU: "#F7ECA4"
RAM: "#AFD93F"
Chunks: "#BF870F"
Entities: "#BC76EA"
WorldPie: '"#00869B", "#79AC00", "#25455D", "#8D3472", "#33A887", "#C5BC24", "#492176", "#EA7C00", "#307F4C", "#516681"'
GMDrilldown: '"#8D3472", "#33A887", "#C5BC24", "#492176"'
ActivityPie: '"#69B54C", "#BAD364", "#EFEF84", "#FFDF5C", "#617372"'
ServerPreferencePie: '"#00869B", "#79AC00", "#25455D", "#8D3472", "#33A887", "#C5BC24", "#492176", "#EA7C00", "#307F4C", "#516681"'
# Leave blank "" for white
ParsedElements:
SessionAccordion: "teal"
ServerAccordion: "light-green"

View File

@ -61,8 +61,11 @@ public class EssentialsData extends PluginData {
}
}
analysisContainer.addValue(getWithIcon("Players in Jail", "ban", "red"), jailed.size() + " / " + uuids.size());
analysisContainer.addValue(getWithIcon("Muted", "bell-slash-o", "deep-orange"), muted.size() + " / " + uuids.size());
String jailedString = jailed.values().stream().filter("Yes"::equals).count() + " / " + uuids.size();
String mutedString = muted.values().stream().filter("Yes"::equals).count() + " / " + uuids.size();
analysisContainer.addValue(getWithIcon("Players in Jail", "ban", "red"), jailedString);
analysisContainer.addValue(getWithIcon("Muted", "bell-slash-o", "deep-orange"), mutedString);
analysisContainer.addPlayerTableValues(getWithIcon("Jailed", "ban"), jailed);
analysisContainer.addPlayerTableValues(getWithIcon("Muted", "bell-slash-o"), muted);