From d7f1759502f2f2221d759935e1c737255233d764 Mon Sep 17 00:00:00 2001 From: Niklas Date: Sun, 28 Jun 2020 01:41:40 +0200 Subject: [PATCH] added single type constructor to block component --- src/main/java/org/kapelle/multiblock/BlockComponent.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/kapelle/multiblock/BlockComponent.java b/src/main/java/org/kapelle/multiblock/BlockComponent.java index 8882131..6a6faae 100644 --- a/src/main/java/org/kapelle/multiblock/BlockComponent.java +++ b/src/main/java/org/kapelle/multiblock/BlockComponent.java @@ -5,6 +5,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import java.util.Collections; +import java.util.HashSet; import java.util.Set; interface CheckFunction { @@ -36,6 +37,12 @@ public class BlockComponent { this.customCheckFunction = customCheckFunction; } + public BlockComponent(Material type){ + this.blocks = new HashSet<>(); + this.blocks.add(type); + this.mode = BlockComponentMode.SET; + } + public boolean isValidBlock(Location location){ if(this.mode == BlockComponentMode.CUSTOM){ return this.customCheckFunction.apply(location);