mirror of
https://github.com/taoneill/war.git
synced 2025-02-13 09:51:19 +01:00
parent
aa41a11daf
commit
f6175451ee
@ -3,6 +3,7 @@ package com.tommytony.war.event;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -377,10 +378,7 @@ public class WarEntityListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityRegainHealth(final EntityRegainHealthEvent event) {
|
public void onEntityRegainHealth(final EntityRegainHealthEvent event) {
|
||||||
if (!War.war.isLoaded() ||
|
if (!War.war.isLoaded()) {
|
||||||
(event.getRegainReason() != RegainReason.REGEN
|
|
||||||
&& event.getRegainReason() != RegainReason.EATING
|
|
||||||
&& event.getRegainReason() != RegainReason.SATIATED)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,8 +391,7 @@ public class WarEntityListener implements Listener {
|
|||||||
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
|
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
|
||||||
if (zone != null) {
|
if (zone != null) {
|
||||||
Team team = Team.getTeamByPlayerName(player.getName());
|
Team team = Team.getTeamByPlayerName(player.getName());
|
||||||
if ((event.getRegainReason() == RegainReason.EATING
|
if (event.getRegainReason() == RegainReason.SATIATED
|
||||||
|| event.getRegainReason() != RegainReason.SATIATED )
|
|
||||||
&& team.getTeamConfig().resolveBoolean(TeamConfig.NOHUNGER)) {
|
&& 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)
|
// 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);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user