jakub 2 years ago
parent 9885d459f2
commit 2555a6fdf4
  1. 1
      .idea/artifacts/Informator_jar.xml
  2. 10
      .idea/jarRepositories.xml
  3. 23
      pom.xml
  4. 3
      src/main/java/xyz/soukup/informator/Informator.java
  5. 16
      src/main/java/xyz/soukup/informator/handlers/PlaceholderHandler.java
  6. 1
      src/main/java/xyz/soukup/informator/handlers/TabHandler.java
  7. 36
      src/main/resources/modules/scoreboard.yml
  8. 30
      src/main/resources/modules/tab.yml
  9. 1
      src/main/resources/plugin.yml
  10. 22
      target/classes/config.yml
  11. 30
      target/classes/modules/tab.yml
  12. 1
      target/classes/plugin.yml
  13. BIN
      target/classes/xyz/soukup/informator/Informator.class
  14. BIN
      target/classes/xyz/soukup/informator/handlers/PlaceholderHandler.class
  15. BIN
      target/classes/xyz/soukup/informator/handlers/TabHandler.class

@ -3,6 +3,7 @@
<output-path>$USER_HOME$/Plocha/beta server/plugins</output-path> <output-path>$USER_HOME$/Plocha/beta server/plugins</output-path>
<root id="archive" name="Informator.jar"> <root id="archive" name="Informator.jar">
<element id="module-output" name="Informator" /> <element id="module-output" name="Informator" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/iridium/IridiumColorAPI/1.0.6/IridiumColorAPI-1.0.6.jar" path-in-jar="/" />
</root> </root>
</artifact> </artifact>
</component> </component>

@ -11,11 +11,21 @@
<option name="name" value="sonatype" /> <option name="name" value="sonatype" />
<option name="url" value="https://oss.sonatype.org/content/groups/public/" /> <option name="url" value="https://oss.sonatype.org/content/groups/public/" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="iridiumdevelopment" />
<option name="name" value="iridiumdevelopment" />
<option name="url" value="https://nexus.iridiumdevelopment.net/repository/maven-releases/" />
</remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="spigotmc-repo" /> <option name="id" value="spigotmc-repo" />
<option name="name" value="spigotmc-repo" /> <option name="name" value="spigotmc-repo" />
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" /> <option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="placeholderapi" />
<option name="name" value="placeholderapi" />
<option name="url" value="https://repo.extendedclip.com/content/repositories/placeholderapi/" />
</remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="central" /> <option name="id" value="central" />
<option name="name" value="Maven Central repository" /> <option name="name" value="Maven Central repository" />

@ -51,10 +51,15 @@
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<filtering>true</filtering> <filtering>true</filtering>
</resource> </resource>
</resources> </resources>
</build> </build>
<repositories> <repositories>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository> <repository>
<id>spigotmc-repo</id> <id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
@ -63,14 +68,32 @@
<id>sonatype</id> <id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url> <url>https://oss.sonatype.org/content/groups/public/</url>
</repository> </repository>
<repository>
<id>iridiumdevelopment</id>
<url>https://nexus.iridiumdevelopment.net/repository/maven-releases/</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency>
<groupId>com.iridium</groupId>
<artifactId>IridiumColorAPI</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version> <version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -2,6 +2,7 @@ package xyz.soukup.informator;
import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import xyz.soukup.informator.events.PlayerChangeWorlds;
import xyz.soukup.informator.handlers.AnimationHandler; import xyz.soukup.informator.handlers.AnimationHandler;
import xyz.soukup.informator.handlers.ConfigHandler; import xyz.soukup.informator.handlers.ConfigHandler;
import xyz.soukup.informator.handlers.TabHandler; import xyz.soukup.informator.handlers.TabHandler;
@ -51,6 +52,8 @@ public final class Informator extends JavaPlugin {
TabHandler.loadTabs(); TabHandler.loadTabs();
} }
clockHandler clockHandler = new clockHandler(); clockHandler clockHandler = new clockHandler();
getServer().getPluginManager().registerEvents(new PlayerChangeWorlds(), this);
logger.info(""); logger.info("");
logger.info("\u001B[33m==========================================================="); logger.info("\u001B[33m===========================================================");
logger.info(""); logger.info("");

