Package alexiil.mc.lib.attributes
Class CompatLeveledMap<Instance,Cls,V>
java.lang.Object
alexiil.mc.lib.attributes.CompatLeveledMap<Instance,Cls,V>
- Type Parameters:
Instance
- The object to map directly against with equals - for example this might beBlock
, orItem
, orBlockEntityType
, orEntityType
.Cls
- The class to map directly or hierarchically against - for example this might beBlock
, orItem
, orBlockEntity
, orEntity
.
Used primarily by
Attribute
to manage the custom adder list, and FluidContainerRegistry
to manage
filters for fluids.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionint
static final int
int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPredicateBased
(AttributeSourceType type, boolean specific, Predicate<? super Instance> predicate, V value) void
putClassBased
(AttributeSourceType type, Class<?> clazz, boolean matchSubclasses, V value) void
putExact
(AttributeSourceType type, Instance key, V value)
-
Field Details
-
NULL_PRIORITY
public static final int NULL_PRIORITY- See Also:
-
baseOffset
public int baseOffset -
priorityMultiplier
public int priorityMultiplier
-
-
Constructor Details
-
CompatLeveledMap
public CompatLeveledMap(String name, Class<Cls> usedClass, V nullValue, Function<Instance, String> toStringFunc) - Parameters:
nullValue
- A non-null value to use to indicate that this doesn't contain any entries for the given key. Note that this value will not be returned unless it is added to this map separately with any of the "put" methods.
-
-
Method Details
-
get
-
getEntry
-
putExact
-
addPredicateBased
public void addPredicateBased(AttributeSourceType type, boolean specific, Predicate<? super Instance> predicate, V value) -
putClassBased
public void putClassBased(AttributeSourceType type, Class<?> clazz, boolean matchSubclasses, V value)
-