mirror of
https://github.com/itHotL/PlayerStats.git
synced 2025-02-01 23:21:20 +01:00
Release v1.2.1! Set hover-text to false by default for 1.19-R01-SNAPSHOT and true for other versions
This commit is contained in:
parent
bf3feda8cc
commit
1484ebb912
@ -54,7 +54,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.18.2-R0.1-SNAPSHOT</version>
|
<version>1.19-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
2
pom.xml
2
pom.xml
@ -30,7 +30,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.18.2-R0.1-SNAPSHOT</version>
|
<version>1.19-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -30,9 +30,10 @@ public class Main extends JavaPlugin {
|
|||||||
|
|
||||||
//initialize the Adventure library
|
//initialize the Adventure library
|
||||||
adventure = BukkitAudiences.create(this);
|
adventure = BukkitAudiences.create(this);
|
||||||
|
boolean canHover = !Bukkit.getBukkitVersion().equalsIgnoreCase("1.19-R0.1-SNAPSHOT");
|
||||||
|
|
||||||
//get instances of the classes that should be initialized
|
//get instances of the classes that should be initialized
|
||||||
ConfigHandler config = new ConfigHandler(this);
|
ConfigHandler config = new ConfigHandler(this, canHover);
|
||||||
MessageFactory messageFactory = new MessageFactory(config);
|
MessageFactory messageFactory = new MessageFactory(config);
|
||||||
ThreadManager threadManager = new ThreadManager(this, adventure(), config, messageFactory);
|
ThreadManager threadManager = new ThreadManager(this, adventure(), config, messageFactory);
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ public class StatCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (args[0].equalsIgnoreCase("examples")) { //in case of "statistic examples", show examples
|
else if (args[0].equalsIgnoreCase("examples") ||
|
||||||
|
args[0].equalsIgnoreCase("example")) { //in case of "statistic examples", show examples
|
||||||
adventure.sender(sender).sendMessage(messageFactory.usageExamples(sender instanceof ConsoleCommandSender));
|
adventure.sender(sender).sendMessage(messageFactory.usageExamples(sender instanceof ConsoleCommandSender));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,11 @@ public class ConfigHandler {
|
|||||||
private File configFile;
|
private File configFile;
|
||||||
private FileConfiguration config;
|
private FileConfiguration config;
|
||||||
private final Main plugin;
|
private final Main plugin;
|
||||||
|
private final boolean canHover;
|
||||||
|
|
||||||
public ConfigHandler(Main p) {
|
public ConfigHandler(Main p, boolean useHover) {
|
||||||
plugin = p;
|
plugin = p;
|
||||||
|
this.canHover = useHover;
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
|
|
||||||
config = YamlConfiguration.loadConfiguration(configFile);
|
config = YamlConfiguration.loadConfiguration(configFile);
|
||||||
@ -66,9 +68,9 @@ public class ConfigHandler {
|
|||||||
return config.getInt("number-of-days-since-last-joined", 0);
|
return config.getInt("number-of-days-since-last-joined", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** On Spigot 1.19, do not use hover-text by default - otherwise do*/
|
||||||
public boolean useHoverText() {
|
public boolean useHoverText() {
|
||||||
return config.getBoolean("enable-hover-text", true);
|
return config.getBoolean("enable-hover-text", canHover);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the config setting for use-dots, or the default value "true" if no value can be retrieved. */
|
/** Returns the config setting for use-dots, or the default value "true" if no value can be retrieved. */
|
||||||
|
@ -385,7 +385,7 @@ public class MessageFactory {
|
|||||||
|
|
||||||
//returns the usage-explanation without any hovering text
|
//returns the usage-explanation without any hovering text
|
||||||
private TextComponent helpMsgPlain(boolean isConsoleSender) {
|
private TextComponent helpMsgPlain(boolean isConsoleSender) {
|
||||||
TextComponent underscores = text("____________").color(TextColor.fromHexString("#6E3485")); //12 underscores
|
TextComponent underscores = text("__________").color(TextColor.fromHexString("#6E3485")); //10 underscores
|
||||||
TextComponent spaces = text(" "); //4 spaces
|
TextComponent spaces = text(" "); //4 spaces
|
||||||
TextComponent arrow = text("→ ").color(NamedTextColor.GOLD); //alt + 26;
|
TextComponent arrow = text("→ ").color(NamedTextColor.GOLD); //alt + 26;
|
||||||
TextComponent bullet = text("• ").color(NamedTextColor.GOLD); //alt + 7
|
TextComponent bullet = text("• ").color(NamedTextColor.GOLD); //alt + 7
|
||||||
@ -399,7 +399,7 @@ public class MessageFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Component.newline()
|
return Component.newline()
|
||||||
.append(underscores).append(spaces).append(pluginPrefix()).append(spaces).append(underscores)
|
.append(underscores).append(spaces).append(pluginPrefix()).append(text(" ")).append(underscores)
|
||||||
.append(newline())
|
.append(newline())
|
||||||
.append(text("Type \"/statistic examples\" to see examples!").color(NamedTextColor.GRAY).decorate(TextDecoration.ITALIC))
|
.append(text("Type \"/statistic examples\" to see examples!").color(NamedTextColor.GRAY).decorate(TextDecoration.ITALIC))
|
||||||
.append(newline())
|
.append(newline())
|
||||||
|
@ -22,8 +22,9 @@ number-of-days-since-last-joined: 0
|
|||||||
# ------------------------------- #
|
# ------------------------------- #
|
||||||
# Format & Display #
|
# Format & Display #
|
||||||
# ------------------------------- #
|
# ------------------------------- #
|
||||||
# Use hover-text for additional info in the usage explanation
|
# Use hover-text for additional info in the usage explanation (set "false" to disable)
|
||||||
enable-hover-text: false
|
# If you leave this un-set, PlayerStats will use hover-text if the Minecraft-version supports it
|
||||||
|
enable-hover-text:
|
||||||
|
|
||||||
# If true, the stat-numbers in the top list will be aligned with dots
|
# If true, the stat-numbers in the top list will be aligned with dots
|
||||||
use-dots: true
|
use-dots: true
|
||||||
|
Loading…
Reference in New Issue
Block a user