!Removed DisableRegen option (use vanilla gamerule)

This commit is contained in:
Indyuce 2020-03-01 11:39:33 +01:00
parent 7fc5b56d59
commit ed8426b02f
3 changed files with 0 additions and 27 deletions

View File

@ -59,7 +59,6 @@ import net.Indyuce.mmocore.listener.PlayerListener;
import net.Indyuce.mmocore.listener.SpellCast;
import net.Indyuce.mmocore.listener.WaypointsListener;
import net.Indyuce.mmocore.listener.option.DeathExperienceLoss;
import net.Indyuce.mmocore.listener.option.DisableRegeneration;
import net.Indyuce.mmocore.listener.option.HealthScale;
import net.Indyuce.mmocore.listener.option.NoSpawnerEXP;
import net.Indyuce.mmocore.listener.option.VanillaExperienceOverride;
@ -274,9 +273,6 @@ public class MMOCore extends JavaPlugin {
if (getConfig().getBoolean("death-exp-loss.enabled"))
Bukkit.getPluginManager().registerEvents(new DeathExperienceLoss(), this);
if (getConfig().getBoolean("disable-vanilla-regen"))
Bukkit.getPluginManager().registerEvents(new DisableRegeneration(), this);
Bukkit.getPluginManager().registerEvents(new WaypointsListener(), this);
Bukkit.getPluginManager().registerEvents(new PlayerListener(), this);
Bukkit.getPluginManager().registerEvents(new GoldPouchesListener(), this);

View File

@ -1,18 +0,0 @@
package net.Indyuce.mmocore.listener.option;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
public class DisableRegeneration implements Listener {
@EventHandler(priority = EventPriority.HIGH)
public void a(EntityRegainHealthEvent event) {
if (event.getEntityType() == EntityType.PLAYER)
if (event.getRegainReason() == RegainReason.SATIATED || event.getRegainReason() == RegainReason.REGEN || event.getRegainReason() == RegainReason.EATING)
event.setCancelled(true);
}
}

View File

@ -70,11 +70,6 @@ health-scale:
enabled: true
scale: 20
# Disable player health regen due to saturation and eating
# to control health regen via MMOCore resource regen.
# Requires a SERVER reload when changed.
disable-vanilla-regen: false
# Allows to toggle exp hologram from gaining experiences
game-indicators:
exp: