Package alexiil.mc.lib.attributes
Class AttributeList<T>
java.lang.Object
alexiil.mc.lib.attributes.AbstractAttributeList<T>
alexiil.mc.lib.attributes.AttributeList<T>
Search result for block attributes.
- 
Field SummaryFieldsFields inherited from class alexiil.mc.lib.attributes.AbstractAttributeListattribute, list
- 
Method SummaryModifier and TypeMethodDescriptionvoidDirectly adds the given object to this list.voidDirectly adds the given object to this list.voidDirectly adds the given object to this list.voidDirectly adds the given object to this list.combine(AttributeList<T> after, CombinableAttribute<T> combinable)booleangetCacheInfo(int index)intnet.minecraft.util.math.Directionnet.minecraft.util.math.Directionnet.minecraft.util.shape.VoxelShapegetVoxelShape(int index)booleanvoidobstruct(net.minecraft.util.shape.VoxelShape shape)Adds an obstruction to the current search.voidOffers the given object to this list.voidOffers the given object to this list.voidOffers the given object to this list.voidOffers the given object to this list.Methods inherited from class alexiil.mc.lib.attributes.AbstractAttributeListassertAdding, assertUsing, combine, get, getCount, getFirst, getFirstOrNull
- 
Field Details- 
searchParam
 
- 
- 
Method Details- 
getSearchDirection@Nullable public net.minecraft.util.math.Direction getSearchDirection()- Returns:
- The Directionthat the search is moving in, or null if thesearchParamdoesn't supply one.
 
- 
getTargetSide@Nullable public net.minecraft.util.math.Direction getTargetSide()- Returns:
- The side of the target block that the search is approaching. If the search option is directional then
         this will be oppositeofgetSearchDirection(), otherwise this will be null.
 
- 
addDirectly adds the given object to this list.- Parameters:
- object- The object to add.
 
- 
addDirectly adds the given object to this list.- Parameters:
- object- The object to add.
- cacheInfo- The caching information associated with the given object. (As caching hasn't been implemented yet this can always be null).
 
- 
addDirectly adds the given object to this list.- Parameters:
- object- The object to add.
- shape- The shape of the given object. If null (or empty) then this will default to the shape of the block that is being checked.
 
- 
addpublic void add(T object, @Nullable CacheInfo cacheInfo, @Nullable net.minecraft.util.shape.VoxelShape shape)Directly adds the given object to this list.- Parameters:
- object- The object to add.
- cacheInfo- The caching information associated with the given object. (As caching hasn't been implemented yet this can always be null).
- shape- The shape of the given object. If null (or empty) then this will default to the shape of the block that is being checked.
 
- 
offerOffers the given object to this list. If the given object is not an instance of the currentAbstractAttributeList.attribute(and it cannot beconvertedinto it) then this will not affect this list.- Parameters:
- object- The object to offer, which may implement- Convertibleif it can be converted into many different forms.
 
- 
offerOffers the given object to this list. If the given object is not an instance of the currentAbstractAttributeList.attribute(and it cannot beconvertedinto it) then this will not affect this list.- Parameters:
- object- The object to offer, which may implement- Convertibleif it can be converted into many different forms.
- cacheInfo- The caching information associated with the given object. (As caching hasn't been implemented yet this can always be null).
 
- 
offerOffers the given object to this list. If the given object is not an instance of the currentAbstractAttributeList.attribute(and it cannot beconvertedinto it) then this will not affect this list.- Parameters:
- object- The object to offer, which may implement- Convertibleif it can be converted into many different forms.
- shape- The shape of the given object. If null (or empty) then this will default to the shape of the block that is being checked.
 
- 
offerpublic void offer(Object object, @Nullable CacheInfo cacheInfo, @Nullable net.minecraft.util.shape.VoxelShape shape)Offers the given object to this list. If the given object is not an instance of the currentAbstractAttributeList.attribute(and it cannot beconvertedinto it) then this will not affect this list.- Parameters:
- object- The object to offer, which may implement- Convertibleif it can be converted into many different forms.
- cacheInfo- The caching information associated with the given object. (As caching hasn't been implemented yet this can always be null).
- shape- The shape of the given object. If null (or empty) then this will default to the shape of the block that is being checked.
 
- 
obstructpublic void obstruct(net.minecraft.util.shape.VoxelShape shape)Adds an obstruction to the current search. For example a buildcraft pipe plug would add a smallVoxelShapeto prevent the neighbouring pipe connecting through it.This only has an effect on the current search if getSearchDirection()returns a non-null value. (as otherwise it won't obstruct anything).
- 
getCacheInfo
- 
getVoxelShape@Nullable public net.minecraft.util.shape.VoxelShape getVoxelShape(int index)
- 
doesSearchReachEndpublic boolean doesSearchReachEnd()- Returns:
- True if the obstructionscompletely block the search shape at the end of the search.
- Throws:
- IllegalStateException- if- getSearchDirection()is null.
 
- 
hasOfferedAnypublic boolean hasOfferedAny()- Returns:
- True if getOfferedCount()is greater than 0.
 
- 
getOfferedCountpublic int getOfferedCount()- Returns:
- The number of calls to add(Object, CacheInfo, VoxelShape)(including calls toadd(Object)and it's variants). Note that this doesn't count calls tooffer(Object)(and it's variants) that don't add any attributes.
 
- 
combine- Returns:
- A combined version of this list and then the second given list, or the attribute's default value if both lists are empty.
 
 
-