diff --git a/Jar/PlayerSlap_v1.0.0.1_1.7-1.13.jar b/Jar/PlayerSlap_v1.0.0.2_1.7-1.13.jar similarity index 71% rename from Jar/PlayerSlap_v1.0.0.1_1.7-1.13.jar rename to Jar/PlayerSlap_v1.0.0.2_1.7-1.13.jar index 99a2433..ad8c14c 100644 Binary files a/Jar/PlayerSlap_v1.0.0.1_1.7-1.13.jar and b/Jar/PlayerSlap_v1.0.0.2_1.7-1.13.jar differ diff --git a/PlayerSlap/plugin.yml b/PlayerSlap/plugin.yml index 6197f36..8bf2ada 100644 --- a/PlayerSlap/plugin.yml +++ b/PlayerSlap/plugin.yml @@ -1,6 +1,6 @@ name: PlayerSlap main: me.PlayerSlap.MainClasses.PlayerSlapMainClass -version: 1.0.0.1 +version: 1.0.0.2 description: A plugin to slap players author: aappleton3 database: false @@ -23,7 +23,7 @@ commands: slapaccept: description: Acknowledge that you have been slapped if someone slaps you usage: /slapaccept [] - aliases: [slapac, slaa, slacc] + aliases: [slapac, slapacc, slapap, slapapp, slaa, slacc] permission-message: You do not have the required permissions to perform this command slaprelease: description: Release a player who has been hit with a permanent slap diff --git a/PlayerSlap/src/me/PlayerSlap/CommandClasses/SlapInfoCommand.java b/PlayerSlap/src/me/PlayerSlap/CommandClasses/SlapInfoCommand.java index 263eddc..3e9652a 100644 --- a/PlayerSlap/src/me/PlayerSlap/CommandClasses/SlapInfoCommand.java +++ b/PlayerSlap/src/me/PlayerSlap/CommandClasses/SlapInfoCommand.java @@ -5,6 +5,7 @@ import java.util.UUID; import java.util.logging.Logger; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -143,7 +144,20 @@ else if (args[0].equalsIgnoreCase("player")) { else { String sid = pid.toString(); s.sendMessage(ChatColor.AQUA + "The player " + args[1] + " has the following information: "); - s.sendMessage("Is exempt: " + plugin.yd.configuration.getString("players." + sid + ".exempt")); + if (Bukkit.getOfflinePlayer(pid).isOnline()) { + s.sendMessage("The player is online "); + if (Bukkit.getPlayer(pid).hasPermission("playerslap.noslap")) { + s.sendMessage("Is exempt: true "); + } + else { + s.sendMessage("Is exampt: false "); + } + } + else { + s.sendMessage("The player is offline "); + s.sendMessage("The exemption status of offline players cannot be obtained "); + } + s.sendMessage("Is fully exempt: " + plugin.yd.configuration.getString("players." + sid + ".exempt")); s.sendMessage("This player has been slapped " + plugin.yd.configuration.getString("players." + sid + ".times") + " times "); if (plugin.needAcceptPlayers.containsKey(pid)) { s.sendMessage(ChatColor.RED + "This player is currently under a slap "); diff --git a/PlayerSlap/src/me/PlayerSlap/MainClasses/PlayerSlapMainClass.java b/PlayerSlap/src/me/PlayerSlap/MainClasses/PlayerSlapMainClass.java index 512797b..17e215e 100644 --- a/PlayerSlap/src/me/PlayerSlap/MainClasses/PlayerSlapMainClass.java +++ b/PlayerSlap/src/me/PlayerSlap/MainClasses/PlayerSlapMainClass.java @@ -90,12 +90,14 @@ private void getCurrentlySlappedPlayers() { private void registerExtraPermissions(PluginManager pm) { Set slapTypes = Collections.emptySet(); try { - slapTypes = plugin.yc.configuration.getConfigurationSection("slaptypes").getKeys(false); + slapTypes = yc.configuration.getConfigurationSection("slaptypes").getKeys(false); } catch (NullPointerException e) { logger.warning(formattedPluginName + "Could not register extra permissions as the config.yml file could not be loaded : " + e.toString()); + e.printStackTrace(); } if ((slapTypes != null) && (slapTypes.isEmpty() == false)) { + logger.info(formattedPluginName + "Registering extra permissions "); YamlFiles.checkPermissions(slapTypes, pm); } } diff --git a/PlayerSlap/src/me/PlayerSlap/MainClasses/YamlFiles.java b/PlayerSlap/src/me/PlayerSlap/MainClasses/YamlFiles.java index 08f575c..ef3d77c 100644 --- a/PlayerSlap/src/me/PlayerSlap/MainClasses/YamlFiles.java +++ b/PlayerSlap/src/me/PlayerSlap/MainClasses/YamlFiles.java @@ -11,7 +11,7 @@ public class YamlFiles extends YamlFilesBase { private final String configPermission = "playerslap.see.config"; - private static Set slapPermissions = Collections.emptySet(); + private static Set slapPermissions = Collections.emptySet(); public YamlFiles(PlayerSlapMainClass pluginInstance, Logger loggerInstance, String outFileName, String inFileName) { super(pluginInstance, loggerInstance, outFileName, inFileName); diff --git a/README.md b/README.md index be613e8..a3413cc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This plugin gives server administrators the ability to 'slap' players as a form of punishment. The action of 'slapping' can involve removing health, spawning mobs, hitting the player with lightning, producing smoke and broadcasting a message. Different types of slaps can be defined in the config file. ## Versions: -This project is currently version 1.0.0.0. It is designed for Minecraft Spigot versions between 1.7.x and 1.13.x. The latest latest can be found in the 'releases' section, and the most recent (possibly unstable) build can be found in the 'Jar' folder. +This project is currently version 1.0.0.2. It is designed for Minecraft Spigot versions between 1.7.x and 1.13.x. The latest latest can be found in the 'releases' section, and the most recent (possibly unstable) build can be found in the 'Jar' folder. ## License: This plugin and its source code are released under a MIT license (see the LICENSE file for full details). This plugin is copyright (c) aappleton3/aappleton8, 2018.