aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'spark-common/src')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java2
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java3
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java2
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/util/classfinder/InstrumentationClassFinder.java5
-rw-r--r--spark-common/src/main/proto/spark/spark.proto1
5 files changed, 9 insertions, 4 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java b/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java
index 0466e75..5e4e053 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java
@@ -369,7 +369,7 @@ public class SparkPlatform {
try {
executeCommand0(sender, args);
future.complete(null);
- } catch (Exception e) {
+ } catch (Throwable e) {
this.plugin.log(Level.SEVERE, "Exception occurred whilst executing a spark command", e);
future.completeExceptionally(e);
} finally {
diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java
index 1d71d53..96549a1 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformInfo.java
@@ -48,7 +48,8 @@ public interface PlatformInfo {
enum Type {
SERVER(PlatformMetadata.Type.SERVER),
CLIENT(PlatformMetadata.Type.CLIENT),
- PROXY(PlatformMetadata.Type.PROXY);
+ PROXY(PlatformMetadata.Type.PROXY),
+ APPLICATION(PlatformMetadata.Type.APPLICATION);
private final PlatformMetadata.Type type;
diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java
index 93bd59d..d9fbff2 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java
@@ -219,7 +219,7 @@ public class PlatformStatisticsProvider {
List<CommandSender> senders = this.platform.getPlugin().getCommandSenders().collect(Collectors.toList());
PlatformInfo.Type platformType = this.platform.getPlugin().getPlatformInfo().getType();
- if (platformType != PlatformInfo.Type.CLIENT) {
+ if (platformType == PlatformInfo.Type.SERVER || platformType == PlatformInfo.Type.PROXY) {
long playerCount = senders.size() - 1; // includes console
builder.setPlayerCount(playerCount);
}
diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/classfinder/InstrumentationClassFinder.java b/spark-common/src/main/java/me/lucko/spark/common/util/classfinder/InstrumentationClassFinder.java
index 5f06d64..1381d4d 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/util/classfinder/InstrumentationClassFinder.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/util/classfinder/InstrumentationClassFinder.java
@@ -57,7 +57,10 @@ public class InstrumentationClassFinder implements ClassFinder {
private final Map<String, Class<?>> classes = new HashMap<>();
public InstrumentationClassFinder(SparkPlugin plugin) {
- Instrumentation instrumentation = loadInstrumentation(plugin);
+ this(loadInstrumentation(plugin));
+ }
+
+ public InstrumentationClassFinder(Instrumentation instrumentation) {
if (instrumentation == null) {
return;
}
diff --git a/spark-common/src/main/proto/spark/spark.proto b/spark-common/src/main/proto/spark/spark.proto
index f8d7988..4b95a4a 100644
--- a/spark-common/src/main/proto/spark/spark.proto
+++ b/spark-common/src/main/proto/spark/spark.proto
@@ -21,6 +21,7 @@ message PlatformMetadata {
SERVER = 0;
CLIENT = 1;
PROXY = 2;
+ APPLICATION = 3;
}
}