mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-13 10:51:24 +01:00
Removed OnTime support
This commit is contained in:
parent
56ac0da8fe
commit
c494215d70
@ -39,12 +39,6 @@
|
|||||||
<version>5.2</version>
|
<version>5.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>me.edge209</groupId>
|
|
||||||
<artifactId>ontime</artifactId>
|
|
||||||
<version>4.1.4</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.earth2me</groupId>
|
<groupId>com.earth2me</groupId>
|
||||||
<artifactId>essentials</artifactId>
|
<artifactId>essentials</artifactId>
|
||||||
|
@ -14,7 +14,7 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* //TODO Class Javadoc Comment
|
* PluginData for Jobs plugin.
|
||||||
*
|
*
|
||||||
* @author Rsl1122
|
* @author Rsl1122
|
||||||
*/
|
*/
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.HookHandler;
|
|
||||||
import main.java.com.djrapitops.plan.api.API;
|
|
||||||
import com.djrapitops.pluginbridge.plan.Hook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Class responsible for hooking to OnTime and registering 6 data sources.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @since 3.1.0
|
|
||||||
*/
|
|
||||||
public class OnTimeHook extends Hook {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hooks the plugin and registers it's PluginData objects.
|
|
||||||
*
|
|
||||||
* API#addPluginDataSource uses the same method from HookHandler.
|
|
||||||
*
|
|
||||||
* @param hookH HookHandler instance for registering the data sources.
|
|
||||||
* @see API
|
|
||||||
* @throws NoClassDefFoundError when the plugin class can not be found.
|
|
||||||
*/
|
|
||||||
public OnTimeHook(HookHandler hookH) {
|
|
||||||
super("me.edge209.OnTime.OnTime", hookH);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void hook() throws NoClassDefFoundError {
|
|
||||||
if (enabled) {
|
|
||||||
addPluginDataSource(new OntimeVotes());
|
|
||||||
addPluginDataSource(new OntimeVotesWeek());
|
|
||||||
addPluginDataSource(new OntimeVotesMonth());
|
|
||||||
addPluginDataSource(new OntimeRefer());
|
|
||||||
addPluginDataSource(new OntimeReferWeek());
|
|
||||||
addPluginDataSource(new OntimeReferMonth());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
|
||||||
import me.edge209.OnTime.OnTimeAPI;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginData class for Ontime-plugin.
|
|
||||||
* <p>
|
|
||||||
* Registered to the plugin by OnTimeHook
|
|
||||||
* <p>
|
|
||||||
* Gives Total Referral Integer as value.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @see OnTimeHook
|
|
||||||
* @since 3.1.0
|
|
||||||
*/
|
|
||||||
public class OntimeRefer extends PluginData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Constructor, sets the parameters of the PluginData object.
|
|
||||||
*/
|
|
||||||
public OntimeRefer() {
|
|
||||||
super("OnTime", "refer", AnalysisType.LONG_TOTAL, AnalysisType.LONG_AVG);
|
|
||||||
super.setAnalysisOnly(false);
|
|
||||||
super.setIcon("commenting-o");
|
|
||||||
super.setPrefix("Referrals All Time: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long referTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.TOTALREFER);
|
|
||||||
if (referTotal == -1) {
|
|
||||||
return parseContainer(modifierPrefix, "No Referrals.");
|
|
||||||
}
|
|
||||||
return parseContainer(modifierPrefix, Long.toString(referTotal));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Serializable getValue(UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long referTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.TOTALREFER);
|
|
||||||
if (referTotal == -1) {
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
return referTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
|
||||||
import me.edge209.OnTime.OnTimeAPI;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginData class for Ontime-plugin.
|
|
||||||
*
|
|
||||||
* Registered to the plugin by OnTimeHook
|
|
||||||
*
|
|
||||||
* Gives Months Referral Integer as value.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @since 3.1.0
|
|
||||||
* @see OnTimeHook
|
|
||||||
*/
|
|
||||||
public class OntimeReferMonth extends PluginData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Constructor, sets the parameters of the PluginData object.
|
|
||||||
*/
|
|
||||||
public OntimeReferMonth() {
|
|
||||||
super("OnTime", "refer_30d", AnalysisType.LONG_TOTAL);
|
|
||||||
super.setAnalysisOnly(false);
|
|
||||||
super.setIcon("commenting-o");
|
|
||||||
super.setPrefix("Referrals Last 30d: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long referTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.MONTHREFER);
|
|
||||||
if (referTotal == -1) {
|
|
||||||
return parseContainer(modifierPrefix, "No Referrals.");
|
|
||||||
}
|
|
||||||
return parseContainer(modifierPrefix, Long.toString(referTotal));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Serializable getValue(UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long referTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.MONTHREFER);
|
|
||||||
if (referTotal == -1) {
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
return referTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
|
||||||
import me.edge209.OnTime.OnTimeAPI;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginData class for Ontime-plugin.
|
|
||||||
*
|
|
||||||
* Registered to the plugin by OnTimeHook
|
|
||||||
*
|
|
||||||
* Gives Week's Referral Integer as value.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @since 3.1.0
|
|
||||||
* @see OnTimeHook
|
|
||||||
*/
|
|
||||||
public class OntimeReferWeek extends PluginData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Constructor, sets the parameters of the PluginData object.
|
|
||||||
*/
|
|
||||||
public OntimeReferWeek() {
|
|
||||||
super("OnTime", "refer_7d", AnalysisType.LONG_TOTAL);
|
|
||||||
super.setAnalysisOnly(false);
|
|
||||||
super.setIcon("commenting-o");
|
|
||||||
super.setPrefix("Referrals Last 7d: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long referTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.WEEKREFER);
|
|
||||||
if (referTotal == -1) {
|
|
||||||
return parseContainer(modifierPrefix, "No Referrals.");
|
|
||||||
}
|
|
||||||
return parseContainer(modifierPrefix, Long.toString(referTotal));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Serializable getValue(UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long referTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.WEEKREFER);
|
|
||||||
if (referTotal == -1) {
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
return referTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
|
||||||
import me.edge209.OnTime.OnTimeAPI;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginData class for Ontime-plugin.
|
|
||||||
*
|
|
||||||
* Registered to the plugin by OnTimeHook
|
|
||||||
*
|
|
||||||
* Gives Total Votes Integer as value.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @since 3.1.0
|
|
||||||
* @see OnTimeHook
|
|
||||||
*/
|
|
||||||
public class OntimeVotes extends PluginData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Constructor, sets the parameters of the PluginData object.
|
|
||||||
*/
|
|
||||||
public OntimeVotes() {
|
|
||||||
super("OnTime", "votes", AnalysisType.LONG_TOTAL, AnalysisType.LONG_AVG);
|
|
||||||
super.setAnalysisOnly(false);
|
|
||||||
super.setIcon("check");
|
|
||||||
super.setPrefix("Votes All Time: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long votesTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.TOTALVOTE);
|
|
||||||
if (votesTotal == -1) {
|
|
||||||
return parseContainer(modifierPrefix, "No votes.");
|
|
||||||
}
|
|
||||||
return parseContainer(modifierPrefix, Long.toString(votesTotal));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Serializable getValue(UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long votesTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.TOTALVOTE);
|
|
||||||
if (votesTotal == -1) {
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
return votesTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
|
||||||
import me.edge209.OnTime.OnTimeAPI;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginData class for Ontime-plugin.
|
|
||||||
*
|
|
||||||
* Registered to the plugin by OnTimeHook
|
|
||||||
*
|
|
||||||
* Gives Month's Votes Integer as value.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @since 3.1.0
|
|
||||||
* @see OnTimeHook
|
|
||||||
*/
|
|
||||||
public class OntimeVotesMonth extends PluginData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Constructor, sets the parameters of the PluginData object.
|
|
||||||
*/
|
|
||||||
public OntimeVotesMonth() {
|
|
||||||
super("OnTime", "votes_30d", AnalysisType.LONG_TOTAL);
|
|
||||||
super.setAnalysisOnly(false);
|
|
||||||
super.setIcon("check");
|
|
||||||
super.setPrefix("Votes Last 30d: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long votesTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.MONTHVOTE);
|
|
||||||
if (votesTotal == -1) {
|
|
||||||
return parseContainer(modifierPrefix, "No votes.");
|
|
||||||
}
|
|
||||||
return parseContainer(modifierPrefix, Long.toString(votesTotal));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Serializable getValue(UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long votesTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.MONTHVOTE);
|
|
||||||
if (votesTotal == -1) {
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
return votesTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.djrapitops.pluginbridge.plan.ontime;
|
|
||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.AnalysisType;
|
|
||||||
import main.java.com.djrapitops.plan.data.additional.PluginData;
|
|
||||||
import me.edge209.OnTime.OnTimeAPI;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginData class for Ontime-plugin.
|
|
||||||
*
|
|
||||||
* Registered to the plugin by OnTimeHook
|
|
||||||
*
|
|
||||||
* Gives Week's Votes Integer as value.
|
|
||||||
*
|
|
||||||
* @author Rsl1122
|
|
||||||
* @since 3.1.0
|
|
||||||
* @see OnTimeHook
|
|
||||||
*/
|
|
||||||
public class OntimeVotesWeek extends PluginData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Constructor, sets the parameters of the PluginData object.
|
|
||||||
*/
|
|
||||||
public OntimeVotesWeek() {
|
|
||||||
super("OnTime", "votes_7d", AnalysisType.LONG_TOTAL);
|
|
||||||
super.setAnalysisOnly(false);
|
|
||||||
super.setIcon("check");
|
|
||||||
super.setPrefix("Votes Last 7d: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHtmlReplaceValue(String modifierPrefix, UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long votesTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.WEEKVOTE);
|
|
||||||
if (votesTotal == -1) {
|
|
||||||
return parseContainer(modifierPrefix, "No votes.");
|
|
||||||
}
|
|
||||||
return parseContainer(modifierPrefix, Long.toString(votesTotal));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Serializable getValue(UUID uuid) {
|
|
||||||
String name = getNameOf(uuid);
|
|
||||||
long votesTotal = OnTimeAPI.getPlayerTimeData(name, OnTimeAPI.data.WEEKVOTE);
|
|
||||||
if (votesTotal == -1) {
|
|
||||||
return -1L;
|
|
||||||
}
|
|
||||||
return votesTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user