jakub 2 years ago
parent 141d5ef24a
commit 9885d459f2
  1. 13
      src/main/java/xyz/soukup/informator/events/PlayerChangeWorlds.java
  2. 21
      src/main/java/xyz/soukup/informator/handlers/TabHandler.java
  3. 20
      src/main/resources/animations.yml
  4. 22
      src/main/resources/config.yml
  5. 9
      src/main/resources/modules/tab.yml
  6. 24
      target/classes/animations.yml
  7. 3
      target/classes/config.yml
  8. 9
      target/classes/modules/tab.yml
  9. BIN
      target/classes/xyz/soukup/informator/handlers/TabHandler.class

@ -0,0 +1,13 @@
package xyz.soukup.informator.events;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import xyz.soukup.informator.handlers.TabHandler;
public class PlayerChangeWorlds implements Listener {
@EventHandler
public void onPlayerChangeWorld(PlayerChangedWorldEvent event){
TabHandler.chooseTab(event.getPlayer());
}
}

@ -33,6 +33,7 @@ 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);
@ -45,21 +46,23 @@ public class TabHandler {
public static void chooseTab(Player player){
String choosenTab = "tabs.required.default";
int choosenPriority = tabConfig.getInt("tabs.required.default.priority");
if (tabData.containsKey("tabs.player.players." + player.getDisplayName())){
player.sendMessage("ss"+choosenPriority);
if (tabData.containsKey("tabs.world.worlds." + player.getWorld().getName()) && tabConfig.getBoolean("tabs.world.enabled")){
player.sendMessage(player.getWorld().getName());
if ((int)tabData.get("tabs.world.worlds." + player.getWorld().getName()).get(0) > choosenPriority){
choosenTab = "tabs.world.worlds." + player.getWorld().getName();
choosenPriority = (int)tabData.get("tabs.world.worlds." + player.getWorld().getName()).get(0);
}
}
if (tabData.containsKey("tabs.player.players." + player.getDisplayName()) && tabConfig.getBoolean("tabs.player.enabled")){
if ((int)tabData.get("tabs.player.players." + player.getDisplayName()).get(0) > choosenPriority){
player.sendMessage("SSSSSSSS");
choosenTab = "tabs.player.players." + player.getDisplayName();
choosenPriority = (int)tabData.get("tabs.player.players." + player.getDisplayName()).get(0);
}
}
if (tabData.containsKey("tabs.world.worlds." + player.getWorld().getName())){
if ((int)tabData.get("tabs.world.worlds." + player.getWorld().getName()).get(0) > choosenPriority){
choosenTab = "tab.world.worlds." + player.getWorld().getName();
}
}
playerTab.put(player, choosenTab);
}

@ -11,15 +11,15 @@ exampleTitle:
#You can use animation creation tool (ACT) built in web configurator!
# https://informator.soukup.xyz/configurator/act
frames:
- "&b&3I&b&fNFORMATOR"
- "&b&fI&b&3N&b&fFORMATOR"
- "&b&fIN&b&3F&b&fORMATOR"
- "&b&fINF&b&3O&b&fRMATOR"
- "&b&fINFO&b&3R&b&fMATOR"
- "&b&fINFOR&b&3M&b&fATOR"
- "&b&fINFORM&b&3A&b&fTOR"
- "&b&fINFORMA&b&3T&b&fOR"
- "&b&fINFORMAT&b&3O&b&fR"
- "&b&fINFORMATO&b&3R"
- "&6&lI&f&lNFORMATOR"
- "&f&lI&6&lN&f&lFORMATOR"
- "&f&lIN&6&lF&f&lORMATOR"
- "&f&lINF&6&lO&f&lRMATOR"
- "&f&lINFO&6&lR&f&lMATOR"
- "&f&lINFOR&6&lM&f&lATOR"
- "&f&lINFORM&6&lA&f&lTOR"
- "&f&lINFORMA&6&lT&f&lOR"
- "&f&lINFORMAT&6&lO&f&lR"
- "&f&lINFORMATO&6&lR"

@ -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/
####################################################################
# #
# 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/

@ -24,11 +24,10 @@ tabs:
- "Change this in modules/tab.yml"
- ""
world:
enabled: false
priority: 1
enabled: true
worlds:
exampleWorld:
enabled: true
world_nether:
priority: 6
header:
- "World specified tab"
- "%%animation:exampleTitle%%"
@ -61,7 +60,7 @@ tabs:
- "Change this in modules/tab.yml"
- ""
player:
enabled: false
enabled: true
players:
Kuba1428:
priority: 3

@ -6,20 +6,20 @@
exampleTitle:
#Speed is in minecraft ticks
#20 ticks = 1 second so speed 20 = 1 frame per second
speed: 2
speed: 4
#Also hate making animations manually?
#You can use animation creation tool (ACT) built in web configurator!
# https://informator.soukup.xyz/configurator/act
frames:
- "&b&3I&b&fNFORMATOR"
- "&b&fI&b&3N&b&fFORMATOR"
- "&b&fIN&b&3F&b&fORMATOR"
- "&b&fINF&b&3O&b&fRMATOR"
- "&b&fINFO&b&3R&b&fMATOR"
- "&b&fINFOR&b&3M&b&fATOR"
- "&b&fINFORM&b&3A&b&fTOR"
- "&b&fINFORMA&b&3T&b&fOR"
- "&b&fINFORMAT&b&3O&b&fR"
- "&b&fINFORMATO&b&3R"
- "&cKONEC"
- "&6&lI&f&lNFORMATOR"
- "&f&lI&6&lN&f&lFORMATOR"
- "&f&lIN&6&lF&f&lORMATOR"
- "&f&lINF&6&lO&f&lRMATOR"
- "&f&lINFO&6&lR&f&lMATOR"
- "&f&lINFOR&6&lM&f&lATOR"
- "&f&lINFORM&6&lA&f&lTOR"
- "&f&lINFORMA&6&lT&f&lOR"
- "&f&lINFORMAT&6&lO&f&lR"
- "&f&lINFORMATO&6&lR"

@ -9,10 +9,11 @@ modules-enabled:
bossbar: true
#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 is a powerful tool. It can destroy all configuration if in wrong hands
api-address: https://informator.soukup.xyz/configurator/api/

@ -24,11 +24,10 @@ tabs:
- "Change this in modules/tab.yml"
- ""
world:
enabled: false
priority: 1
enabled: true
worlds:
exampleWorld:
enabled: true
world_nether:
priority: 6
header:
- "World specified tab"
- "%%animation:exampleTitle%%"
@ -61,7 +60,7 @@ tabs:
- "Change this in modules/tab.yml"
- ""
player:
enabled: false
enabled: true
players:
Kuba1428:
priority: 3

Loading…
Cancel
Save