Changed regen cause so disable-regen does not impact MMOCore regen

This commit is contained in:
Jules 2020-02-21 17:43:13 +01:00
parent b444fac599
commit 6017062ddb

View File

@ -93,7 +93,7 @@ public class PlayerListener implements Listener {
@EventHandler(priority = EventPriority.HIGH)
public void g(PlayerRegenResourceEvent event) {
if (event.getResource() == PlayerResource.HEALTH) {
EntityRegainHealthEvent bukkitEvent = new EntityRegainHealthEvent(event.getPlayer(), event.getAmount(), RegainReason.REGEN);
EntityRegainHealthEvent bukkitEvent = new EntityRegainHealthEvent(event.getPlayer(), event.getAmount(), RegainReason.CUSTOM);
Bukkit.getPluginManager().callEvent(bukkitEvent);
event.setCancelled(bukkitEvent.isCancelled());
event.setAmount(bukkitEvent.getAmount());