mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-22 16:11:37 +01:00
Fix #232
This commit is contained in:
parent
a3891aa790
commit
298286180c
@ -1,13 +1,9 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.2/abstract-plugin-framework-2.0.2.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/../../Abstract-Plugin-Framework/AbstractPluginFramework/target/AbstractPluginFramework.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.2/abstract-plugin-framework-2.0.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.2/abstract-plugin-framework-2.0.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.djrapitops</groupId>
|
||||
<artifactId>PlanPluginBridge</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.6.3</version>
|
||||
<packaging>jar</packaging>
|
||||
<repositories>
|
||||
<repository>
|
||||
@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>com.djrapitops</groupId>
|
||||
<artifactId>Plan</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.6.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -1,23 +1,26 @@
|
||||
package com.djrapitops.pluginbridge.plan.advancedachievements;
|
||||
|
||||
import com.hm.achievement.api.AdvancedAchievementsAPI;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
||||
import main.java.com.djrapitops.plan.utilities.MiscUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* PluginData class for AdvancedAchievements-plugin.
|
||||
*
|
||||
* <p>
|
||||
* Registered to the plugin by AdvancedAchievementsHook.
|
||||
*
|
||||
* <p>
|
||||
* Gives the amount of achievements as value.
|
||||
*
|
||||
* @author Rsl1122
|
||||
* @since 3.1.0
|
||||
* @see AdvancedAchievementsHook
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public class AdvancedAchievementsAchievements extends PluginData {
|
||||
|
||||
@ -57,6 +60,14 @@ public class AdvancedAchievementsAchievements extends PluginData {
|
||||
lastRefresh = MiscUtils.getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<UUID, Serializable> getValues(Collection<UUID> uuid) {
|
||||
if (MiscUtils.getTime() - lastRefresh > 60000) {
|
||||
refreshTotalAchievements();
|
||||
}
|
||||
return new HashMap<>(totalAchievements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getValue(UUID uuid) {
|
||||
if (MiscUtils.getTime() - lastRefresh > 60000) {
|
||||
|
@ -1,11 +1,12 @@
|
||||
package com.djrapitops.pluginbridge.plan.askyblock;
|
||||
|
||||
import com.wasteofplastic.askyblock.ASkyBlockAPI;
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* PluginData class for ASkyBlock-plugin.
|
||||
*
|
||||
|
@ -2,16 +2,13 @@ package com.djrapitops.pluginbridge.plan.essentials;
|
||||
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.earth2me.essentials.Warps;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
||||
import main.java.com.djrapitops.plan.ui.html.Html;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* PluginData class for Essentials-plugin.
|
||||
*
|
||||
@ -56,7 +53,7 @@ public class EssentialsWarps extends PluginData {
|
||||
Collections.sort(warps);
|
||||
StringBuilder html = new StringBuilder();
|
||||
if (warps.isEmpty()) {
|
||||
html.append(Html.TABLELINE_4.parse(Html.FACTION_NO_FACTIONS.parse(), "", "", ""));
|
||||
html.append(Html.TABLELINE_4.parse("No Factions", "", "", ""));
|
||||
} else {
|
||||
for (String warp : warps) {
|
||||
html.append(Html.TABLELINE_2.parse(warp, "/warp " + warp));
|
||||
@ -67,11 +64,7 @@ public class EssentialsWarps extends PluginData {
|
||||
|
||||
@Override
|
||||
public Serializable getValue(UUID uuid) {
|
||||
Warps warps = essentials.getWarps();
|
||||
if (!warps.isEmpty()) {
|
||||
return warps.getList().toString();
|
||||
}
|
||||
return "No Warps.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,12 +3,6 @@ package com.djrapitops.pluginbridge.plan.factions;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.FactionColl;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import main.java.com.djrapitops.plan.Settings;
|
||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
||||
@ -16,14 +10,20 @@ import main.java.com.djrapitops.plan.ui.html.Html;
|
||||
import main.java.com.djrapitops.plan.utilities.FormatUtils;
|
||||
import main.java.com.djrapitops.plan.utilities.HtmlUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* PluginData class for Factions-plugin.
|
||||
*
|
||||
* <p>
|
||||
* Registered to the plugin by FactionsHook
|
||||
*
|
||||
* @author Rsl1122
|
||||
* @since 3.1.0
|
||||
* @see FactionsHook
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public class FactionsTable extends PluginData {
|
||||
|
||||
@ -31,7 +31,7 @@ public class FactionsTable extends PluginData {
|
||||
|
||||
/**
|
||||
* Class Constructor, sets the parameters of the PluginData object.
|
||||
*
|
||||
* <p>
|
||||
* Uses Html to easily parse Html for the table.
|
||||
*
|
||||
* @see FactionsHook
|
||||
@ -67,7 +67,7 @@ public class FactionsTable extends PluginData {
|
||||
StringBuilder html = new StringBuilder();
|
||||
this.factions = getTopFactions();
|
||||
if (factions.isEmpty()) {
|
||||
html.append(Html.TABLELINE_4.parse(Html.FACTION_NO_FACTIONS.parse(), "", "", ""));
|
||||
html.append(Html.TABLELINE_4.parse("No Factions", "", "", ""));
|
||||
} else {
|
||||
for (Faction f : factions) {
|
||||
String name;
|
||||
@ -77,14 +77,14 @@ public class FactionsTable extends PluginData {
|
||||
if (f != null) {
|
||||
name = f.getName();
|
||||
MPlayer fLeader = f.getLeader();
|
||||
leader = fLeader != null ? fLeader.getNameAndSomething("", "") : Html.FACTION_NO_LEADER.parse();
|
||||
leader = fLeader != null ? fLeader.getNameAndSomething("", "") : "No Leader";
|
||||
power = FormatUtils.cutDecimals(f.getPower());
|
||||
land = f.getLandCount() + "";
|
||||
} else {
|
||||
name = Html.FACTION_NOT_FOUND.parse();
|
||||
leader = Html.FACTION_NOT_FOUND.parse();
|
||||
power = Html.FACTION_NOT_FOUND.parse();
|
||||
land = Html.FACTION_NOT_FOUND.parse();
|
||||
name = "Not Found";
|
||||
leader = "Not Found";
|
||||
power = "Not Found";
|
||||
land = "Not Found";
|
||||
}
|
||||
String leaderPage = Html.LINK.parse(HtmlUtils.getInspectUrl(leader), leader);
|
||||
html.append(Html.TABLELINE_4.parse(name, power, land, leaderPage));
|
||||
|
@ -4,17 +4,17 @@ import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
import com.palmergames.bukkit.towny.object.Town;
|
||||
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import main.java.com.djrapitops.plan.Settings;
|
||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
||||
import main.java.com.djrapitops.plan.ui.html.Html;
|
||||
import main.java.com.djrapitops.plan.utilities.HtmlUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* PluginData class for Towny-plugin.
|
||||
*
|
||||
@ -45,7 +45,7 @@ public class TownyTable extends PluginData {
|
||||
StringBuilder html = new StringBuilder();
|
||||
List<Town> towns = getTopTowns();
|
||||
if (towns.isEmpty()) {
|
||||
html.append(Html.TABLELINE_4.parse(Html.TOWN_NO_TOWNS.parse(), "", "", ""));
|
||||
html.append(Html.TABLELINE_4.parse("No Towns", "", "", ""));
|
||||
} else {
|
||||
for (Town t : towns) {
|
||||
if (t == null) {
|
||||
|
@ -3,13 +3,13 @@ package com.djrapitops.pluginbridge.plan.towny;
|
||||
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
import main.java.com.djrapitops.plan.Phrase;
|
||||
import main.java.com.djrapitops.plan.Plan;
|
||||
import main.java.com.djrapitops.plan.data.UserData;
|
||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* PluginData class for Towny-plugin.
|
||||
*
|
||||
@ -37,7 +37,7 @@ public class TownyTown extends PluginData {
|
||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
||||
UserData data = Plan.getPlanAPI().getInspectCachedUserDataMap().get(uuid);
|
||||
if (data == null) {
|
||||
return parseContainer(modifierPrefix, Phrase.NOT_IN_TOWN + "");
|
||||
return parseContainer(modifierPrefix, "Not in a Town");
|
||||
}
|
||||
String name = data.getName();
|
||||
try {
|
||||
@ -46,11 +46,11 @@ public class TownyTown extends PluginData {
|
||||
if (res.hasTown()) {
|
||||
town = res.getTown().getName();
|
||||
} else {
|
||||
town = Phrase.NOT_IN_TOWN + "";
|
||||
town = "Not in a Town";
|
||||
}
|
||||
return parseContainer("", town);
|
||||
} catch (NotRegisteredException ex) {
|
||||
return parseContainer(modifierPrefix, Phrase.NOT_IN_TOWN + "");
|
||||
return parseContainer(modifierPrefix, "Not in a Town");
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class TownyTown extends PluginData {
|
||||
public Serializable getValue(UUID uuid) {
|
||||
UserData data = Plan.getPlanAPI().getInspectCachedUserDataMap().get(uuid);
|
||||
if (data == null) {
|
||||
return Phrase.NOT_IN_TOWN + "";
|
||||
return "Not in a Town";
|
||||
}
|
||||
String name = data.getName();
|
||||
try {
|
||||
@ -67,7 +67,7 @@ public class TownyTown extends PluginData {
|
||||
if (res.hasTown()) {
|
||||
town = res.getTown().getName();
|
||||
} else {
|
||||
town = Phrase.NOT_IN_TOWN + "";
|
||||
town = "Not in a Town";
|
||||
}
|
||||
return town;
|
||||
} catch (NotRegisteredException ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user