Jump to content

[1.7.10] Render Entity Issues


gallifrey2000

Recommended Posts

Help with rendering. Help? Here are the files.

 

Goblin Model:

package com.gallifrey2000.overpoweredmod.entity.models;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;

public class goblinModel extends ModelBase
{
  //fields
    ModelRenderer horn1;
    ModelRenderer Shape1;
    ModelRenderer head;
    ModelRenderer body;
    ModelRenderer rightarm;
    ModelRenderer leftarm;
    ModelRenderer rightleg;
    ModelRenderer leftleg;
  
  public goblinModel()
  {
    textureWidth = 64;
    textureHeight = 64;
    
      horn1 = new ModelRenderer(this, 0, 0);
      horn1.addBox(0F, 0F, 0F, 1, 4, 1);
      horn1.setRotationPoint(4F, -11F, 0F);
      horn1.setTextureSize(64, 32);
      horn1.mirror = true;
      setRotation(horn1, 0F, 0F, 0F);
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(0F, 0F, 0F, 1, 4, 1);
      Shape1.setRotationPoint(-5F, -11F, 0F);
      Shape1.setTextureSize(64, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      head = new ModelRenderer(this, 0, 0);
      head.addBox(-4F, -8F, -4F, 8, 8, ;
      head.setRotationPoint(0F, 0F, 0F);
      head.setTextureSize(64, 32);
      head.mirror = true;
      setRotation(head, 0F, 0F, 0F);
      body = new ModelRenderer(this, 16, 16);
      body.addBox(-4F, 0F, -2F, 8, 12, 4);
      body.setRotationPoint(0F, 0F, 0F);
      body.setTextureSize(64, 32);
      body.mirror = true;
      setRotation(body, 0F, 0F, 0F);
      rightarm = new ModelRenderer(this, 40, 16);
      rightarm.addBox(-3F, -2F, -2F, 4, 12, 4);
      rightarm.setRotationPoint(-5F, 2F, 0F);
      rightarm.setTextureSize(64, 32);
      rightarm.mirror = true;
      setRotation(rightarm, 0F, 0F, 0F);
      leftarm = new ModelRenderer(this, 40, 16);
      leftarm.addBox(-1F, -2F, -2F, 4, 12, 4);
      leftarm.setRotationPoint(5F, 2F, 0F);
      leftarm.setTextureSize(64, 32);
      leftarm.mirror = true;
      setRotation(leftarm, 0F, 0F, 0F);
      rightleg = new ModelRenderer(this, 0, 16);
      rightleg.addBox(-2F, 0F, -2F, 4, 12, 4);
      rightleg.setRotationPoint(-2F, 12F, 0F);
      rightleg.setTextureSize(64, 32);
      rightleg.mirror = true;
      setRotation(rightleg, 0F, 0F, 0F);
      leftleg = new ModelRenderer(this, 0, 16);
      leftleg.addBox(-2F, 0F, -2F, 4, 12, 4);
      leftleg.setRotationPoint(2F, 12F, 0F);
      leftleg.setTextureSize(64, 32);
      leftleg.mirror = true;
      setRotation(leftleg, 0F, 0F, 0F);
  }
  
  public void render(net.minecraft.entity.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);
    horn1.render(f5);
    Shape1.render(f5);
    head.render(f5);
    body.render(f5);
    rightarm.render(f5);
    leftarm.render(f5);
    rightleg.render(f5);
    leftleg.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 entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    this.head.rotateAngleY = f3 / (180F / (float)Math.PI);
    this.head.rotateAngleX = f4 / (180F / (float)Math.PI);
    this.rightarm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 2.0F * f1 * 0.5F;
    this.leftarm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
    this.rightarm.rotateAngleZ = 0.0F;
    this.leftarm.rotateAngleZ = 0.0F;
    this.rightleg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
    this.leftleg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;
    this.rightleg.rotateAngleY = 0.0F;
    this.leftleg.rotateAngleY = 0.0F;
  }

}

 

Client Proxy:

package com.gallifrey2000.overpoweredmod;

import net.minecraft.client.renderer.entity.Render;

import com.gallifrey2000.overpoweredmod.entity.goblinMob;
import com.gallifrey2000.overpoweredmod.entity.models.goblinModel;
import com.gallifrey2000.overpoweredmod.rendering.renderGoblin;

import cpw.mods.fml.client.registry.RenderingRegistry;

public class ClientProxy extends ServerProxy{

public void registerRenderThing(){
RenderingRegistry.registerEntityRenderingHandler(goblinMob.class, new renderGoblin(new goblinModel(), 0));

}

}

 

and finally goblin render file:

package com.gallifrey2000.overpoweredmod.rendering;

import com.gallifrey2000.overpoweredmod.MainFile;
import com.gallifrey2000.overpoweredmod.entity.goblinMob;
import com.gallifrey2000.overpoweredmod.entity.models.goblinModel;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;

public class renderGoblin extends RenderLiving {

public static final ResourceLocation texture = new ResourceLocation(MainFile.MODID + ":" + "textures/entity/Goblin.png");

protected goblinModel modelEntity;

public renderGoblin(ModelBase modelBase, float par1) {
	super(modelBase, par1);

	modelEntity = ((goblinModel) mainModel);

}

public void RenderGoblin(goblinMob entity, double x, double y, double z, float u, float v) {
	super.doRender(entity,  x,  y,  z,  u,  v);

}

public void doRenderLiving(EntityLiving entityLiving, double x, double y, double z, float u, float v) {
	RenderGoblin((goblinMob)entityLiving, x, y, z, u, v);

}

public void doRender(Entity entity, double x, double y, double z, float u, float v) {
	RenderGoblin((goblinMob)entity, x, y, z, u, v);

}

@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
	return texture;
}

}

 