@ -1,5 +1,8 @@
package xyz.soukup.informator.handlers; 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.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -9,12 +12,13 @@ import java.util.regex.Pattern;
public class PlaceholderHandler { public class PlaceholderHandler {
public static String substituteAll(String text, Player player){ public static String substituteAll(String text, Player player){
String result = substitudeAnimation(text); String result = substitudeAnimation(text);
result = substitudePAPI(result, player);
result = substitudeColor(result); result = substitudeColor(result);
return result; return result;
} }
public static String substitudeAnimation(String text){ public static String substitudeAnimation(String text){
// Define the regular expression pattern for placeholders // Define the regular expression pattern for placeholders
Pattern pattern = Pattern.compile("%%animation:(.*?)%%"); Pattern pattern = Pattern.compile("<ANIMATION:(.*?)>");
// Create a matcher with the input string // Create a matcher with the input string
Matcher matcher = pattern.matcher(text); Matcher matcher = pattern.matcher(text);
@ -40,7 +44,15 @@ public class PlaceholderHandler {
// Convert the result to a String // Convert the result to a String
return result.toString(); 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){ public static String substitudeColor(String text){
return ChatColor.translateAlternateColorCodes('&', text); return IridiumColorAPI.process(text);
} }
} }

@ -33,7 +33,6 @@ public class TabHandler {
String footerString = String.join("\n&r", footer); String footerString = String.join("\n&r", footer);
tabDataList.add(headerString); tabDataList.add(headerString);
tabDataList.add(footerString); tabDataList.add(footerString);
Bukkit.getLogger().info((String) tabDataList.get(1));
tabData.put(targetKey + "." + key, tabDataList); tabData.put(targetKey + "." + key, tabDataList);

@ -0,0 +1,36 @@
scoreboards:
required:
default:
priority: 0
title: "<ANIMATION:exampleTitle>"
lines:
- ""
- "test "
- "lot of test"
- "ejo more testols"
- "<ANIMATION:exampleTitle>"
world:
enabled: true
worlds:
example_world:
priority: 3
title: "<ANIMATION:exampleTitle>"
lines:
- "world specified"
- "test "
- "lot of test"
- "ejo more testols"
- "<ANIMATION:exampleTitle>"
player:
enabled: true
players:
example_player:
priority: 6
title: "<ANIMATION:exampleTitle>"
lines:
- "player specified"
- ""
- "test "
- "lot of test"
- "ejo more testols"
- "<ANIMATION:exampleTitle>"

@ -5,7 +5,11 @@
#/___/_/ /_/_/ \____/_/ /_/ /_/ /_/\__,_/\__/\____/_/ #/___/_/ /_/_/ \____/_/ /_/ /_/ /_/\__,_/\__/\____/_/
# #
enabled: true settings:
enabled: true
disabled-worlds:
- "exampleWorld"
- "AnotherExampleWorld"
tabs: tabs:
required: required:
@ -13,13 +17,13 @@ tabs:
priority: 0 priority: 0
header: header:
- "" - ""
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""
@ -30,13 +34,13 @@ tabs:
priority: 6 priority: 6
header: header:
- "World specified tab" - "World specified tab"
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""
@ -49,13 +53,13 @@ tabs:
enabled: true enabled: true
header: header:
- "World specified tab" - "World specified tab"
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""
@ -67,13 +71,13 @@ tabs:
enabled: true enabled: true
header: header:
- "Player specified tab" - "Player specified tab"
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""

@ -5,3 +5,4 @@ api-version: '1.16'
authors: [Jakub Soukup] authors: [Jakub Soukup]
description: All in one plugin for TAB, Scoreboard, Title, Bossbar, Chat annoucements and MOTD description: All in one plugin for TAB, Scoreboard, Title, Bossbar, Chat annoucements and MOTD
website: https://soukup.xyz/ website: https://soukup.xyz/
softdepend: [PlaceholderAPI]

@ -10,10 +10,18 @@ modules-enabled:
#Configuration for plugin's web interface #Configuration for plugin's web interface
web-interface: ####################################################################
#online configurator enabled. We recommend to disable it after setting up the plugin # #
enabled: true # DANGER ZONE! #
#API address of the configurator. # #
#DO NOT CHANGE THIS IF SOMEONE TOLD YOU TO. # Settings bellow can strongly influence plugin's functioning #
#API is a powerful tool. It can destroy all configuration if in wrong hands # They are here mainly for development purposes #
api-address: https://informator.soukup.xyz/configurator/api/ # 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/

@ -5,7 +5,11 @@
#/___/_/ /_/_/ \____/_/ /_/ /_/ /_/\__,_/\__/\____/_/ #/___/_/ /_/_/ \____/_/ /_/ /_/ /_/\__,_/\__/\____/_/
# #
enabled: true settings:
enabled: true
disabled-worlds:
- "exampleWorld"
- "AnotherExampleWorld"
tabs: tabs:
required: required:
@ -13,13 +17,13 @@ tabs:
priority: 0 priority: 0
header: header:
- "" - ""
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""
@ -30,13 +34,13 @@ tabs:
priority: 6 priority: 6
header: header:
- "World specified tab" - "World specified tab"
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""
@ -49,13 +53,13 @@ tabs:
enabled: true enabled: true
header: header:
- "World specified tab" - "World specified tab"
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""
@ -67,13 +71,13 @@ tabs:
enabled: true enabled: true
header: header:
- "Player specified tab" - "Player specified tab"
- "%%animation:exampleTitle%%" - "<ANIMATION:exampleTitle>"
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
footer: footer:
- "" - ""
- "%%animation:exampleLine%%" - "<ANIMATION:exampleLine>"
- "" - ""
- "Change this in modules/tab.yml" - "Change this in modules/tab.yml"
- "" - ""

@ -5,3 +5,4 @@ api-version: '1.16'
authors: [Jakub Soukup] authors: [Jakub Soukup]
description: All in one plugin for TAB, Scoreboard, Title, Bossbar, Chat annoucements and MOTD description: All in one plugin for TAB, Scoreboard, Title, Bossbar, Chat annoucements and MOTD
website: https://soukup.xyz/ website: https://soukup.xyz/
softdepend: [PlaceholderAPI]

Loading…
Cancel
Save