diff --git a/.idea/artifacts/Informator_jar.xml b/.idea/artifacts/Informator_jar.xml
index 8faa225..3ffe88b 100644
--- a/.idea/artifacts/Informator_jar.xml
+++ b/.idea/artifacts/Informator_jar.xml
@@ -3,6 +3,7 @@
$USER_HOME$/Plocha/beta server/plugins
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 861936a..c21afe7 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -11,11 +11,21 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 0283fdb..77a3189 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,10 +51,15 @@
src/main/resources
true
+
+
+ placeholderapi
+ https://repo.extendedclip.com/content/repositories/placeholderapi/
+
spigotmc-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
@@ -63,14 +68,32 @@
sonatype
https://oss.sonatype.org/content/groups/public/
+
+ iridiumdevelopment
+ https://nexus.iridiumdevelopment.net/repository/maven-releases/
+
+
+
+ com.iridium
+ IridiumColorAPI
+ LATEST
+ compile
+
org.spigotmc
spigot-api
1.16.5-R0.1-SNAPSHOT
provided
+
+ me.clip
+ placeholderapi
+ 2.11.5
+ provided
+
+
diff --git a/src/main/java/xyz/soukup/informator/Informator.java b/src/main/java/xyz/soukup/informator/Informator.java
index 6987593..b6c6301 100644
--- a/src/main/java/xyz/soukup/informator/Informator.java
+++ b/src/main/java/xyz/soukup/informator/Informator.java
@@ -2,6 +2,7 @@ package xyz.soukup.informator;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
+import xyz.soukup.informator.events.PlayerChangeWorlds;
import xyz.soukup.informator.handlers.AnimationHandler;
import xyz.soukup.informator.handlers.ConfigHandler;
import xyz.soukup.informator.handlers.TabHandler;
@@ -51,6 +52,8 @@ public final class Informator extends JavaPlugin {
TabHandler.loadTabs();
}
clockHandler clockHandler = new clockHandler();
+ getServer().getPluginManager().registerEvents(new PlayerChangeWorlds(), this);
+
logger.info("");
logger.info("\u001B[33m===========================================================");
logger.info("");
diff --git a/src/main/java/xyz/soukup/informator/handlers/PlaceholderHandler.java b/src/main/java/xyz/soukup/informator/handlers/PlaceholderHandler.java
index 3e958fa..47ab37f 100644
--- a/src/main/java/xyz/soukup/informator/handlers/PlaceholderHandler.java
+++ b/src/main/java/xyz/soukup/informator/handlers/PlaceholderHandler.java
@@ -1,5 +1,8 @@
package xyz.soukup.informator.handlers;
+import com.iridium.iridiumcolorapi.IridiumColorAPI;
+import me.clip.placeholderapi.PlaceholderAPI;
+import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@@ -9,12 +12,13 @@ import java.util.regex.Pattern;
public class PlaceholderHandler {
public static String substituteAll(String text, Player player){
String result = substitudeAnimation(text);
+ result = substitudePAPI(result, player);
result = substitudeColor(result);
return result;
}
public static String substitudeAnimation(String text){
// Define the regular expression pattern for placeholders
- Pattern pattern = Pattern.compile("%%animation:(.*?)%%");
+ Pattern pattern = Pattern.compile("");
// Create a matcher with the input string
Matcher matcher = pattern.matcher(text);
@@ -40,7 +44,15 @@ public class PlaceholderHandler {
// Convert the result to a String
return result.toString();
}
+ public static String substitudePAPI(String text, Player player){
+ if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
+ return PlaceholderAPI.setPlaceholders(player, text);
+ }else{
+ return text;
+ }
+ }
public static String substitudeColor(String text){
- return ChatColor.translateAlternateColorCodes('&', text);
+ return IridiumColorAPI.process(text);
}
+
}
diff --git a/src/main/java/xyz/soukup/informator/handlers/TabHandler.java b/src/main/java/xyz/soukup/informator/handlers/TabHandler.java
index e64fa2c..8bdd7dd 100644
--- a/src/main/java/xyz/soukup/informator/handlers/TabHandler.java
+++ b/src/main/java/xyz/soukup/informator/handlers/TabHandler.java
@@ -33,7 +33,6 @@ public class TabHandler {
String footerString = String.join("\n&r", footer);
tabDataList.add(headerString);
tabDataList.add(footerString);
- Bukkit.getLogger().info((String) tabDataList.get(1));
tabData.put(targetKey + "." + key, tabDataList);
diff --git a/src/main/resources/modules/scoreboard.yml b/src/main/resources/modules/scoreboard.yml
new file mode 100644
index 0000000..e47f1b0
--- /dev/null
+++ b/src/main/resources/modules/scoreboard.yml
@@ -0,0 +1,36 @@
+scoreboards:
+ required:
+ default:
+ priority: 0
+ title: ""
+ lines:
+ - ""
+ - "test "
+ - "lot of test"
+ - "ejo more testols"
+ - ""
+ world:
+ enabled: true
+ worlds:
+ example_world:
+ priority: 3
+ title: ""
+ lines:
+ - "world specified"
+ - "test "
+ - "lot of test"
+ - "ejo more testols"
+ - ""
+ player:
+ enabled: true
+ players:
+ example_player:
+ priority: 6
+ title: ""
+ lines:
+ - "player specified"
+ - ""
+ - "test "
+ - "lot of test"
+ - "ejo more testols"
+ - ""
\ No newline at end of file
diff --git a/src/main/resources/modules/tab.yml b/src/main/resources/modules/tab.yml
index e1592af..8894d42 100644
--- a/src/main/resources/modules/tab.yml
+++ b/src/main/resources/modules/tab.yml
@@ -5,7 +5,11 @@
#/___/_/ /_/_/ \____/_/ /_/ /_/ /_/\__,_/\__/\____/_/
#
-enabled: true
+settings:
+ enabled: true
+ disabled-worlds:
+ - "exampleWorld"
+ - "AnotherExampleWorld"
tabs:
required:
@@ -13,13 +17,13 @@ tabs:
priority: 0
header:
- ""
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
@@ -30,13 +34,13 @@ tabs:
priority: 6
header:
- "World specified tab"
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
@@ -49,13 +53,13 @@ tabs:
enabled: true
header:
- "World specified tab"
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
@@ -67,13 +71,13 @@ tabs:
enabled: true
header:
- "Player specified tab"
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 537b105..e5b97a0 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -5,3 +5,4 @@ api-version: '1.16'
authors: [Jakub Soukup]
description: All in one plugin for TAB, Scoreboard, Title, Bossbar, Chat annoucements and MOTD
website: https://soukup.xyz/
+softdepend: [PlaceholderAPI]
diff --git a/target/classes/config.yml b/target/classes/config.yml
index 1a9a5fa..f99a43c 100644
--- a/target/classes/config.yml
+++ b/target/classes/config.yml
@@ -10,10 +10,18 @@ modules-enabled:
#Configuration for plugin's web interface
-web-interface:
- #online configurator enabled. We recommend to disable it after setting up the plugin
- enabled: true
- #API address of the configurator.
- #DO NOT CHANGE THIS IF SOMEONE TOLD YOU TO.
- #API is a powerful tool. It can destroy all configuration if in wrong hands
- api-address: https://informator.soukup.xyz/configurator/api/
\ No newline at end of file
+####################################################################
+# #
+# DANGER ZONE! #
+# #
+# Settings bellow can strongly influence plugin's functioning #
+# They are here mainly for development purposes #
+# You should NOT change them if someone told you to #
+# You should change them ONLY if you understand them #
+# Support will be provided only for default values #
+# Please be carefull. #
+# #
+####################################################################
+
+config-version: 0.0.1
+api-url: https://informator.soukup.xyz/configurator/api/
\ No newline at end of file
diff --git a/target/classes/modules/tab.yml b/target/classes/modules/tab.yml
index e1592af..8894d42 100644
--- a/target/classes/modules/tab.yml
+++ b/target/classes/modules/tab.yml
@@ -5,7 +5,11 @@
#/___/_/ /_/_/ \____/_/ /_/ /_/ /_/\__,_/\__/\____/_/
#
-enabled: true
+settings:
+ enabled: true
+ disabled-worlds:
+ - "exampleWorld"
+ - "AnotherExampleWorld"
tabs:
required:
@@ -13,13 +17,13 @@ tabs:
priority: 0
header:
- ""
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
@@ -30,13 +34,13 @@ tabs:
priority: 6
header:
- "World specified tab"
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
@@ -49,13 +53,13 @@ tabs:
enabled: true
header:
- "World specified tab"
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
@@ -67,13 +71,13 @@ tabs:
enabled: true
header:
- "Player specified tab"
- - "%%animation:exampleTitle%%"
+ - ""
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
footer:
- ""
- - "%%animation:exampleLine%%"
+ - ""
- ""
- "Change this in modules/tab.yml"
- ""
diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml
index 222c86f..a2fcee6 100644
--- a/target/classes/plugin.yml
+++ b/target/classes/plugin.yml
@@ -5,3 +5,4 @@ api-version: '1.16'
authors: [Jakub Soukup]
description: All in one plugin for TAB, Scoreboard, Title, Bossbar, Chat annoucements and MOTD
website: https://soukup.xyz/
+softdepend: [PlaceholderAPI]
diff --git a/target/classes/xyz/soukup/informator/Informator.class b/target/classes/xyz/soukup/informator/Informator.class
index 89d6e20..032126b 100644
Binary files a/target/classes/xyz/soukup/informator/Informator.class and b/target/classes/xyz/soukup/informator/Informator.class differ
diff --git a/target/classes/xyz/soukup/informator/handlers/PlaceholderHandler.class b/target/classes/xyz/soukup/informator/handlers/PlaceholderHandler.class
index b8e941a..7d2e938 100644
Binary files a/target/classes/xyz/soukup/informator/handlers/PlaceholderHandler.class and b/target/classes/xyz/soukup/informator/handlers/PlaceholderHandler.class differ
diff --git a/target/classes/xyz/soukup/informator/handlers/TabHandler.class b/target/classes/xyz/soukup/informator/handlers/TabHandler.class
index 633752c..aee6024 100644
Binary files a/target/classes/xyz/soukup/informator/handlers/TabHandler.class and b/target/classes/xyz/soukup/informator/handlers/TabHandler.class differ