Skip to content

Commit

Permalink
Increment version number
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Oct 8, 2018
1 parent 32bc048 commit a342e45
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
allprojects {
group = 'me.lucko'
version = '1.0-SNAPSHOT'
version = '1.1-SNAPSHOT'
}

subprojects {
apply plugin: 'java'
apply plugin: 'maven'

ext {
pluginVersion = '1.0.4'
pluginVersion = '1.1.0'
}

sourceCompatibility = 1.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ private void broadcast(String msg) {
}
}

@Override
protected String getVersion() {
return SparkBukkitPlugin.this.getDescription().getVersion();
}

@Override
protected String getLabel() {
return "spark";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ private void broadcast(BaseComponent... msg) {
}
}

@Override
protected String getVersion() {
return SparkBungeeCordPlugin.this.getDescription().getVersion();
}

@Override
protected String getLabel() {
return "sparkbungee";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import me.lucko.spark.profiler.TickCounter;

import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
Expand All @@ -43,7 +42,6 @@
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
* Abstract command handling class used by all platforms.
Expand All @@ -67,6 +65,7 @@ public abstract class CommandHandler<T> {

// abstract methods implemented by each platform

protected abstract String getVersion();
protected abstract String getLabel();
protected abstract void sendMessage(T sender, String message);
protected abstract void sendMessage(String message);
Expand Down Expand Up @@ -123,7 +122,7 @@ public void handleCommand(T sender, String[] args) {
}

private void sendInfo(T sender) {
sendPrefixedMessage(sender, "&fspark profiler &7v1.0");
sendPrefixedMessage(sender, "&fspark profiler &7v" + getVersion());
sendMessage(sender, "&b&l> &7/" + getLabel() + " start");
sendMessage(sender, " &8[&7--timeout&8 <timeout seconds>]");
sendMessage(sender, " &8[&7--thread&8 <thread name>]");
Expand Down Expand Up @@ -207,7 +206,7 @@ private void handleStart(T sender, List<String> args) {

sendPrefixedMessage("&bProfiler now active!");
if (timeoutSeconds == -1) {
sendPrefixedMessage("&7Use '/profiler stop' to stop profiling and upload the results.");
sendPrefixedMessage("&7Use '/" + getLabel() + " stop' to stop profiling and upload the results.");
} else {
sendPrefixedMessage("&7The results will be automatically returned after the profiler has been running for " + timeoutSeconds + " seconds.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.event.ClickEvent;
import net.minecraftforge.fml.common.Mod;

import java.util.Collections;
import java.util.List;
Expand All @@ -52,6 +53,11 @@ public abstract class ForgeCommandHandler extends CommandHandler<ICommandSender>
new ThreadFactoryBuilder().setNameFormat("spark-forge-async-worker").build()
);

@Override
public String getVersion() {
return SparkForgeMod.class.getAnnotation(Mod.class).version();
}

@SuppressWarnings("deprecation")
protected ITextComponent colorize(String message) {
TextComponent component = ComponentSerializers.LEGACY.deserialize(message, '&');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ private void broadcast(Text msg) {
}
}

@Override
protected String getVersion() {
return SparkSpongePlugin.class.getAnnotation(Plugin.class).version();
}

@Override
protected String getLabel() {
return "spark";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ private void broadcast(Component msg) {
}
}

@Override
protected String getVersion() {
return SparkVelocityPlugin.class.getAnnotation(Plugin.class).version();
}

@Override
protected String getLabel() {
return "sparkvelocity";
Expand Down

0 comments on commit a342e45

Please sign in to comment.