here is the crash report.

---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 9/6/14 4:01 PM
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException
at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:492)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:492)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:532)
at net.minecraft.client.Minecraft.run(Minecraft.java:941)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)
Caused by: cpw.mods.fml.common.LoaderException
at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:69)
... 40 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 922765584 bytes (880 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed
Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed
overpoweredmod{Alpha v1.1.0} [§4Over §5Powered §6Mod] (bin) Unloaded->Errored

 

PLEASE HELP MUCH thanks.

 

Btw I am talking like a 4 year old cuz im so tired. been working on this for a long time now.

Link to comment
Share on other sites

ok. Here ya go.

 

package com.gallifrey2000.overpoweredmod;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;

import com.gallifrey2000.overpoweredmod.blocks.darkOreBlock;
import com.gallifrey2000.overpoweredmod.blocks.superBlock;
import com.gallifrey2000.overpoweredmod.blocks.zedOreBlock;
import com.gallifrey2000.overpoweredmod.entity.goblinMob;
import com.gallifrey2000.overpoweredmod.entity.mobBase;
import com.gallifrey2000.overpoweredmod.generation.zedGenClass;
import com.gallifrey2000.overpoweredmod.items.cactusJuice;
import com.gallifrey2000.overpoweredmod.items.corruptedZed;
import com.gallifrey2000.overpoweredmod.items.darkShard;
import com.gallifrey2000.overpoweredmod.items.jellyBeanGreen;
import com.gallifrey2000.overpoweredmod.items.jellyBeanPurple;
import com.gallifrey2000.overpoweredmod.items.jellyBeanRed;
import com.gallifrey2000.overpoweredmod.items.jellyBeanYellow;
import com.gallifrey2000.overpoweredmod.items.mudItem;
import com.gallifrey2000.overpoweredmod.items.mudPie;
import com.gallifrey2000.overpoweredmod.items.pieTin;
import com.gallifrey2000.overpoweredmod.items.pureZed;
import com.gallifrey2000.overpoweredmod.items.smashedCactus;
import com.gallifrey2000.overpoweredmod.tabs.OpModTab;
import com.gallifrey2000.overpoweredmod.tabs.OpTabTools;
import com.gallifrey2000.overpoweredmod.tools.hybridSword;
import com.gallifrey2000.overpoweredmod.tools.zedAxe;
import com.gallifrey2000.overpoweredmod.tools.zedHoe;
import com.gallifrey2000.overpoweredmod.tools.zedPickaxe;
import com.gallifrey2000.overpoweredmod.tools.zedShovel;
import com.gallifrey2000.overpoweredmod.tools.zedSword;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = MainFile.MODID, name = MainFile.NAME, version = MainFile.VERSION)
public class MainFile {
            	
