Blacklist
Blacklist your custom items
Create your own blacklist class implement from IBlacklist
1
public class BlacklistSimilar implements IBlacklist {
2
​
3
private final List<ItemStack> itemstacks;
4
​
5
/**
6
* @param itemstacks
7
*/
8
public BlacklistSimilar(List<ItemStack> itemstacks) {
9
super();
10
this.itemstacks = itemstacks;
11
}
12
​
13
@Override
14
public String getName() {
15
return "Similar itemstack";
16
}
17
​
18
@Override
19
public boolean isBlacklist(ItemStack itemStack) {
20
return this.itemstacks.stream()
21
.anyMatch(stack -> stack != null && itemStack != null && stack.isSimilar(itemStack));
22
}
23
​
24
}
Copied!
After your need to use the method registerBlacklist in IBlacklistManager class
Copy link