Class ConnectingModelType
java.lang.Object
com.supermartijn642.fusion.model.types.connecting.ConnectingModelType
- All Implemented Interfaces:
ModelType<Pair<net.minecraft.client.renderer.block.model.BlockModel,,List<ConnectionPredicate>>> Serializer<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>>
public class ConnectingModelType
extends Object
implements ModelType<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>>
Created 27/04/2023 by SuperMartijn642
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.resources.model.BakedModelbake(ModelBakingContext context, Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Converts the model data into a baked model.Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>> deserialize(com.google.gson.JsonObject json) Deserializes the given json to some data.@Nullable net.minecraft.client.renderer.block.model.BlockModelgetAsVanillaModel(Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Represents the model as a vanillaBlockModelinstance.Collection<net.minecraft.resources.ResourceLocation>getModelDependencies(Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Gets all the dependencies on other model files.getTextureDependencies(GatherTexturesContext context, Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Gets all the dependencies on sprites.com.google.gson.JsonObjectserialize(Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> value) Serializes the given data to json.
-
Constructor Details
-
ConnectingModelType
public ConnectingModelType()
-
-
Method Details
-
getModelDependencies
public Collection<net.minecraft.resources.ResourceLocation> getModelDependencies(Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Description copied from interface:ModelTypeGets all the dependencies on other model files.- Specified by:
getModelDependenciesin interfaceModelType<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>> - Parameters:
data- custom model data
-
getTextureDependencies
public Collection<SpriteIdentifier> getTextureDependencies(GatherTexturesContext context, Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Description copied from interface:ModelTypeGets all the dependencies on sprites.- Specified by:
getTextureDependenciesin interfaceModelType<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>> - Parameters:
context- context for gathering texture dependenciesdata- custom model data- See Also:
-
getAsVanillaModel
@Nullable public @Nullable net.minecraft.client.renderer.block.model.BlockModel getAsVanillaModel(Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Description copied from interface:ModelTypeRepresents the model as a vanillaBlockModelinstance. May be used gather info from other models, such as with the vanilla 'parent' property. If the model cannot be represented as aBlockModelinstance, this method should returnnull.- Specified by:
getAsVanillaModelin interfaceModelType<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>> - Parameters:
data- custom model data- Returns:
- a representation of the model as a vanilla
BlockModelinstance, ornullif such a representation is not available
-
bake
public net.minecraft.client.resources.model.BakedModel bake(ModelBakingContext context, Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> data) Description copied from interface:ModelTypeConverts the model data into a baked model.- Specified by:
bakein interfaceModelType<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>> - Parameters:
context- context for baking the modeldata- custom model data- Returns:
- a baked model
- See Also:
-
deserialize
public Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>> deserialize(com.google.gson.JsonObject json) throws com.google.gson.JsonParseException Description copied from interface:SerializerDeserializes the given json to some data.- Specified by:
deserializein interfaceSerializer<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>> - Throws:
com.google.gson.JsonParseException- if the given json does not match the expected format
-
serialize
public com.google.gson.JsonObject serialize(Pair<net.minecraft.client.renderer.block.model.BlockModel, List<ConnectionPredicate>> value) Description copied from interface:SerializerSerializes the given data to json.- Specified by:
serializein interfaceSerializer<Pair<net.minecraft.client.renderer.block.model.BlockModel,List<ConnectionPredicate>>>
-