Class ColorResolverRegistry
java.lang.Object
net.fabricmc.fabric.api.client.rendering.v1.ColorResolverRegistry
The registry for custom
ColorResolver
s. Custom resolvers must be registered during client initialization for
them to be usable in BlockRenderView.getColor(net.minecraft.util.math.BlockPos, net.minecraft.world.biome.ColorResolver)
. Calling this method may throw an exception if the passed
resolver is not registered with this class. Vanilla resolvers found in BiomeColors
are automatically
registered.
Other mods may also require custom resolvers to be registered if they provide additional functionality related to color resolvers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @UnmodifiableView Set
<ColorResolver> Gets a view of all registeredColorResolver
s, including all vanilla resolvers.static @UnmodifiableView Set
<ColorResolver> Gets a view of all registeredColorResolver
s, not including vanilla resolvers.static boolean
isRegistered
(ColorResolver resolver) Checks whether the givenColorResolver
is registered.static void
register
(ColorResolver resolver) Registers a customColorResolver
for use inBlockRenderView.getColor(net.minecraft.util.math.BlockPos, net.minecraft.world.biome.ColorResolver)
.
-
Method Details
-
register
Registers a customColorResolver
for use inBlockRenderView.getColor(net.minecraft.util.math.BlockPos, net.minecraft.world.biome.ColorResolver)
. This method should be called during client initialization.- Parameters:
resolver
- the resolver to register
-
getAllResolvers
Gets a view of all registeredColorResolver
s, including all vanilla resolvers.- Returns:
- a view of all registered resolvers
-
getCustomResolvers
Gets a view of all registeredColorResolver
s, not including vanilla resolvers.- Returns:
- a view of all registered custom resolvers
-
isRegistered
Checks whether the givenColorResolver
is registered. Vanilla resolvers are always registered.- Parameters:
resolver
- the resolver- Returns:
- whether the given resolver is registered
-