mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Did the requested changes.
This commit is contained in:
parent
e0914af6d9
commit
cdb6eeab96
@ -42,7 +42,7 @@ public class CoolerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onHungerLoss(FoodLevelChangeEvent e) {
|
||||
if (cooler == null || cooler.isDisabled()) {
|
||||
if (cooler == null || cooler.isDisabled() || !(e.getEntity() instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -55,11 +55,11 @@ public class CoolerListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onHungerDamage(EntityDamageEvent e) {
|
||||
if (cooler == null || cooler.isDisabled()) {
|
||||
if (cooler == null || cooler.isDisabled() || !(e.getEntity() instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.getCause() == EntityDamageEvent.DamageCause.STARVATION) {
|
||||
if (e.getCause() == DamageCause.STARVATION) {
|
||||
checkAndConsume((Player) e.getEntity());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user