mirror of
https://github.com/taoneill/war.git
synced 2025-02-08 23:41:48 +01:00
parent
aa41a11daf
commit
f6175451ee
@ -3,6 +3,7 @@ package com.tommytony.war.event;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
@ -377,10 +378,7 @@ public class WarEntityListener implements Listener {
|
||||
*/
|
||||
@EventHandler
|
||||
public void onEntityRegainHealth(final EntityRegainHealthEvent event) {
|
||||
if (!War.war.isLoaded() ||
|
||||
(event.getRegainReason() != RegainReason.REGEN
|
||||
&& event.getRegainReason() != RegainReason.EATING
|
||||
&& event.getRegainReason() != RegainReason.SATIATED)) {
|
||||
if (!War.war.isLoaded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -393,8 +391,7 @@ public class WarEntityListener implements Listener {
|
||||
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
|
||||
if (zone != null) {
|
||||
Team team = Team.getTeamByPlayerName(player.getName());
|
||||
if ((event.getRegainReason() == RegainReason.EATING
|
||||
|| event.getRegainReason() != RegainReason.SATIATED )
|
||||
if (event.getRegainReason() == RegainReason.SATIATED
|
||||
&& team.getTeamConfig().resolveBoolean(TeamConfig.NOHUNGER)) {
|
||||
// noHunger setting means you can't auto-heal with full hunger bar (use saturation instead to control how fast you get hungry)
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user