            //Modification Info
            public static final String MODID = "overpoweredmod";
            public static final String NAME = "Over Powered Mod";
            public static final String VERSION = "Alpha v1.1.0";
            
            @SidedProxy(clientSide = "com.gallifrey2000.overpoweredmod.ClientProxy", serverSide = "com.gallifrey2000.overpoweredmod.ServerProxy")
            
            @Instance(MainFile.MODID)
            public static MainFile modInstance;
            
            //Initializing Stuff
            
            //Generation
            public static zedGenClass zedGen = new zedGenClass();
            public static zedGenClass darkOreGen = new zedGenClass();
            
            //Tabs
        	public static CreativeTabs opModTab = new OpModTab(CreativeTabs.getNextID(), "opModTab");
        	public static CreativeTabs opModTools = new OpTabTools(CreativeTabs.getNextID(), "opTabTools");
        	
        	//Materials
        	public static ToolMaterial hybridMaterial = EnumHelper.addToolMaterial("hybridMaterial", 3, 1300, 3.5F, 2.0F, 10);
        	public static ToolMaterial zedMaterial = EnumHelper.addToolMaterial("zedMaterial", 4, 2000, 15.0F, 8.0F, 12);
        	
        	//Entities
            	
            //Items
            public static Item mudItem = new mudItem();
            public static Item pieTin = new pieTin();
            public static Item smashedCactus = new smashedCactus();
            public static Item corruptedZed = new corruptedZed();
            public static Item pureZed = new pureZed();
            public static Item darkShard = new darkShard();
            	
            //Food Items
            public static Item mudPie = new mudPie (4, false);
            public static Item cactusJuice = new cactusJuice();
            public static Item jellyBeanRed = new jellyBeanRed(2, false);
            public static Item jellyBeanGreen = new jellyBeanGreen(2, false);
            public static Item jellyBeanYellow = new jellyBeanYellow(2, false);
            public static Item jellyBeanPurple = new jellyBeanPurple(2, false);
            
            //Tools
            public static Item hybridSword = new hybridSword(hybridMaterial);
            public static Item zedSword = new zedSword(zedMaterial);
            public static Item zedShovel = new zedShovel(zedMaterial);
            public static Item zedAxe = new zedAxe(zedMaterial);
            public static Item zedPickaxe = new zedPickaxe(zedMaterial);
            public static Item zedHoe = new zedHoe(zedMaterial);
            	
            //Blocks
            public static Block superBlock = new superBlock(Material.rock);
            public static Block zedOreBlock = new zedOreBlock(Material.rock);
            public static Block darkOreBlock = new darkOreBlock(Material.rock);
            
            //Crop Blocks
        	
