Class CMatterImpl
-
- All Implemented Interfaces:
-
io.github.sakaki_aruka.customcrafter.matter.CMatter
public class CMatterImpl implements CMatter
A default CMatter implemented class.
-
-
Constructor Summary
Constructors Constructor Description CMatterImpl(String name, Set<Material> candidate, Integer amount, Boolean anyAmount, List<CMatterPredicate> predicates)CMatterImpl(String name, Set<Material> candidate, Integer amount, Boolean anyAmount)CMatterImpl(String name, Set<Material> candidate, Integer amount)CMatterImpl(String name, Set<Material> candidate)
-
Method Summary
Modifier and Type Method Description StringgetName()Set<Material>getCandidate()IntegergetAmount()BooleangetAnyAmount()List<CMatterPredicate>getPredicates()final static List<CMatterPredicate>defaultMatterPredicates()Returns default elements (enchant, enchant storage, potion) predicate set final static CMatterImplof(Material materials)Returns CMatterImpl build from specified materials. final static CMatterImplsingle(Material material)Returns single candidate CMatterImpl. final static CMatterImplmulti(Material materials)Returns multi candidate CMatterImpl. -
-
Constructor Detail
-
CMatterImpl
CMatterImpl(String name, Set<Material> candidate, Integer amount, Boolean anyAmount, List<CMatterPredicate> predicates)
- Parameters:
name- matter namecandidate- matter candidate materialsamount- matter amount (default = 1)anyAmount- Iftrue, any input amount ≥ 1 is accepted regardless of amount.predicates- if in checks, this matter requires to pass these all.
-
CMatterImpl
CMatterImpl(String name, Set<Material> candidate, Integer amount, Boolean anyAmount)
- Parameters:
name- matter namecandidate- matter candidate materialsamount- matter amount (default = 1)anyAmount- Iftrue, any input amount ≥ 1 is accepted regardless of amount.
-
CMatterImpl
CMatterImpl(String name, Set<Material> candidate, Integer amount)
- Parameters:
name- matter namecandidate- matter candidate materialsamount- matter amount (default = 1)
-
-
Method Detail
-
getCandidate
Set<Material> getCandidate()
-
getAnyAmount
Boolean getAnyAmount()
-
getPredicates
List<CMatterPredicate> getPredicates()
-
defaultMatterPredicates
final static List<CMatterPredicate> defaultMatterPredicates()
Returns default elements (enchant, enchant storage, potion) predicate set
- Returns:
Set Returns a default elements checker set
- Since:
5.0.15
-
of
final static CMatterImpl of(Material materials)
Returns CMatterImpl build from specified materials.
// below 2 matters are same val matter = CMatterImpl.of(Material.STONE, Material.COBBLESTONE) val matter = CMatterImpl( name = "STONE-COBBLESTONE", candidate = setOf(Material.STONE, Material.COBBLESTONE), amount = 1, anyAmount = false, predicates = defaultMatterPredicates() )- Parameters:
materials- Candidate materials- Returns:
CMatterImpl Built matter
-
single
final static CMatterImpl single(Material material)
Returns single candidate CMatterImpl.
Its name is material's name.
material.name.// below 2 matters are same val matter = CMatterImpl.single(Material.STONE) val matter = CMatterImpl( name = "STONE", candidate = setOf(Material.STONE), amount = 1, anyAmount = false, predicates = defaultMatterPredicates() )- Parameters:
material- A candidate of this matter.- Returns:
CMatterImpl Built matter
-
multi
final static CMatterImpl multi(Material materials)
Returns multi candidate CMatterImpl.
// below 2 matters are same val matter = CMatterImpl.multi(Material.STONE, Material.COBBLESTONE) val matter = CMatterImpl( name = "STONE-COBBLESTONE", candidate = setOf(Material.STONE, Material.COBBLESTONE), amount = 1, anyAmount = false, predicates = null )- Parameters:
materials- Candidate materials- Returns:
CMatterImpl Built matter
-
-
-
-