Search in sources :

Example 1 with IModelState

use of net.minecraftforge.client.model.IModelState in project Galacticraft by micdoodle8.

the class ClientUtil method modelFromOBJ.

public static IBakedModel modelFromOBJ(ResourceLocation loc, List<String> visibleGroups, IModelState parentState) throws IOException {
    IModel model = OBJLoaderGC.instance.loadModel(loc);
    Function<ResourceLocation, TextureAtlasSprite> spriteFunction = location -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
    return model.bake(new OBJModel.OBJState(visibleGroups, false, parentState), DefaultVertexFormats.ITEM, spriteFunction);
}
Also used : EnumSimplePacket(micdoodle8.mods.galacticraft.core.network.PacketSimple.EnumSimplePacket) ModelBakeEvent(net.minecraftforge.client.event.ModelBakeEvent) OBJModel(net.minecraftforge.client.model.obj.OBJModel) IFlexibleBakedModel(net.minecraftforge.client.model.IFlexibleBakedModel) Item(net.minecraft.item.Item) GameRegistry(net.minecraftforge.fml.common.registry.GameRegistry) SpaceRaceManager(micdoodle8.mods.galacticraft.core.dimension.SpaceRaceManager) DefaultVertexFormats(net.minecraft.client.renderer.vertex.DefaultVertexFormats) FlagData(micdoodle8.mods.galacticraft.core.wrappers.FlagData) ImmutableList(com.google.common.collect.ImmutableList) Block(net.minecraft.block.Block) Minecraft(net.minecraft.client.Minecraft) Side(net.minecraftforge.fml.relauncher.Side) Sys(org.lwjgl.Sys) WorldRenderer(net.minecraft.client.renderer.WorldRenderer) GL11(org.lwjgl.opengl.GL11) SpaceRace(micdoodle8.mods.galacticraft.core.dimension.SpaceRace) ModelTransformWrapper(micdoodle8.mods.galacticraft.core.wrappers.ModelTransformWrapper) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) Function(com.google.common.base.Function) OBJLoaderGC(micdoodle8.mods.galacticraft.core.client.model.OBJLoaderGC) ModelBakery(net.minecraft.client.resources.model.ModelBakery) ScaledResolution(net.minecraft.client.gui.ScaledResolution) IBakedModel(net.minecraft.client.resources.model.IBakedModel) IOException(java.io.IOException) BakedQuad(net.minecraft.client.renderer.block.model.BakedQuad) ModelResourceLocation(net.minecraft.client.resources.model.ModelResourceLocation) IModel(net.minecraftforge.client.model.IModel) ClientProxyCore(micdoodle8.mods.galacticraft.core.proxy.ClientProxyCore) PacketSimple(micdoodle8.mods.galacticraft.core.network.PacketSimple) GalacticraftCore(micdoodle8.mods.galacticraft.core.GalacticraftCore) List(java.util.List) Tessellator(net.minecraft.client.renderer.Tessellator) FMLClientHandler(net.minecraftforge.fml.client.FMLClientHandler) Vector3(micdoodle8.mods.galacticraft.api.vector.Vector3) ResourceLocation(net.minecraft.util.ResourceLocation) IModelState(net.minecraftforge.client.model.IModelState) TRSRTransformation(net.minecraftforge.client.model.TRSRTransformation) IModel(net.minecraftforge.client.model.IModel) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) ModelResourceLocation(net.minecraft.client.resources.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) OBJModel(net.minecraftforge.client.model.obj.OBJModel)

Aggregations

Function (com.google.common.base.Function)1 ImmutableList (com.google.common.collect.ImmutableList)1 IOException (java.io.IOException)1 List (java.util.List)1 Vector3 (micdoodle8.mods.galacticraft.api.vector.Vector3)1 GalacticraftCore (micdoodle8.mods.galacticraft.core.GalacticraftCore)1 OBJLoaderGC (micdoodle8.mods.galacticraft.core.client.model.OBJLoaderGC)1 SpaceRace (micdoodle8.mods.galacticraft.core.dimension.SpaceRace)1 SpaceRaceManager (micdoodle8.mods.galacticraft.core.dimension.SpaceRaceManager)1 PacketSimple (micdoodle8.mods.galacticraft.core.network.PacketSimple)1 EnumSimplePacket (micdoodle8.mods.galacticraft.core.network.PacketSimple.EnumSimplePacket)1 ClientProxyCore (micdoodle8.mods.galacticraft.core.proxy.ClientProxyCore)1 FlagData (micdoodle8.mods.galacticraft.core.wrappers.FlagData)1 ModelTransformWrapper (micdoodle8.mods.galacticraft.core.wrappers.ModelTransformWrapper)1 Block (net.minecraft.block.Block)1 Minecraft (net.minecraft.client.Minecraft)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 Tessellator (net.minecraft.client.renderer.Tessellator)1 WorldRenderer (net.minecraft.client.renderer.WorldRenderer)1 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)1