Compare commits
3 Commits
36f4896dce
...
653ba71f73
Author | SHA1 | Date | |
---|---|---|---|
653ba71f73 | |||
eda31a1df2 | |||
8ba67b35d1 |
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>hu.ditservices</groupId>
|
||||
<artifactId>SimplifyTools</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<version>1.2.4-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>SimplifyTools</name>
|
||||
@ -126,7 +126,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.21.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- from downloaded craftbukkit-x.xx.x.jar\META-INF\versions\ -->
|
||||
|
@ -99,9 +99,9 @@ public final class STPlugin extends JavaPlugin implements CommandExecutor, Liste
|
||||
try {
|
||||
this.ServerStartTime = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||
if (Version.ServerVersion.isCurrentLower(Version.ServerVersion.v1_12_R1) ||
|
||||
Version.ServerVersion.isCurrentHigher(Version.ServerVersion.v1_21_4_R1))
|
||||
Version.ServerVersion.isCurrentHigher(Version.ServerVersion.v1_21_5_R1))
|
||||
{
|
||||
throw new Exception("The server version is not supported! Update to a version between 1.12 - 1.21.4 to run this plugin.");
|
||||
throw new Exception("The server version is not supported! Update to a version between 1.12 - 1.21.5 to run this plugin.");
|
||||
}
|
||||
|
||||
if (this.reload()) {
|
||||
|
@ -10,13 +10,21 @@ public class StatCommand {
|
||||
public static boolean Run(CommandSender sender){
|
||||
Player player = (Player) sender;
|
||||
|
||||
player.sendMessage(STPlugin.getInstance().getPrefix()+ ChatColor.GREEN+" === Your statistics === ");
|
||||
player.sendMessage(ChatColor.AQUA+"Connects: "+(player.getStatistic(Statistic.LEAVE_GAME)+1));
|
||||
player.sendMessage(ChatColor.AQUA+"Deaths: "+player.getStatistic(Statistic.DEATHS));
|
||||
player.sendMessage(ChatColor.AQUA+"Mob kills: "+player.getStatistic(Statistic.MOB_KILLS));
|
||||
player.sendMessage(ChatColor.AQUA+"Player kills: "+player.getStatistic(Statistic.PLAYER_KILLS));
|
||||
player.sendMessage(ChatColor.AQUA+"Sleep count: "+player.getStatistic(Statistic.SLEEP_IN_BED));
|
||||
player.sendMessage(ChatColor.AQUA+"Enchant count: "+player.getStatistic(Statistic.ITEM_ENCHANTED));
|
||||
// Calculate total play time from ticks (Minecraft runs at 20 ticks per second)
|
||||
long totalTicks = player.getStatistic(Statistic.TOTAL_WORLD_TIME);
|
||||
long totalSeconds = totalTicks / 20;
|
||||
long hours = totalSeconds / 3600;
|
||||
long minutes = (totalSeconds % 3600) / 60;
|
||||
long seconds = totalSeconds % 60;
|
||||
|
||||
player.sendMessage(STPlugin.getInstance().getPrefix() + ChatColor.GREEN + " === Your statistics === ");
|
||||
player.sendMessage(ChatColor.AQUA+"Connects: " + (player.getStatistic(Statistic.LEAVE_GAME)+1));
|
||||
player.sendMessage(ChatColor.AQUA+"Deaths: " + player.getStatistic(Statistic.DEATHS));
|
||||
player.sendMessage(ChatColor.AQUA+"Mob kills: " + player.getStatistic(Statistic.MOB_KILLS));
|
||||
player.sendMessage(ChatColor.AQUA+"Player kills: " + player.getStatistic(Statistic.PLAYER_KILLS));
|
||||
player.sendMessage(ChatColor.AQUA+"Sleep count: " + player.getStatistic(Statistic.SLEEP_IN_BED));
|
||||
player.sendMessage(ChatColor.AQUA+"Enchant count: " + player.getStatistic(Statistic.ITEM_ENCHANTED));
|
||||
player.sendMessage(ChatColor.AQUA + "Total Play Time: " + hours + "h " + minutes + "m " + seconds + "s");
|
||||
player.sendMessage(ChatColor.GREEN+" =================== ");
|
||||
return true;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package hu.ditservices.handlers;
|
||||
|
||||
import hu.ditservices.STPlugin;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -58,8 +59,12 @@ public class DITTabCompleter implements TabCompleter {
|
||||
}
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("pmanager")&& args[1].equalsIgnoreCase("unload") || args[1].equalsIgnoreCase("load")) {
|
||||
if (args.length == 3) {
|
||||
if (args[0].equalsIgnoreCase("pmanager") && args[1].equalsIgnoreCase("unload") || args[1].equalsIgnoreCase("load")) {
|
||||
if ((args.length == 3) && STPlugin.getInstance().getConfig().getBoolean("PluginManager.enabled") &
|
||||
(commandSender.hasPermission("st.pmanager")
|
||||
|| commandSender.hasPermission("st.pmanager.load")
|
||||
|| commandSender.hasPermission("st.pmanager.unload"))
|
||||
) {
|
||||
result.clear();
|
||||
PluginManager pm = Bukkit.getServer().getPluginManager();
|
||||
for (Plugin pl : pm.getPlugins()) {
|
||||
|
@ -37,7 +37,8 @@ public class Version {
|
||||
v1_21_1_R1,
|
||||
v1_21_2_R1,
|
||||
v1_21_3_R1,
|
||||
v1_21_4_R1;
|
||||
v1_21_4_R1,
|
||||
v1_21_5_R1;
|
||||
|
||||
private int value;
|
||||
|
||||
|
@ -74,6 +74,15 @@ Saving:
|
||||
broadcastMsgProgress: '{PREFIX}Auto save in progress..'
|
||||
broadcastMsgDone: '{PREFIX}Auto save done.'
|
||||
|
||||
# Server Password options
|
||||
# You can configure a same password for all players on the server.
|
||||
# Players not logged in can't move, cant build/destroy.
|
||||
ServerPassword:
|
||||
enabled: false
|
||||
password: 'changeme'
|
||||
exceptOps: true # Server operators don't need to login.
|
||||
|
||||
|
||||
# Cooldown options (only applicable for this plugin!)
|
||||
Cooldown:
|
||||
enabled: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user