Jump to content

sjoopies

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by sjoopies

  1. I added the dependency for the JEI and I got this error when trying to setupDecompWorkspace

     

    This set of MCP mappings was designed for MC 1.8.8. Use at your own peril.

    #################################################

            ForgeGradle 2.1-SNAPSHOT-75bb646       

      https://github.com/MinecraftForge/ForgeGradle 

    #################################################

                  Powered by MCP unknown             

                http://modcoderpack.com           

            by: Searge, ProfMobius, Fesh0r,       

            R4wk, ZeuX, IngisKahn, bspkrs         

    #################################################

     

    FAILURE: Build failed with an exception.

     

    * What went wrong:

    A problem occurred configuring root project '189EclipseCraft'.

    > Could not resolve all dependencies for configuration ':deobfCompile'.

      > Could not resolve mezz.jei:jei_1.8.9:2.28.5.172.

        Required by:

            com.sjoopies.eclipsecraft:189EclipseCraft:1.0

          > Could not resolve mezz.jei:jei_1.8.9:2.28.5.172.

            > Could not get resource 'https://libraries.minecraft.net/mezz/jei/jei_1.8.9/2.28.5.172/jei_1.8.9-2.28.5.172.pom'.

                > Could not GET 'https://libraries.minecraft.net/mezz/jei/jei_1.8.9/2.28.5.172/jei_1.8.9-2.28.5.172.pom'. Received status code 403 from server: Forbidden

     

    * Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

     

    BUILD FAILED

     

    Total time: 11.214 secs

     

     

     

    I also downloaded the mod and put it in the mods folder of my workspace and in the lib folder too

  2. When ever I run my mod my block always looks like a cube instead of its model

    Also this is printed out in the console:

    OBJLoader.Parser: command 's' (model: '[My model location]') is not currently supported, skipping

     

    this is my code for rendering:

     

    package com.sjoopies.eclipsecraft.client.renderer;

     

    import java.io.IOException;

    import java.util.List;

     

    import net.minecraft.client.Minecraft;

    import net.minecraft.client.renderer.Tessellator;

    import net.minecraft.client.renderer.WorldRenderer;

    import net.minecraft.client.renderer.block.model.BakedQuad;

    import net.minecraft.client.renderer.texture.TextureAtlasSprite;

    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

    import net.minecraft.client.resources.model.IBakedModel;

    import net.minecraft.client.resources.model.ModelResourceLocation;

    import net.minecraft.tileentity.TileEntity;

    import net.minecraft.util.EnumFacing;

    import net.minecraft.util.ResourceLocation;

    import net.minecraftforge.client.model.Attributes;

    import net.minecraftforge.client.model.IModel;

    import net.minecraftforge.client.model.ModelLoaderRegistry;

    import net.minecraftforge.client.model.TRSRTransformation;

    import net.minecraftforge.client.model.obj.OBJLoader;

     

    import org.lwjgl.opengl.GL11;

     

    import com.google.common.base.Function;

    import com.sjoopies.eclipsecraft.ref.ECRef;

     

    public class CyrstalRenderer extends TileEntitySpecialRenderer {

     

    public static final ResourceLocation texture = new ResourceLocation(ECRef.MODID + ":" + "textures/blocks/crystal.png");

    private static final ModelResourceLocation loc = new ModelResourceLocation(ECRef.MODID + ":" + "models/block/crystal.obj");

     

    Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {

    public TextureAtlasSprite apply(ResourceLocation location) {

    return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());

    }

    };

    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {

    Tessellator tessellator = Tessellator.getInstance();

    this.bindTexture(texture);

     

    WorldRenderer worldRenderer = tessellator.getWorldRenderer();

    GL11.glPushMatrix();

    GL11.glTranslated(x, y, z);

    // GL11.glRotatef(i++, 0.0f, 0.0f, 1.0f);

    IModel crystalModel = null;

    try {

    crystalModel = OBJLoader.instance.loadModel(loc);

    } catch (IOException e) {

    crystalModel = ModelLoaderRegistry.getMissingModel();

    e.printStackTrace();

    }

    IBakedModel bakedModel = crystalModel.bake((TRSRTransformation.identity()), Attributes.DEFAULT_BAKED_FORMAT, textureGetter);

    worldRenderer.begin(7, Attributes.DEFAULT_BAKED_FORMAT);// StartDrawingQuads

     

    List<BakedQuad> generalQuads = bakedModel.getGeneralQuads();

    System.out.println(generalQuads);

    for (BakedQuad q : generalQuads)

    {

     

    int[] vd = q.getVertexData();

    worldRenderer.addVertexData(vd);

    }

    for (EnumFacing face : EnumFacing.values())

    {

    List<BakedQuad> faceQuads = bakedModel.getFaceQuads(face);

    for (BakedQuad q : faceQuads)

    {

    int[] vd = q.getVertexData();

    worldRenderer.addVertexData(vd);

    }

    }

    tessellator.draw();

    GL11.glPopMatrix();

     

    }

     

    }

     

     

  3. I rendered my block with no errors except my "block" is a cube. I used this method because It allows me to rotate the block using OpenGL

     

    This is my rendering Code:

     

     

    public class CyrstalRenderer extends TileEntitySpecialRenderer {

     

    public static final ResourceLocation texture = new ResourceLocation(ECRef.MODID + ":" + "textures/blocks/crystal.png");

    private static final ModelResourceLocation loc = new ModelResourceLocation(ECRef.MODID + ":" + "models/block/crystal.obj");

     

    Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {

    public TextureAtlasSprite apply(ResourceLocation location) {

    return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());

    }

    };

     

    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {

    Tessellator tessellator = Tessellator.getInstance();

    this.bindTexture(texture);

     

    WorldRenderer worldRenderer = tessellator.getWorldRenderer();

    GL11.glPushMatrix();

    GL11.glTranslated(x, y, z);

    GL11.glRotatef(45, 0.0f, 0.0f, 1.0f);

    IModel crystalModel = null;

    try {

    crystalModel = OBJLoader.instance.loadModel(loc);

    } catch (IOException e) {

    crystalModel = ModelLoaderRegistry.getMissingModel();

    e.printStackTrace();

    }

    IBakedModel bakedModel = crystalModel.bake((TRSRTransformation.identity()), Attributes.DEFAULT_BAKED_FORMAT, textureGetter);

    worldRenderer.begin(7, Attributes.DEFAULT_BAKED_FORMAT);// StartDrawingQuads

     

    List<BakedQuad> generalQuads = bakedModel.getGeneralQuads();

    for (BakedQuad q : generalQuads)

    {

    int[] vd = q.getVertexData();

    worldRenderer.addVertexData(vd);

    }

    for (EnumFacing face : EnumFacing.values())

    {

    List<BakedQuad> faceQuads = bakedModel.getFaceQuads(face);

    for (BakedQuad q : faceQuads)

    {

    int[] vd = q.getVertexData();

    worldRenderer.addVertexData(vd);

    }

    }

    tessellator.draw();

    GL11.glPopMatrix();

     

    }

     

    }

     

     

  4. replace:

    @Override

      public boolean handleRenderType(ItemStack item, ItemRenderType type)

      {

          return true;

      }

     

     

    with:

     

    @Override

      public boolean handleRenderType(ItemStack item, ItemRenderType type)

      {

          return type != ItemRenderType.INVENTORY;

      }

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.