mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-05 22:07:34 +01:00
Added Dousing Enchant.
This commit is contained in:
parent
3e92f9afe1
commit
c09e7e6c60
@ -57,162 +57,7 @@ import com.willfp.ecoenchants.enchantments.ecoenchants.curse.HungerCurse;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.curse.InaccuracyCurse;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.curse.MisfortuneCurse;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.curse.PermanenceCurse;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Abattoir;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Abrasion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Aerial;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Aquatic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Arachnid;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Arborist;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Arcanic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Atmospheric;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Backstab;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Beheading;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.BlastMining;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Bleed;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Blind;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.BlockBreather;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.BossHunter;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Buckshot;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Butchering;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Cerebral;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Chopless;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Cleave;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Collateral;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Conclude;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Corrosive;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Cranial;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Criticals;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Cubism;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Defender;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Deflection;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Defusion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Dexterous;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Disable;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Disappear;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Diurnal;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Diverse;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Drill;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Dullness;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Dweller;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Economical;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Electroshock;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.EndInfusion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.EnderSlayer;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Enderism;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Evasion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Extinguishing;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Extract;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Famine;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Farmhand;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Fetching;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Finality;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Finishing;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.FireAffinity;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.FirstStrike;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Flinch;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Forcefield;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Freerunner;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Frozen;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Fury;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Goliath;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Graceful;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Grapple;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.GreenThumb;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Grit;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Hellish;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Hook;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Horde;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.IceShot;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Identify;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Ignite;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.IllusionAspect;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Impact;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Incandescence;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.InfernalTouch;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Inferno;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Infuriate;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Insecticide;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Instantaneous;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Introversion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Invigoration;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Kinetic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Launch;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Leeching;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Lesion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Levitate;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.LiquidShot;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.LuckyCatch;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Lumberjack;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Magnetic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Marking;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Marksman;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Necrotic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.NetherInfusion;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Netheric;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Nocturnal;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Optics;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Oxygenate;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Pacify;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Paladin;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Paralyze;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Parasitic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Parry;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Phantasm;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Plasmic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Protector;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Proximity;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Puncture;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Quadrilateralism;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Radiance;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Rage;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Rapid;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Reaper;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Rebounding;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Reel;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Reinforcement;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Rejuvenation;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Replenish;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Respirator;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Revenant;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Sating;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Serrated;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Settle;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Shockwave;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.ShotAssist;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Sickening;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Slaughter;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Slicing;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Spearfishing;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Spiked;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Splash;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Stab;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Stalwart;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Stamina;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.StoneSwitcher;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.StrayAspect;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Succession;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Supercritical;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Sycophant;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Tectonic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Telekinesis;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Thor;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Thrive;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Tornado;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Toxic;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Transfuse;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Tripleshot;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.VampireAspect;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Vein;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Venom;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.VoidAffinity;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Voltage;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.WaterAffinity;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.WaterAspect;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Weakening;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Wisdom;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.WoodSwitcher;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Wound;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Zeus;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.normal.*;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.special.Aiming;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.special.Annihilate;
|
||||
import com.willfp.ecoenchants.enchantments.ecoenchants.special.Bladed;
|
||||
@ -502,6 +347,7 @@ public class EcoEnchants {
|
||||
public static final EcoEnchant WAX_ARTIFACT = new WaxArtifact();
|
||||
public static final EcoEnchant RAIN_ARTIFACT = new RainArtifact();
|
||||
public static final EcoEnchant SLIME_ARTIFACT = new SlimeArtifact();
|
||||
public static final EcoEnchant DOUSING = new Dousing();
|
||||
|
||||
/**
|
||||
* Get all registered {@link EcoEnchant}s.
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
|
||||
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefManager;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Dousing extends EcoEnchant {
|
||||
public Dousing() {
|
||||
super(
|
||||
"dousing", EnchantmentType.NORMAL
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlaceholder(final int level) {
|
||||
return EnchantmentUtils.chancePlaceholder(this, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrowHit(@NotNull final LivingEntity uncastShooter,
|
||||
final int level,
|
||||
@NotNull final ProjectileHitEvent event) {
|
||||
if (!(uncastShooter instanceof Player shooter)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getHitBlock() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AntigriefManager.canBreakBlock(shooter, event.getHitBlock())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!EnchantmentUtils.passedChance(this, level)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockFace face = event.getHitBlockFace();
|
||||
|
||||
assert face != null;
|
||||
|
||||
Block toIgnite = event.getHitBlock().getRelative(face);
|
||||
if (toIgnite.getType().equals(Material.FIRE)) {
|
||||
toIgnite.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
#
|
||||
# Dousing EcoEnchant
|
||||
#
|
||||
|
||||
name: "Dousing"
|
||||
description: '&a%value%%&r chance to put out fire on block.'
|
||||
enabled: true
|
||||
|
||||
obtaining:
|
||||
table: true
|
||||
villager: true
|
||||
loot: true
|
||||
rarity: legendary
|
||||
|
||||
general-config:
|
||||
flags: []
|
||||
targets:
|
||||
- bow
|
||||
- crossbow
|
||||
grindstoneable: true
|
||||
disabled-in-worlds: [ ]
|
||||
conflicts:
|
||||
- ignite
|
||||
maximum-level: 8
|
||||
|
||||
config:
|
||||
chance-per-level: 12.5
|
@ -22,7 +22,8 @@ general-config:
|
||||
requirements:
|
||||
list: []
|
||||
not-met-lore: []
|
||||
conflicts: [ ]
|
||||
conflicts:
|
||||
- dousing
|
||||
maximum-level: 8
|
||||
|
||||
config:
|
||||
|
Loading…
Reference in New Issue
Block a user