mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Bandages, Rags and Splints will no longer be consumed if at full health
This commit is contained in:
parent
2f188338fc
commit
2b9d109d16
@ -19,6 +19,9 @@
|
||||
|
||||
## Release Candidate 12 (TBD)
|
||||
|
||||
#### Changes
|
||||
* Bandages, Rags and Splints will no longer be consumed if your health is full and you are not on fire
|
||||
|
||||
#### Fixes
|
||||
* Fixed #1824
|
||||
|
||||
|
@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.medical;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
@ -26,6 +27,11 @@ public class Bandage extends SimpleSlimefunItem<ItemUseHandler> {
|
||||
return e -> {
|
||||
Player p = e.getPlayer();
|
||||
|
||||
// Player is neither burning nor injured
|
||||
if (p.getFireTicks() <= 0 && p.getHealth() == p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.getGameMode() != GameMode.CREATIVE) {
|
||||
ItemUtils.consumeItem(e.getItem(), false);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.medical;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
@ -26,6 +27,11 @@ public class Rag extends SimpleSlimefunItem<ItemUseHandler> {
|
||||
return e -> {
|
||||
Player p = e.getPlayer();
|
||||
|
||||
// Player is neither burning nor injured
|
||||
if (p.getFireTicks() <= 0 && p.getHealth() == p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.getGameMode() != GameMode.CREATIVE) {
|
||||
ItemUtils.consumeItem(e.getItem(), false);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.medical;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
@ -25,6 +26,11 @@ public class Splint extends SimpleSlimefunItem<ItemUseHandler> {
|
||||
return e -> {
|
||||
Player p = e.getPlayer();
|
||||
|
||||
// Player is neither burning nor injured
|
||||
if (p.getFireTicks() <= 0 && p.getHealth() == p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.getGameMode() != GameMode.CREATIVE) {
|
||||
ItemUtils.consumeItem(e.getItem(), false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user