mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 19:25:23 -05:00
Fix @SafeVarargs warnings in Resource Conditions and ColorProviderRegistry (#2547)
This commit is contained in:
parent
c6af733cfb
commit
a29562c81b
3 changed files with 5 additions and 0 deletions
|
@ -36,6 +36,7 @@ public interface ColorProviderRegistry<T, Provider> {
|
|||
* @param provider The color provider to register.
|
||||
* @param objects The objects which should be colored using this provider.
|
||||
*/
|
||||
@SuppressWarnings("unchecked") // @SafeVarargs is not allowed on interface methods.
|
||||
void register(Provider provider, T... objects);
|
||||
|
||||
/**
|
||||
|
|
|
@ -90,6 +90,7 @@ public final class DefaultResourceConditions {
|
|||
/**
|
||||
* Create a condition that returns true if each of the passed block tags exists and has at least one element.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static ConditionJsonProvider blockTagsPopulated(TagKey<Block>... tags) {
|
||||
return ResourceConditionsImpl.tagsPopulated(BLOCK_TAGS_POPULATED, tags);
|
||||
}
|
||||
|
@ -97,6 +98,7 @@ public final class DefaultResourceConditions {
|
|||
/**
|
||||
* Create a condition that returns true if each of the passed fluid tags exists and has at least one element.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static ConditionJsonProvider fluidTagsPopulated(TagKey<Fluid>... tags) {
|
||||
return ResourceConditionsImpl.tagsPopulated(FLUID_TAGS_POPULATED, tags);
|
||||
}
|
||||
|
@ -104,6 +106,7 @@ public final class DefaultResourceConditions {
|
|||
/**
|
||||
* Create a condition that returns true if each of the passed item tags exists and has at least one element.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static ConditionJsonProvider itemTagsPopulated(TagKey<Item>... tags) {
|
||||
return ResourceConditionsImpl.tagsPopulated(ITEM_TAGS_POPULATED, tags);
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ public class ResourceConditionsImpl {
|
|||
};
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> ConditionJsonProvider tagsPopulated(Identifier id, TagKey<T>... tags) {
|
||||
Preconditions.checkArgument(tags.length > 0, "Must register at least one tag.");
|
||||
|
||||
|
|
Loading…
Reference in a new issue