Cleaned up FillerMask

This commit is contained in:
Auxilor
2022-02-03 17:22:46 +00:00
parent e65cf9be2c
commit 232a63c00d
2 changed files with 10 additions and 6 deletions

View File

@@ -54,11 +54,7 @@ public class FillerMask {
public FillerMask(@NotNull final MaskMaterials materials,
@NotNull final String... pattern) {
this(
new MaskItems(
Arrays.stream(materials.materials())
.map(MaterialTestableItem::new)
.toArray(MaterialTestableItem[]::new)
),
materials.toMaskItems(),
pattern
);
}

View File

@@ -1,5 +1,6 @@
package com.willfp.eco.core.gui.slot;
import com.willfp.eco.core.items.Items;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@@ -12,5 +13,12 @@ import org.jetbrains.annotations.NotNull;
*/
@Deprecated(since = "6.24.0")
public record MaskMaterials(@NotNull Material... materials) {
/**
* Convert MaskMaterials to MaskItems.
*
* @return The MaskItems.
*/
public MaskItems toMaskItems() {
return new MaskItems(Items.fromMaterials(this.materials()));
}
}