EpicEnchants/src/main/java/com/songoda/epicenchants/effect/effects/Fly.java

23 lines
715 B
Java

package com.songoda.epicenchants.effect.effects;
import com.songoda.epicenchants.effect.EffectExecutor;
import com.songoda.epicenchants.enums.EventType;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import static com.songoda.epicenchants.enums.EventType.ON;
public class Fly extends EffectExecutor {
public Fly(ConfigurationSection section) {
super(section);
}
@Override
public void execute(@NotNull Player user, LivingEntity opponent, int level, EventType eventType) {
user.setAllowFlight(eventType == ON);
user.setFlying(eventType == ON);
}
}