Skip to content

Commit

Permalink
Merge branch 'rossnoah:main' into gui
Browse files Browse the repository at this point in the history
  • Loading branch information
jd07159 authored Jan 12, 2025
2 parents 58e7628 + dec8be8 commit 40b2c85
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>dev.noah</groupId>
<artifactId>PerPlayerKit</artifactId>
<version>1.5.1</version>
<version>1.5.3</version>
<packaging>jar</packaging>

<name>PerPlayerKit</name>
Expand Down
53 changes: 27 additions & 26 deletions src/main/java/dev/noah/perplayerkit/KitManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -524,33 +524,34 @@ public boolean deleteKit(UUID uuid, int slot) {

private void applyKitLoadEffects(Player player, boolean isEnderChest) {

if (isEnderChest) {
if (plugin.getConfig().getBoolean("heal-on-enderchest-load", false)) {
player.setHealth(20);
}
if (plugin.getConfig().getBoolean("feed-on-enderchest-load", false)) {
player.setFoodLevel(20);
}
if (plugin.getConfig().getBoolean("set-saturation-on-enderchest-load", false)) {
player.setSaturation(20);
}
if (plugin.getConfig().getBoolean("remove-potion-effects-on-enderchest-load", false)) {
player.getActivePotionEffects().forEach(potionEffect -> player.removePotionEffect(potionEffect.getType()));
}
} else {
if (plugin.getConfig().getBoolean("set-health-on-kit-load", false)) {
player.setHealth(20);
}
if (plugin.getConfig().getBoolean("set-hunger-on-kit-load", false)) {
player.setFoodLevel(20);
}
if (plugin.getConfig().getBoolean("set-saturation-on-kit-load", false)) {
player.setSaturation(20);
}
if (plugin.getConfig().getBoolean("remove-potion-effects-on-kit-load", false)) {
player.getActivePotionEffects().forEach(potionEffect -> player.removePotionEffect(potionEffect.getType()));
if (!player.isDead()) {
if (isEnderChest) {
if (plugin.getConfig().getBoolean("feature.heal-on-enderchest-load", false)) {
player.setHealth(20);
}
if (plugin.getConfig().getBoolean("feature.feed-on-enderchest-load", false)) {
player.setFoodLevel(20);
}
if (plugin.getConfig().getBoolean("feature.set-saturation-on-enderchest-load", false)) {
player.setSaturation(20);
}
if (plugin.getConfig().getBoolean("feature.remove-potion-effects-on-enderchest-load", false)) {
player.getActivePotionEffects().forEach(potionEffect -> player.removePotionEffect(potionEffect.getType()));
}
} else {
if (plugin.getConfig().getBoolean("feature.set-health-on-kit-load", false)) {
player.setHealth(20);
}
if (plugin.getConfig().getBoolean("feature.set-hunger-on-kit-load", false)) {
player.setFoodLevel(20);
}
if (plugin.getConfig().getBoolean("feature.set-saturation-on-kit-load", false)) {
player.setSaturation(20);
}
if (plugin.getConfig().getBoolean("feature.remove-potion-effects-on-kit-load", false)) {
player.getActivePotionEffects().forEach(potionEffect -> player.removePotionEffect(potionEffect.getType()));
}
}
}
}

}

0 comments on commit 40b2c85

Please sign in to comment.