            @EventHandler
            public void Init(FMLInitializationEvent event){
        		
        		//Registering Items
        		GameRegistry.registerItem(mudItem, "mudItem");
        		GameRegistry.registerItem(pieTin, "pieTin");
        		GameRegistry.registerItem(smashedCactus, "smashedCactus");
        		GameRegistry.registerItem(darkShard, "darkShard");
        		GameRegistry.registerItem(mudPie, "mudPie");
        		GameRegistry.registerItem(cactusJuice, "cactusJuice");
        		GameRegistry.registerItem(jellyBeanRed, "jellyBeanRed");
        		GameRegistry.registerItem(jellyBeanGreen, "jellyBeanGreen");
        		GameRegistry.registerItem(jellyBeanYellow, "jellyBeanYellow");
        		GameRegistry.registerItem(jellyBeanPurple, "jellyBeanPurple");
        		GameRegistry.registerItem(corruptedZed, "corruptedZed");
        		GameRegistry.registerItem(pureZed, "pureZed");
        		GameRegistry.registerItem(hybridSword, "hybridSword");
        		GameRegistry.registerItem(zedSword, "zedSword");
        		GameRegistry.registerItem(zedPickaxe, "zedPickaxe");
        		GameRegistry.registerItem(zedHoe, "zedHoe");
        		GameRegistry.registerItem(zedAxe, "zedAxe");
        		GameRegistry.registerItem(zedShovel, "zedShovel");
        		
        		//Registering Blocks
        		GameRegistry.registerBlock(superBlock, "superBlock");
        		GameRegistry.registerBlock(zedOreBlock,  "zedOreBlock");
        		GameRegistry.registerBlock(darkOreBlock,  "darkOreBlock");
        		
        		//Registering Generation Ore
        		GameRegistry.registerWorldGenerator(zedGen, 1);
        		
        		//Entities
        		mobBase.registerEntity(goblinMob.class, "Goblin", 0x2AFF00, 0xD500FF);
        		
        		//Recipes
        		GameRegistry.addShapedRecipe(new ItemStack (mudPie), new Object[ ] {
                	" S ",
                	" S ",
                	" X ",
                	'X', new ItemStack (pieTin), 'S', new ItemStack (mudItem)});
        		
        		GameRegistry.addRecipe(new ItemStack (pieTin), new Object[ ] {
                	"X X",
                	"X X",
                	" X ",
                	'X', new ItemStack (Items.iron_ingot)});
        		
        		GameRegistry.addRecipe(new ItemStack (cactusJuice), new Object[ ] {
            		" F ",
            		" X ",
            		" S ",
            		'X', new ItemStack (smashedCactus), 'S', new ItemStack (Items.water_bucket), 'F', new ItemStack (Items.sugar)});
        		
        		GameRegistry.addRecipe(new ItemStack (hybridSword), new Object[ ] {
                	" S ",
                	"PWC",
                	" X ",
                	'X', new ItemStack (Items.stick), 'S', new ItemStack (Items.stone_sword), 'P', new ItemStack (Blocks.planks), 'W', new ItemStack (Items.wooden_sword),
                	'C', new ItemStack (Items.coal)});
        		
        		GameRegistry.addShapedRecipe(new ItemStack (zedSword), new Object[ ] {
                	" S ",
                	" S ",
                	" X ",
                	'X', new ItemStack (Items.stick), 'S', new ItemStack (pureZed)});
        		
        		GameRegistry.addShapedRecipe(new ItemStack (zedAxe), new Object[ ] {
                	"SS ",
                	"SX ",
                	" X ",
                	'X', new ItemStack (Items.stick), 'S', new ItemStack (pureZed)});
        		
        		GameRegistry.addShapedRecipe(new ItemStack (zedHoe), new Object[ ] {
                	"SS ",
                	" X ",
                	" X ",
                	'X', new ItemStack (Items.stick), 'S', new ItemStack (pureZed)});
        		
        		GameRegistry.addShapedRecipe(new ItemStack (zedShovel), new Object[ ] {
                	" S ",
                	" X ",
                	" X ",
                	'X', new ItemStack (Items.stick), 'S', new ItemStack (pureZed)});
        		
        		GameRegistry.addShapedRecipe(new ItemStack (zedPickaxe), new Object[ ] {
                	"SSS",
                	" X ",
                	" X ",
                	'X', new ItemStack (Items.stick), 'S', new ItemStack (pureZed)});
        		
                GameRegistry.addShapelessRecipe(new ItemStack (mudItem), new ItemStack (Blocks.dirt), new ItemStack (Items.water_bucket));
                GameRegistry.addShapelessRecipe(new ItemStack (jellyBeanRed), new ItemStack (Items.dye, 0, 3), new ItemStack (Items.dye, 0, 1));
                GameRegistry.addShapelessRecipe(new ItemStack (jellyBeanGreen), new ItemStack (Items.dye, 0, 3), new ItemStack (Items.dye, 0, 2));
                GameRegistry.addShapelessRecipe(new ItemStack (jellyBeanYellow), new ItemStack (Items.dye, 0, 3), new ItemStack (Items.dye, 0, 11));
                GameRegistry.addShapelessRecipe(new ItemStack (jellyBeanPurple), new ItemStack (Items.dye, 0, 3), new ItemStack (Items.dye, 0, 5));
                GameRegistry.addShapelessRecipe(new ItemStack (smashedCactus), new ItemStack (Blocks.cactus));
                GameRegistry.addSmelting(new ItemStack (corruptedZed), new ItemStack(pureZed), 10);
        		
            }
            
    }

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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