commit eea09e6aae1ac37edb7afd8bd7743cedc27f419e
parent f46286ce360441b6d34b681db0e34bed8766eb71
Author: typable <contact@typable.dev>
Date: Sun, 8 Sep 2024 13:33:04 +0200
feat: Added debug mode to build script
Diffstat:
3 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/build.sh b/build.sh
@@ -6,6 +6,21 @@ else
cpdl=";"
fi
-javac -cp "./libs/bungeecord-chat-1.20-R0.2.jar${cpdl}./libs/spigot-api-1.21.1-R0.1-20240831.215322-16.jar" src/poppy/*.java src/poppy/modules/*.java -d build
-jar cvfm poppy.jar res/MANIFEST.MF -C res plugin.yml -C build poppy
-rm -rf ./build
+if [[ "$1" == "--debug" ]]; then
+ javac -cp "./libs/bungeecord-chat-1.20-R0.2.jar${cpdl}./libs/spigot-api-1.21.1-R0.1-20240831.215322-16.jar" src/poppy/*.java src/poppy/modules/*.java -d build 2>&1
+ if [ $? -ne 0 ]; then
+ rm -rf ./build
+ exit 0
+ fi
+ jar cvfm poppy.jar res/MANIFEST.MF -C res plugin.yml -C build poppy
+ rm -rf ./build
+else
+ javac -cp "./libs/bungeecord-chat-1.20-R0.2.jar${cpdl}./libs/spigot-api-1.21.1-R0.1-20240831.215322-16.jar" src/poppy/*.java src/poppy/modules/*.java -d build
+ if [ $? -ne 0 ]; then
+ rm -rf ./build
+ exit 1
+ fi
+ jar cvfm poppy.jar res/MANIFEST.MF -C res plugin.yml -C build poppy
+ rm -rf ./build
+fi
+
diff --git a/check.sh b/check.sh
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "darwin" ]]; then
- cpdl=":"
-else
- cpdl=";"
-fi
-
-javac -cp "./libs/bungeecord-chat-1.20-R0.2.jar${cpdl}./libs/spigot-api-1.21.1-R0.1-20240831.215322-16.jar" src/poppy/*.java src/poppy/modules/*.java -d build 2>&1
-if [ $? -eq 0 ]; then
- rm -rf ./build
-fi
-exit 0
diff --git a/src/poppy/modules/FastTravelModule.java b/src/poppy/modules/FastTravelModule.java
@@ -16,6 +16,8 @@ import org.bukkit.scheduler.BukkitRunnable;
public class FastTravelModule implements Listener {
+ public static final int COUNTDOWN_TIME = 5;
+
private Plugin plugin;
public FastTravelModule(final Plugin plugin) {
@@ -42,7 +44,7 @@ public class FastTravelModule implements Listener {
final Player player = event.getPlayer();
final Location location = meta.getLodestone();
new BukkitRunnable() {
- int timer = 5;
+ int timer = COUNTDOWN_TIME;
@Override
public void run() {
final Location playerLocation = player.getLocation();