Jump to content

Gurman8r

Members
  • Posts

    12
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Gurman8r's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. When I render one of the models i use for a held item the rotation is wrong while in 1st person. in 3rd person it's in the right place but in 1st person the model is sideways. Sorry if I'm not making sense, it's hard for me to explain. Also, just in case it's relevant, i'm using 1.5.2. Screens http://i.imgur.com/JMHEbp6.png http://i.imgur.com/d2PVRNN.png http://i.imgur.com/SyvgtVK.jpg Here's the code form the render file. package mods.StarTrek.textures.render; import mods.StarTrek.models.ModelPhaser; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; public class RenderPhaser extends Render implements IItemRenderer { protected ModelPhaser launcherModel; public RenderPhaser() { launcherModel = new ModelPhaser(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED: { GL11.glPushMatrix(); GL11.glRotatef(190F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(167F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(16F, 0.0F, 0.0F, 1.0F); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/mods/startrek/textures/models/phaserGun.png")); GL11.glTranslatef(-0.5F, -0.225F, 0.45F); float scale = 1.0F; GL11.glScalef(scale, scale, scale); launcherModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0635F); GL11.glPopMatrix(); } default: break; } } @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { // TODO Auto-generated method stub } } Model File(Just incase) package mods.StarTrek.models; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelPhaser extends ModelBase { //fields ModelRenderer Shape1; ModelRenderer Shape2; ModelRenderer Shape3; ModelRenderer Shape4; ModelRenderer Shape5; ModelRenderer Shape6; public ModelPhaser() { textureWidth = 64; textureHeight = 32; Shape1 = new ModelRenderer(this, 0, 11); Shape1.addBox(0F, 0F, 0F, 1, 1, 2); Shape1.setRotationPoint(0F, 0F, -1F); Shape1.setTextureSize(64, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 0, 15); Shape2.addBox(0F, 0F, 0F, 3, 3, 1); Shape2.setRotationPoint(-1F, -1F, -1F); Shape2.setTextureSize(64, 32); Shape2.mirror = true; setRotation(Shape2, 0F, 0F, 0F); Shape3 = new ModelRenderer(this, 0, 22); Shape3.addBox(0F, 0F, 0F, 3, 4, 5); Shape3.setRotationPoint(-1F, -2F, -6F); Shape3.setTextureSize(64, 32); Shape3.mirror = true; setRotation(Shape3, 0F, 0F, 0F); Shape4 = new ModelRenderer(this, 0, 0); Shape4.addBox(0F, 0F, 0F, 3, 2, ; Shape4.setRotationPoint(-1F, -2F, -12F); Shape4.setTextureSize(64, 32); Shape4.mirror = true; setRotation(Shape4, 0F, 0F, 0F); Shape5 = new ModelRenderer(this, 56, 0); Shape5.addBox(0F, 0F, 0F, 2, 8, 2); Shape5.setRotationPoint(-0.5F, -1F, -6F); Shape5.setTextureSize(64, 32); Shape5.mirror = true; setRotation(Shape5, -0.3839724F, 0F, 0F); Shape6 = new ModelRenderer(this, 27, 10); Shape6.addBox(0F, 0F, 0F, 2, 1, 4); Shape6.setRotationPoint(-0.5F, -2.5F, -6F); Shape6.setTextureSize(64, 32); Shape6.mirror = true; setRotation(Shape6, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Shape1.render(f5); Shape2.render(f5); Shape3.render(f5); Shape4.render(f5); Shape5.render(f5); Shape6.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent) { super.setRotationAngles(f, f1, f2, f3, f4, f5, ent); } }
  2. Nevermind, found it. It was; GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/path/"));
  3. And sorry mister sassy, i searched the forums and couldn't find any. Thanks though, your way worked.
  4. Says the method doesn't exist... what do I do? What should i call to impliment the method?
  5. Ok now I know how to load the textures for exported mods (thanks), but how would I load the texture for the model? Here's the render file.
  6. Hello ,all. So I just started making a new mod after scrapping my old one that i had for 1.4.6 and I noticed that the texture loading is different. I've figured out how to load textures for blocks and items using the unlocalized name etc., but how do I load a texture for an item that I render as a 3D model? Meaning when I have the item in my hand it loads as the 3D model but uses some random texture, as seen here -->http://i.imgur.com/3EWhtPc.png. How do I select the texture || just choose a path? Also, in wuppy29's tutorials he puts the textures directly into minecraft.jar (which is what I've been doing) How would I reference the images when I export my mod? Again, I'm clueless on how to use a simple file path. Will supply my code if needed. Thanks in advance!
  7. Weird, I remember it having to be under 30,000 something. I'll try this out and see if it works.
  8. Hello, so I recently began trying to make a new mod for 1.5 with no success. I made a mod for 1.4.7 which worked fine but after following wuppy's tutorials for 1.5 mods I always get errors and the textures won't load, so here's my code and my errors. Also, how would I get my textures to load? Error Log Mod File Block File Item File Item General Block General What's weird is I have no idea what's going on, usually I'm able to figure this ish out. Thanks in advance!
  9. I tried both of those and my game continues crashing. Here's the entitre tes_BaseMod file because ive looked at coutless tutorials and after following them I still keep crashing. package gurman8r.tescraft.src; //Imports import net.minecraft.block.Block; import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.BlockStairs; import net.minecraft.block.BlockStep; import net.minecraft.block.BlockTorch; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="tesCraft", name="TES Craft", version="0.0.1") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class tes_BaseMod<daedricIngot> { // The instance of your mod that Forge uses. @Instance("tesCraft") public static tes_BaseMod instance; // Says where the client and server 'proxy' code is loaded. @SidedProxy(clientSide="gurman8r.tescraft.client.ClientProxy", serverSide="gurman8r.tescraft.CommonProxy") public static CommonProxy proxy; @PreInit public void preInit(FMLPreInitializationEvent event) { // Stub Method } @Init public void load(FMLInitializationEvent event) { proxy.registerRenderers(); //TES Craft Creative Tab LanguageRegistry.instance().addStringLocalization("itemGroup.tabTesCraft", "en_US", "TES Craft"); /** * Put recipes here: */ GameRegistry.addSmelting(Block.bedrock.blockID, new ItemStack(this.moonstone), 100); GameRegistry.addRecipe(new ItemStack(tes_BaseMod.moonstone, 1), new Object[]{ " X ", " X ", "XXX", 'X', Block.blockClay, 'P', Item.paper }); /** * Put blocks here: */ final Block tesForge = new BlockForge(500, 0, Material.rock).setHardness(3.5F).setResistance(5.0F).setBlockName("tesForge").setCreativeTab(this.tabTesCraft); GameRegistry.registerBlock(tesForge, "tesForge"); LanguageRegistry.addName(tesForge, "Forge"); final Block moonstoneOre = new BlockMoonstoneOre(517, 16, Material.rock).setHardness(5.0F).setResistance(5.0F).setBlockName("moonstoneOre").setCreativeTab(this.tabTesCraft); GameRegistry.registerBlock(moonstoneOre, "moonstoneOre"); LanguageRegistry.addName(moonstoneOre, "Moonstone Ore"); MinecraftForge.setBlockHarvestLevel(moonstoneOre, "pickaxe", 0); final Block malachiteOre = new BlockMalachiteOre(518, 17, Material.rock).setHardness(10.0F).setResistance(5.0F).setBlockName("malachiteOre").setCreativeTab(this.tabTesCraft); GameRegistry.registerBlock(malachiteOre, "malachiteOre"); LanguageRegistry.addName(malachiteOre, "Malachite Ore"); MinecraftForge.setBlockHarvestLevel(malachiteOre, "pickaxe", 0); final Block orichalcumOre = new BlockOrichalcumOre(519, 18, Material.rock).setHardness(15.0F).setResistance(5.0F).setBlockName("orichalcumOre").setCreativeTab(this.tabTesCraft); GameRegistry.registerBlock(orichalcumOre, "orichalcumOre"); LanguageRegistry.addName(orichalcumOre, "Orichalcum Ore"); MinecraftForge.setBlockHarvestLevel(orichalcumOre, "pickaxe", 0); final Block ebonyOre = new BlockEbonyOre(520, 19, Material.rock).setHardness(40.0F).setResistance(15.0F).setBlockName("ebonyOre").setCreativeTab(this.tabTesCraft); GameRegistry.registerBlock(ebonyOre, "ebonyOre"); LanguageRegistry.addName(ebonyOre, "Ebony Ore"); MinecraftForge.setBlockHarvestLevel(ebonyOre, "pickaxe", 0); /** * Put items here: */ steelIngot = new ItemSteelIngot(4000, 0).setItemName("steel ingot").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(steelIngot, "Steel Ingot"); moonstone = new ItemMoonstone(4001, 1).setItemName("moonstone").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(moonstone, "Moonstone"); malachite = new ItemMalachite(4002, 2).setItemName("malachite").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(malachite, "Malachite"); dwarvenMetal = new ItemDwarvenMetal(4003, 3).setItemName("dwarvenMetal").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(dwarvenMetal, "Dwarven Scrap Metal"); corundumIngot = new ItemCorundumIngot(4004, 4).setItemName("corundumIngot").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(corundumIngot, "Dwarven Metal Ingot"); orichalcumIngot = new ItemOrichalcum(4005, 5).setItemName("orichalcumingot").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(orichalcumIngot, "Orichalcum Ingot"); ebonyIngot = new ItemEbonyIngot(4006, 6).setItemName("ebonyingot").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(ebonyIngot, "Ebony Ingot"); daedricIngot = new ItemDaedricIngot(4007, 7).setItemName("daedric ingot").setCreativeTab(this.tabTesCraft); LanguageRegistry.addName(daedricIngot, "Daedric Ingot"); } @PostInit public void postInit(FMLPostInitializationEvent event) { // Stub Method } public static Item steelSword; public static Item elvenSword; public static Item glassSword; public static Item dwarvenSword; public static Item orcishSword; public static Item ebonySword; public static Item daedricSword; static EnumToolMaterial tesSteel = net.minecraftforge.common.EnumHelper.addToolMaterial("Steel", 2, 350, 6F, 4, 14); public static CreativeTabs tabTesCraft = new TabTesCraft("tabTesCraft"); public static Item steelIngot; public static Item moonstone; public static Item corundumIngot; public static Item malachite; public static Item dwarvenMetal; public static Item orichalcumIngot; public static Item ebonyIngot; public static Item daedricIngot; }
  10. So I just started using forge to make mods (I use to just use ModLoder) but I've come across an issue. If I want to add smelting or crafting recipes using my custom items/blocks it crashes my game. Here's some examples of recipes I've tried adding. GameRegistry.addSmelting(Block.bedrock.blockID, new ItemStack(tes_BaseMod.moonstone), 100); GameRegistry.addRecipe(new ItemStack(tes_BaseMod.moonstone, 1), new Object[]{ " X ", " X ", "XXX", Character.valueOf('X'), Block.blockClay, Character.valueOf('P'), Item.paper }); - - My main mod class is tes_BaseMod. - Bedrock is there just as an example. - If I replace tes_BaseMod.moonstone with a vanilla block/item it works. - What would I add into both highlighted area to make them work with custom blocks/items??? -
×
×
  • Create New...

Important Information

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