Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraLS3 committed Aug 26, 2017
1 parent 3ef0ddb commit a9341bf
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 109 deletions.
2 changes: 1 addition & 1 deletion AbstractPluginFramework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>AbstractPluginFramework</artifactId>
<version>2.0.3</version>
<version>2.0.4</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.djrapitops.plugin.utilities.log.BukkitLog;
import com.djrapitops.plugin.utilities.log.PluginLog;
import com.djrapitops.plugin.utilities.player.Fetch;
import com.djrapitops.plugin.utilities.status.ProcessStatus;
import com.djrapitops.plugin.utilities.status.TaskStatus;
import org.bukkit.ChatColor;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -47,7 +46,6 @@ public abstract class BukkitPlugin<T extends BukkitPlugin> extends JavaPlugin im
private String debugMode = "false";
private ColorScheme colorScheme = new ColorScheme(ChatColor.WHITE, ChatColor.GRAY, ChatColor.DARK_GRAY);

private final ProcessStatus<T> progressStat;
private final TaskStatus<T> taskStat;
private final BenchUtil benchmark;
private PluginLog log;
Expand All @@ -62,7 +60,6 @@ public BukkitPlugin() {
} catch (IOException e) {
e.printStackTrace();
}
progressStat = new ProcessStatus(this);
taskStat = new TaskStatus(this);
benchmark = new BenchUtil(this);
factory = new RunnableFactory(this);
Expand Down Expand Up @@ -179,11 +176,6 @@ public void setLog(PluginLog log) {
this.log = log;
}

@Override
public ProcessStatus<T> processStatus() {
return progressStat;
}

@Override
public TaskStatus<T> taskStatus() {
return taskStat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.djrapitops.plugin.utilities.log.BungeeLog;
import com.djrapitops.plugin.utilities.log.PluginLog;
import com.djrapitops.plugin.utilities.player.Fetch;
import com.djrapitops.plugin.utilities.status.ProcessStatus;
import com.djrapitops.plugin.utilities.status.TaskStatus;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.plugin.Listener;
Expand All @@ -36,7 +35,6 @@ public abstract class BungeePlugin<T extends BungeePlugin> extends Plugin implem
private String debugMode = "false";
private ColorScheme colorScheme = new ColorScheme(ChatColor.WHITE, ChatColor.GRAY, ChatColor.DARK_GRAY);

private final ProcessStatus<T> progressStat;
private final TaskStatus<T> taskStat;
private final BenchUtil benchmark;
private PluginLog log;
Expand All @@ -51,7 +49,6 @@ public BungeePlugin() {
} catch (IOException e) {
e.printStackTrace();
}
progressStat = new ProcessStatus(this);
taskStat = new TaskStatus(this);
benchmark = new BenchUtil(this);
factory = new RunnableFactory(this);
Expand Down Expand Up @@ -167,11 +164,6 @@ public void setLog(PluginLog log) {
this.log = log;
}

@Override
public ProcessStatus<T> processStatus() {
return progressStat;
}

@Override
public TaskStatus<T> taskStatus() {
return taskStat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.djrapitops.plugin.utilities.NotificationCenter;
import com.djrapitops.plugin.utilities.log.PluginLog;
import com.djrapitops.plugin.utilities.player.Fetch;
import com.djrapitops.plugin.utilities.status.ProcessStatus;
import com.djrapitops.plugin.utilities.status.TaskStatus;

/**
Expand All @@ -22,8 +21,6 @@ public interface IPlugin {

void onEnableDefaultTasks();

ProcessStatus processStatus();

TaskStatus taskStatus();

String getVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
public class StaticHolder {

private static final String apfVersion = "2.0.3";
private static final String apfVersion = "2.0.4";
private static final Map<Class, BukkitPlugin> INSTANCES_BUKKIT = new HashMap<>();
private static final Map<Class, BungeePlugin> INSTANCES_BUNGEE = new HashMap<>();
private static Class utilityProvider = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.utilities.NotificationCenter;
import com.djrapitops.plugin.utilities.status.ProcessStatus;
import com.djrapitops.plugin.utilities.log.DebugInfo;
import com.djrapitops.plugin.utilities.status.TaskStatus;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
* A Default Command for displaying plugin's task, process and benchmark status.
Expand Down Expand Up @@ -55,18 +56,15 @@ public boolean onCommand(ISender sender, String commandLabel, String[] args) {
sender.sendMessage(" " + notification.replace(plugin.getPrefix() + " ", ""));
}
}


TaskStatus taskStatus = plugin.taskStatus();
ProcessStatus processStatus = plugin.processStatus();

sender.sendMessage(sColor + " " + DefaultMessages.BALL.toString() + oColor + " Tasks running: " + sColor + taskStatus.getTaskCount());
sender.sendMessage(sColor + " " + DefaultMessages.BALL.toString() + oColor + " Processes: ");
Arrays.stream(processStatus.getProcesses())
.map(process -> tColor + " " + process)
.forEach(sender::sendMessage);
Map<String, DebugInfo> debugs = plugin.getPluginLogger().getAllDebugs();
debugs.entrySet().forEach(entry -> sender.sendMessage(tColor + " " + entry.getKey() + ": " + entry.getValue().getLastLine()));
sender.sendMessage(sColor + " " + DefaultMessages.BALL.toString() + oColor + " Tasks: ");
Arrays.stream(taskStatus.getTasks())
.map(process -> tColor + " " + process)
.map(task -> tColor + " " + task)
.forEach(sender::sendMessage);
sender.sendMessage(tColor + DefaultMessages.ARROWS_RIGHT.parse());
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ public void addNotification(Priority priority, String message) {
}

public void checkNotifications(IPlayer player) {
if (!player.isOp() || player.hasPermission("apf.notify")) {
return;
}

for (String msg : getNotifications()) {
player.sendMessage(msg);
if (player.isOp() || player.hasPermission("apf.notify")) {
for (String msg : getNotifications()) {
player.sendMessage(msg);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.djrapitops.plugin.utilities.log;

import com.djrapitops.plugin.BukkitPlugin;
import com.djrapitops.plugin.utilities.status.ProcessStatus;
import org.bukkit.command.ConsoleCommandSender;

import java.io.File;
import java.io.IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.djrapitops.plugin.utilities.log;

import com.djrapitops.plugin.BungeePlugin;
import com.djrapitops.plugin.utilities.status.ProcessStatus;

import java.io.File;
import java.io.IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,11 @@ private String getFooter(Long time) {
}
return footer.toString();
}

public String getLastLine() {
if (msg.isEmpty()) {
return "No information.";
}
return msg.get(msg.size() - 1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,8 @@ public void setPrefix(String prefix) {
public ErrorLogManager getErrorLogManager() {
return errorLogManager;
}

public Map<String, DebugInfo> getAllDebugs() {
return debugInfoMap;
}
}

This file was deleted.

0 comments on commit a9341bf

Please sign in to comment.