From 847e940388d46c302f747231a8aef7f3d06362f2 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 15 Aug 2017 03:03:39 +0200 Subject: [PATCH] Priority and precision fixes --- .travis.yml | 26 +++++++++++++++++++ ButtonCore/.travis.yml | 3 --- .../buttondevteam/core/PlayerListener.java | 2 +- .../core/ScheduledRestartCommand.java | 2 +- deploy.sh | 10 +++++++ ButtonCore/jitpack.yml => jitpack.yml | 0 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .travis.yml delete mode 100644 ButtonCore/.travis.yml create mode 100644 deploy.sh rename ButtonCore/jitpack.yml => jitpack.yml (100%) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dfd0224 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +cache: + directories: + - $HOME/.m2/repository/org/ +before_install: | # Wget BuildTools and run if cached folder not found + if [ ! -d "$HOME/.m2/repository/org/spigotmc/spigot/1.12.1-R0.1-SNAPSHOT" ]; then + wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar + # grep so that download counts don't appear in log files + java -jar BuildTools.jar --rev 1.12.1 | grep -vE "[^/ ]*/[^/ ]*\s*KB\s*$" | grep -v "^\s*$" + fi +language: java +jdk: + - oraclejdk8 +sudo: true +deploy: + # deploy develop to the staging environment + - provider: script + script: chmod +x deploy.sh && sh deploy.sh staging + on: + branch: dev + skip_cleanup: true + # deploy master to production + - provider: script + script: chmod +x deploy.sh && sh deploy.sh production + on: + branch: master + skip_cleanup: true diff --git a/ButtonCore/.travis.yml b/ButtonCore/.travis.yml deleted file mode 100644 index 9bcf999..0000000 --- a/ButtonCore/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: java -jdk: - - oraclejdk8 diff --git a/ButtonCore/src/main/java/buttondevteam/core/PlayerListener.java b/ButtonCore/src/main/java/buttondevteam/core/PlayerListener.java index f2b4518..b8bd6e7 100644 --- a/ButtonCore/src/main/java/buttondevteam/core/PlayerListener.java +++ b/ButtonCore/src/main/java/buttondevteam/core/PlayerListener.java @@ -12,7 +12,7 @@ import buttondevteam.lib.player.TBMCPlayerBase; public class PlayerListener implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void OnPlayerJoin(PlayerJoinEvent event) { TBMCPlayerBase.joinPlayer(event.getPlayer()); } diff --git a/ButtonCore/src/main/java/buttondevteam/core/ScheduledRestartCommand.java b/ButtonCore/src/main/java/buttondevteam/core/ScheduledRestartCommand.java index b80c2de..7f9c4fe 100644 --- a/ButtonCore/src/main/java/buttondevteam/core/ScheduledRestartCommand.java +++ b/ButtonCore/src/main/java/buttondevteam/core/ScheduledRestartCommand.java @@ -47,7 +47,7 @@ public class ScheduledRestartCommand extends TBMCCommandBase { if (restartcounter % 200 == 0) Bukkit.broadcastMessage("§c-- The server is restarting in " + restartcounter / 20 + " seconds!"); restartbar.setProgress(restartcounter / (double) restarttime); - restartbar.setTitle(String.format("Server restart in %f.2", restartcounter / 20f)); + restartbar.setTitle(String.format("Server restart in %.2f", restartcounter / 20f)); restartcounter--; }, 1, 1); return true; diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..606423b --- /dev/null +++ b/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/sh +FILENAME=$(find target/ -maxdepth 1 ! -name '*original*' -name '*.jar') +echo Found file: $FILENAME + +if [ $1 = 'production' ]; then +echo Production mode +echo $UPLOAD_KEY > upload_key +chmod 400 upload_key +yes | scp -B -i upload_key -o StrictHostKeyChecking=no $FILENAME travis@server.figytuna.com:/minecraft/main/plugins +fi diff --git a/ButtonCore/jitpack.yml b/jitpack.yml similarity index 100% rename from ButtonCore/jitpack.yml rename to jitpack.yml