mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-27 06:21:59 +01:00
Added works-on to transfuse
This commit is contained in:
parent
d6abbf6d73
commit
3dbb602ee3
@ -12,6 +12,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public final class Transfuse extends EcoEnchant {
|
public final class Transfuse extends EcoEnchant {
|
||||||
public Transfuse() {
|
public Transfuse() {
|
||||||
super(
|
super(
|
||||||
@ -32,6 +34,9 @@ public final class Transfuse extends EcoEnchant {
|
|||||||
|
|
||||||
event.setDropItems(false);
|
event.setDropItems(false);
|
||||||
|
|
||||||
|
if(!this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "works-on").stream().map(string -> Material.getMaterial(string.toUpperCase())).collect(Collectors.toList()).contains(block.getType()))
|
||||||
|
return;
|
||||||
|
|
||||||
Material material;
|
Material material;
|
||||||
double random = NumberUtils.randFloat(0, 1);
|
double random = NumberUtils.randFloat(0, 1);
|
||||||
double band = 1/(double) this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blocks").size();
|
double band = 1/(double) this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blocks").size();
|
||||||
|
@ -29,3 +29,5 @@ config:
|
|||||||
- redstone_ore
|
- redstone_ore
|
||||||
- iron_ore
|
- iron_ore
|
||||||
chance-per-level: 0.03 # Chance for drop to be switched
|
chance-per-level: 0.03 # Chance for drop to be switched
|
||||||
|
works-on:
|
||||||
|
- stone
|
||||||
|
Loading…
Reference in New Issue
Block a user