Added grounding charm
This commit is contained in:
@@ -17,6 +17,7 @@ import com.willfp.talismans.talismans.talismans.FeatherTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.FlameTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.FluxTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.GravityTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.GroundingCharm;
|
||||
import com.willfp.talismans.talismans.talismans.HealingTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.ImmunityTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.NecromanceRing;
|
||||
@@ -80,6 +81,7 @@ public class Talismans {
|
||||
public static final Talisman DAY_CRYSTAL = new DayCrystal();
|
||||
public static final Talisman NIGHT_CRYSTAL = new NightCrystal();
|
||||
public static final Talisman NECROMANCE_RING = new NecromanceRing();
|
||||
public static final Talisman GROUNDING_CHARM = new GroundingCharm();
|
||||
|
||||
/**
|
||||
* Get all registered {@link Talisman}s.
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.eco.core.integrations.mcmmo.McmmoManager;
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityPotionEffectEvent;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GroundingCharm extends Talisman {
|
||||
public GroundingCharm() {
|
||||
super("grounding");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void listener(@NotNull final EntityPotionEffectEvent event) {
|
||||
if (McmmoManager.isFake(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(event.getEntity() instanceof Player player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getNewEffect() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!event.getNewEffect().getType().equals(PotionEffectType.LEVITATION)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getDisabledWorlds().contains(player.getWorld())) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
enabled: true
|
||||
disabled-in-worlds: [ ]
|
||||
|
||||
levels:
|
||||
1:
|
||||
name: "&aGrounding Charm"
|
||||
description: Become immune to levitation.
|
||||
|
||||
obtaining:
|
||||
craftable: true
|
||||
recipe:
|
||||
- phantom_membrane
|
||||
- phantom_membrane
|
||||
- phantom_membrane
|
||||
|
||||
- phantom_membrane
|
||||
- ender_eye
|
||||
- phantom_membrane
|
||||
|
||||
- phantom_membrane
|
||||
- phantom_membrane
|
||||
- phantom_membrane
|
||||
|
||||
general-config:
|
||||
material: player_head
|
||||
texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWQzNGJhNjg4ZDlkMjc1YjViMmJjMjAwZmFhYzAwMGExMzQ1MjVlNTY1YjkyNjhlMzRiZTM5MmE2MDBkMTczZSJ9fX0=
|
||||
|
||||
config:
|
||||
# No config is available for this talisman
|
||||
Reference in New Issue
Block a user