mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added blacklisted-blocks config option to Instantaneous enchantment
This commit is contained in:
parent
ac2a19ec07
commit
7ca5c7300a
@ -2,6 +2,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
|
||||
|
||||
import com.willfp.eco.core.integrations.anticheat.AnticheatManager;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
||||
import org.bukkit.Material;
|
||||
@ -10,6 +11,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Instantaneous extends EcoEnchant {
|
||||
public Instantaneous() {
|
||||
super(
|
||||
@ -39,7 +43,13 @@ public class Instantaneous extends EcoEnchant {
|
||||
return;
|
||||
}
|
||||
|
||||
if (block.getType() == Material.BEDROCK) {
|
||||
List<Material> blacklist = new ArrayList<>();
|
||||
|
||||
for (String s : this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blacklisted-blocks")) {
|
||||
blacklist.add(Material.getMaterial(s));
|
||||
}
|
||||
|
||||
if (blacklist.contains(block.getType())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -28,4 +28,10 @@ general-config:
|
||||
maximum-level: 7
|
||||
|
||||
config:
|
||||
chance-per-level: 3
|
||||
chance-per-level: 3
|
||||
blacklisted-blocks:
|
||||
- BEDROCK
|
||||
- OBSIDIAN
|
||||
- END_PORTAL
|
||||
- END_PORTAL_GATE
|
||||
- NETHER_PORTAL
|
Loading…
Reference in New Issue
Block a user