Skip to content

Commit

Permalink
Fix On Death Error
Browse files Browse the repository at this point in the history
- Fix an error message that occured when players died.
- Ensure compatibility with Minecraft 1.14.0.
  • Loading branch information
aappleton8 committed May 4, 2019
1 parent 61943ca commit af60896
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion PromoteOneself/Information.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a general plugin information file that is shipped inside the exported .jar file of the plugin. More information can be found on this plugin's GitHub page. This file was last updated for plugin version 1.0.0.5.
This is a general plugin information file that is shipped inside the exported .jar file of the plugin. More information can be found on this plugin's GitHub page. This file was last updated for plugin version 1.0.0.6.


Commands:
Expand Down
2 changes: 1 addition & 1 deletion PromoteOneself/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PromoteOneself
main: me.PromoteOneselfPackage.PromoteOneself.Classes.PromoteOneselfMainClass
version: 1.0.0.5
version: 1.0.0.6
description: A plugin which lets people achieve aims to work up through a server's ranking system
author: aappleton3
database: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ else if (plugin.yc.configuration.getBoolean("startInPromotionTree") == true) {
ua.addPlayer(defaultFirstTarget, spId, rpId, true);
}
if ((exempt == false) && plugin.yc.configuration.getBoolean("remindOnJoin")) {
if (plugin.yd.configuration.getBoolean("players." + spId + ".finished") == false) {
if (plugin.yd.configuration.contains("players." + spId) == false) {
Bukkit.getPlayer(rpId).sendMessage(ChatColor.AQUA + plugin.logger.getName(true) + "You are not in the promotion tree ");
}
else if (plugin.yd.configuration.getBoolean("players." + spId + ".finished") == false) {
String target = plugin.yd.configuration.getString("players." + spId + ".target");
Bukkit.getPlayer(rpId).sendMessage(ChatColor.AQUA + plugin.logger.getName(true) + "Your current target (" + target + ") requires the aims: " + plugin.yc.configuration.getStringList("targets." + target + ".aims"));
}
Expand All @@ -95,19 +98,21 @@ else if (plugin.yd.configuration.getBoolean("players." + spId + ".finished") ==
@EventHandler (ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerDeath(PlayerDeathEvent event) {
if (plugin.yc.configuration.getBoolean("detectKills") == true) {
try {
UUID rpId = event.getEntity().getKiller().getUniqueId();
String spId = rpId.toString();
if ((plugin.yd.configuration.contains("players." + spId)) && (event.getEntity().getKiller() instanceof Player)) {
int kills = plugin.yd.configuration.getInt("players." + spId + ".data.kills");
kills += 1;
plugin.yd.configuration.set("players." + spId + ".data.kills", kills);
plugin.saveFiles();
if (event.getEntity().getKiller() instanceof Player) {
try {
UUID rpId = event.getEntity().getKiller().getUniqueId();
String spId = rpId.toString();
if (plugin.yd.configuration.contains("players." + spId)) {
int kills = plugin.yd.configuration.getInt("players." + spId + ".data.kills");
kills += 1;
plugin.yd.configuration.set("players." + spId + ".data.kills", kills);
plugin.saveFiles();
}
}
catch (Exception e) {
plugin.logger.warning("custom", "Player death error: " + e.toString());
plugin.logger.exception("death of player error: ", e);
}
}
catch (Exception e) {
plugin.logger.warning("custom", "Player death error: " + e.toString());
plugin.logger.exception("death of player error: ", e);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The PromoteOneself plugin is a Minecraft Spigot server plugin. This plugin enabl
This plugin can use functionality provided by the 'Vault' plugin (https://www.spigotmc.org/resources/vault.34315/) and the 'PlayerPoints' plugin (https://dev.bukkit.org/projects/playerpoints). They are not requirements to run the PromoteOneself plugin, but they are required for some aim types (as specified in the 'Aims' section below). There are currently no known compatibility issues with any other plugins.

## Versions:
The current plugin release version is 1.0.0.5; this is available in the 'releases' section. The most recently compiled .jar file that runs (which may be the same as the most recent release) can be found in the 'Jar' folder. This plugin is designed to be run with Minecraft Spigot running versions between 1.7.x and 1.13.x. Most versions of Vault and PlayerPoints for the corresponding Spigot versions should work. Bugs found when running on the aforementioned Minecraft versions will be fixed. The plugin may still work with other versions but bugs for these versions will not necessarily be fixed.
The current plugin release version is 1.0.0.6; this is available in the 'releases' section. The most recently compiled .jar file that runs (which may be the same as the most recent release) can be found in the 'Jar' folder. This plugin is designed to be run with Minecraft Spigot running versions between 1.7.6 and 1.14.0. Most versions of Vault and PlayerPoints for the corresponding Spigot versions should work. Bugs found when running on the aforementioned Minecraft versions will be fixed. The plugin may still work with other versions but bugs for these versions will not necessarily be fixed.

## License:
This plugin and its source code are released under a GNU GPL v3.0 license (see the LICENSE file for the full license). This plugin is copyright (c) aappleton3/aappleton8, 2018.
Expand Down

0 comments on commit af60896

Please sign in to comment.