Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
KingKits v5.3.2-Dev2.1
Browse files Browse the repository at this point in the history
KingKits v5.3.2-Dev2.1
  • Loading branch information
KingFaris10 committed Jul 26, 2017
1 parent 91c6f35 commit b62b4e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/faris/kingkits/KingKits.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.faris.kingkits.storage.FlatFileStorage;
import com.faris.kingkits.updater.BukkitUpdater;
import com.faris.kingkits.updater.SpigotUpdater;
import org.bstats.bukkit.Metrics;
import org.bukkit.ChatColor;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.bukkit.entity.Player;
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/com/faris/kingkits/listener/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,20 @@ public void onPlayerLeave(PlayerQuitEvent event) {
player.getInventory().setArmorContents(null);
}
if (inPvPWorld && ConfigController.getInstance().shouldRemovePotionEffectsOnLeave(player.getWorld())) {
for (PotionEffect activePotionEffect : player.getActivePotionEffects())
for (PotionEffect activePotionEffect : player.getActivePotionEffects()) {
player.removePotionEffect(activePotionEffect.getType());
}
}
if (kitPlayer != null && kitPlayer.hasKit()) {
if (player.getHealth() > PlayerUtilities.getDefaultMaxHealth())
if (player.getHealth() > PlayerUtilities.getDefaultMaxHealth()) {
player.setHealth(PlayerUtilities.getDefaultMaxHealth());
if (ConfigController.getInstance().shouldSetMaxHealth())
}
if (ConfigController.getInstance().shouldSetMaxHealth()) {
player.setMaxHealth(PlayerUtilities.getDefaultMaxHealth());
if (kitPlayer.getKit().getWalkSpeed() != PlayerUtilities.getDefaultWalkSpeed())
}
if (kitPlayer.getKit().getWalkSpeed() != PlayerUtilities.getDefaultWalkSpeed()) {
player.setWalkSpeed(PlayerUtilities.getDefaultWalkSpeed());
}
}
} catch (Exception ex) {
Bukkit.getServer().getLogger().log(Level.SEVERE, "Failed to reset " + player.getName() + (player.getName().endsWith("s") ? "'" : "'s") + " inventory and/or potion effects.", ex);
Expand Down Expand Up @@ -328,7 +332,9 @@ public void onPlayerDeath(PlayerDeathEvent event) {
player.getInventory().setArmorContents(null);
player.updateInventory();
} else {
event.setKeepInventory(true);
if (ConfigController.getInstance().shouldKeepInventory(player.getWorld())) {
event.setKeepInventory(true);
}
}
kitPlayer.onDeath();
if (killer != null && !player.getUniqueId().equals(killer.getUniqueId())) {
Expand Down

0 comments on commit b62b4e6

Please sign in to comment.