Posted December 7, 201410 yr I am trying to render 2 different entitys however I keep getting the same texture on both entitys. Here is the Client Proxy Class: package com.mineturnedmod.mineturned; import net.minecraft.client.renderer.entity.RenderSnowball; import cpw.mods.fml.client.registry.RenderingRegistry;public class ArrowClient extends ArrowCommon { @Override public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(EntityRpg.class, new RenderSnowball(Mineturnedmain.RpgAmmo)); RenderingRegistry.registerEntityRenderingHandler(EntityExplosiveArrow.class, new RenderSnowball(Mineturnedmain.EAT)); } @Override public void registerSounds() {} } Here is the the main class: package com.mineturnedmod.mineturned; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = Mineturnedmain.MODID, name = Mineturnedmain.NAME, version = Mineturnedmain.VERSION) public class Mineturnedmain { @SidedProxy(clientSide = "com.mineturnedmod.mineturned.ArrowClient", serverSide = "com.mineturnedmod.mineturned.proxies.ArrowCommon") public static ArrowCommon proxy; public static final String MODID = "realisticcrafting"; public static final String NAME = "More Crafting"; public static final String VERSION = "1.0"; public static CreativeTabs MoreCraftingTab = new CreativeTabs("MoreCraftingTab"){ public Item getTabIconItem(){ return Rpg; } }; //Blocks public static Block BlockOfTin = new BlockOfTinClass(3000, Material.iron).setBlockName("BlockOfTin") .setBlockTextureName(Mineturnedmain.MODID + ":BlockOfTin"); public static Block BlockOfCopper = new BlockOfCopperClass(3000, Material.iron).setBlockName("BlockOfCopper") .setBlockTextureName(Mineturnedmain.MODID + ":BlockOfCopper"); public static Block TinOre = new TinOreClass(3001, Material.rock).setBlockName("TinOre"); public static Block CopperOre = new CopperOreClass(3001, Material.rock).setBlockName("CopperOre"); //Items public static Item TinIngot = new TinIngotClass(3002).setUnlocalizedName("TinIngot"); public static Item Spear = new SpearClass().setUnlocalizedName("Spear").setCreativeTab(MoreCraftingTab); public static Item PocketKnife = new PocketKnifeClass(3004, Item.ToolMaterial.IRON).setUnlocalizedName("PocketKnife").setCreativeTab(MoreCraftingTab); public static Item CopperIngot = new CopperIngotClass(3003).setUnlocalizedName("CopperIngot"); public static Item sledgehammer = new sledgehammerClass(3005, Item.ToolMaterial.EMERALD).setUnlocalizedName("sledgehammer").setCreativeTab(MoreCraftingTab); public static Item Rpg = new RpgClass().setUnlocalizedName("Rpg").setCreativeTab(MoreCraftingTab); public static Item EAT = new EATClass(3009).setUnlocalizedName("EAT"); public static Item GreenBow = new GreenBowClass().setUnlocalizedName("GreenBow").setCreativeTab(MoreCraftingTab); public static Item GreenBow2 = new GreenBow2Class().setUnlocalizedName("GreenBow2").setCreativeTab(MoreCraftingTab); public static Item RpgAmmo = new RpgAmmoClass(3006).setUnlocalizedName("RpgAmmo").setCreativeTab(MoreCraftingTab); public static Item Mirakuru = new MirakuruClass(4, 0.75f, false).setUnlocalizedName("Mirakuru").setCreativeTab(MoreCraftingTab).setMaxStackSize(1); public static Item Cure = new CureClass().setUnlocalizedName("Cure").setCreativeTab(MoreCraftingTab).setMaxStackSize(1); public Mineturnedmain(){ GameRegistry.registerBlock(BlockOfTin,"BlockOfTin"); GameRegistry.registerBlock(TinOre, "TinOre"); GameRegistry.registerBlock(CopperOre, "CopperOre"); GameRegistry.registerItem(TinIngot, "TinIngot"); GameRegistry.registerItem(CopperIngot, "CopperIngot"); GameRegistry.registerItem(Rpg, "Rpg"); GameRegistry.registerItem(Cure, "Cure"); GameRegistry.registerItem(EAT, "EAT"); GameRegistry.registerItem(Mirakuru, "Mirakuru"); GameRegistry.registerItem(RpgAmmo, "RpgAmmo"); GameRegistry.registerItem(GreenBow, "GreenBow"); GameRegistry.registerItem(GreenBow2, "GreenBow2"); GameRegistry.registerBlock(BlockOfCopper,"BlockOfCopper"); //Crafting and Smelting GameRegistry.addSmelting(Mineturnedmain.TinOre, new ItemStack(Mineturnedmain.TinIngot), 0.5f); GameRegistry.addSmelting(Mineturnedmain.CopperOre, new ItemStack(Mineturnedmain.CopperIngot), 0.5f); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.BlockOfCopper), new Object[]{"xxx","xxx","xxx",'x', Mineturnedmain.CopperIngot}); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.BlockOfTin), new Object[]{"xxx","xxx","xxx",'x', Mineturnedmain.TinIngot}); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.CopperIngot, 9), new Object[]{"x",'x', Mineturnedmain.BlockOfCopper}); GameRegistry.addShapedRecipe(new ItemStack(Mineturnedmain.TinIngot, 9), new Object[]{"x",'x', Mineturnedmain.BlockOfTin}); } @EventHandler public void preinit(FMLPreInitializationEvent event){ GameRegistry.registerWorldGenerator(new WorldGeneratorAvatar(), 1); } @EventHandler public void init(FMLInitializationEvent event){ EntityRegistry.registerModEntity(EntityRpg.class, "Rpg", 4, this, 80, 3, true); EntityRegistry.registerModEntity(EntityExplosiveArrow.class, "EAT", 4, this, 80, 3, true); proxy.registerRenderThings(); proxy.registerSounds(); } }
December 7, 201410 yr Show your Mineturnedmain class. Maybe the problem would be related with your Item. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
December 8, 201410 yr Diesieben, could you expand what you said, I at least claim to not to be a java novice and am not sure what you meant. Also, if I am understanding your lack of spelling, you really should not be insulting diesieben's attempt to help. He knows more about forge modding than anyone except maybe for people like Lex himself! Let's all just try to figure out what the problem is, ok? Could you give us all the related classes (entities, etc...) as well as a log in case it says anything? I'm not seeing anywhere that you register a texture for the snowball renderer. How does that work exactly? Correct me if I'm wrong, but it seems like you are registering an entity renderer for an item. Finally, your indenting and class definition next to an import make it hard to read and understand, could you clean it up? Note, I'm not at a workspace so I apologize for any stupid mistakes I made .
December 8, 201410 yr *cracks hands* Well, let's see what's wrong, shall we? 1. You're registering your items in YOUR CONSTRUCTOR! 2. You need to be constructing your items in the pre-init. 3. You need to register your items in the pre-init. Well, that might not fix your issue, but that would be correct by a mod stand-point. -Mitchellbrine Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible. It may be freaking fucking hard though, but still possible If you create a topic on Modder Support, live by this motto: I don't want your charity, I want your information
December 8, 201410 yr Author No I am still getting the same errors. But I will post my code for both of the entitys. EntityRpg: package com.mineturnedmod.mineturned; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityRpg extends EntityThrowable { private double explosionRadius = 3.0F; /** * @param par1World where the entity will spawn */ public EntityRpg(World par1World) { super(par1World); } /** * @param par1World * @param arg1Double * @param arg2Double * @param arg3Double */ public EntityRpg(World par1World, double arg1Double, double arg2Double, double arg3Double) { super(par1World, arg1Double, arg2Double, arg3Double); } /** * @param par1World * @param arg1EntityLivingBase */ public EntityRpg(World par1World, EntityLivingBase arg1EntityLivingBase) { super(par1World, arg1EntityLivingBase); } @Override protected float getGravityVelocity() { return 0; } /** * @see net.minecraft.entity.projectile.EntityThrowable#onImpact(net.minecraft.util.MovingObjectPosition) */ @Override protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true); this.setDead(); } } EntityExplosiveArrow: package com.mineturnedmod.mineturned; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityExplosiveArrow extends EntityThrowable { private double explosionRadius = 3.0F; /** * @param par1World where the entity will spawn */ public EntityExplosiveArrow(World par1World) { super(par1World); } /** * @param par1World * @param arg1Double * @param arg2Double * @param arg3Double */ public EntityExplosiveArrow(World par1World, double arg1Double, double arg2Double, double arg3Double) { super(par1World, arg1Double, arg2Double, arg3Double); } /** * @param par1World * @param arg1EntityLivingBase */ public EntityExplosiveArrow(World par1World, EntityLivingBase arg1EntityLivingBase) { super(par1World, arg1EntityLivingBase); } /** * @see net.minecraft.entity.projectile.EntityThrowable#onImpact(net.minecraft.util.MovingObjectPosition) */ @Override protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true); this.setDead(); } }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.