Package fr.andross.banitem.items.meta
Class MetaTypeComparator
java.lang.Object
fr.andross.banitem.items.meta.MetaTypeComparator
- Direct Known Subclasses:
AdvancedEnchantments
,AttributeContains
,DisplayNameContains
,DisplayNameEquals
,DisplayNameEqualsRegex
,Durability
,EnchantmentContains
,EnchantmentEquals
,ItemsAdder
,LoreContains
,LoreContainsRegex
,LoreEquals
,LoreLineContains
,ModeldataEquals
,NBTAPI
,Potion
,Unbreakable
An abstract meta type comparator.
- Version:
- 3.1
- Author:
- Andross
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetaTypeComparator
(Object configurationProperties, Debug debug) Represents a meta type which can be used to be compared with an item. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isValid()
If the instantiation and the load of the configured properties has been successfully.abstract boolean
matches
(@NotNull BannedItem bannedItem) Check if the meta type configured matches on the item involved.void
setValid
(boolean valid) Change the state of validation of this meta type comparator.
-
Field Details
-
configurationProperties
-
-
Constructor Details
-
MetaTypeComparator
Represents a meta type which can be used to be compared with an item. Implementer will handle the propertiesConfiguration representing the properties.- Parameters:
configurationProperties
- the property configuration useddebug
- the debug object
-
-
Method Details
-
isValid
public boolean isValid()If the instantiation and the load of the configured properties has been successfully.- Returns:
- true if the properties has correctly been loaded, otherwise false
-
setValid
public void setValid(boolean valid) Change the state of validation of this meta type comparator. If false, the meta type implementation will not be used into the custom item system, to check if an item matches.- Parameters:
valid
- if the meta type is correctly loaded
-
matches
Check if the meta type configured matches on the item involved.- Parameters:
bannedItem
- the current item involved- Returns:
- true if the meta is present on the item, otherwise false
-