Jump to content

many231

Members
  • Posts

    48
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

many231's Achievements

Tree Puncher

Tree Puncher (2/8)

4

Reputation

  1. public static class Factory implements IRenderFactory<ENTITYCLASSNAME> { @Override public Render<? super ENTITYCLASSNAME> createRenderFor(RenderManager manager) { return new RENDERCLASSNAME(manager); } Try this. Also client proxy should extend commonproxy. Add this to your client proxy and common proxy. //ClientProxy @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); ModEntities.initModels(); } //CommonProxy public void preInit(FMLPreInitializationEvent e) { ModEntities.init(); } Then in your main mod class preinit do: proxy.preInit(event); In your ModEntities have something like this. public static void init() { // Every entity in our mod has an ID (local to this mod) int id = 1; ResourceLocation resourceLocation = new ResourceLocation("mmm", "fastZombie"); EntityRegistry.registerModEntity(resourceLocation, EntityFastZombie.class, resourceLocation.toString(), 9990, MastersMobs.instance, 64, 1, true, 8388608, 32768); // We want our mob to spawn in Plains and ice plains biomes. If you don't add this then it will not spawn automatically // but you can of course still make it spawn manually EntityRegistry.addSpawn(ENTITYCLASS.class, 100, 3, 5, EnumCreatureType.MONSTER, Biomes.PLAINS, Biomes.ICE_PLAINS, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.DESERT, Biomes.EXTREME_HILLS); } @SideOnly(Side.CLIENT) public static void initModels() { RenderingRegistry.registerEntityRenderingHandler(ENTITYFLLASS.class, FACTORYCLASS.class); } This is just how I would do it. I don't think your renders aren't being called.
  2. this is a copy/paste + some editing of a normal minecraft class.
  3. So I made my own mob and everything is fine and the model loads properly, the problem starts when it looks around or walks... It has a nose but when it looks around the nose doesn't move with the head but moves with the body, also the legs swing way to far when it walks around. Let me know if you need more code to help me. Model Class: package masterminer.mods.entity; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelQuadruped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; import net.minecraft.util.math.MathHelper; public class ModelBoar extends ModelQuadruped { public ModelBoar() { super(12, 0.0F); this.head = new ModelRenderer(this, 0, 0); this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, 0.0F); this.head.setRotationPoint(0.0F, 12.0F, -6.0F); this.head.addBox(-5.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); this.head.addBox(4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); this.head.setTextureSize(64, 64); this.body = new ModelRenderer(this, 18, 4); this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, 0.0F); this.body.setRotationPoint(0.0F, 5.0F, 2.0F); this.body.addBox(-2.0F, 2.0F, -8.0F, 4, 6, 1); --this.leg1.rotationPointX; ++this.leg2.rotationPointX; this.leg1.rotationPointZ += 0.0F; this.leg2.rotationPointZ += 0.0F; --this.leg3.rotationPointX; ++this.leg4.rotationPointX; --this.leg3.rotationPointZ; --this.leg4.rotationPointZ; this.childZOffset += 2.0F; } }
  4. Only error showing 21:58:48] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established [21:58:48] [Server thread/INFO]: Player359[local:E:0cf49a4f] logged in with entity id 814 at (-10.5, 69.0, 257.5) [21:58:48] [Server thread/INFO]: Player359 joined the game [21:58:48] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2255ms behind, skipping 45 tick(s) [21:58:50] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@4d9796d[id=f79c4f00-774e-3daf-ac9c-aebcbcc29c64,name=Player359,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3056) [Minecraft.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121] at java.lang.Thread.run(Unknown Source) [?:1.8.0_121] [21:59:01] [Server thread/INFO]: [Player359: Object successfully summoned] [21:59:01] [Client thread/INFO]: [CHAT] Object successfully summoned [21:59:02] [Server thread/INFO]: Saving and pausing game... [21:59:02] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld [21:59:03] [Server thread/INFO]: Saving chunks for level 'New World'/Nether [21:59:03] [Server thread/INFO]: Saving chunks for level 'New World'/The End
  5. Okay so I am making a custom mob and I believe it isn't loading the java file of the model, or it isn't rendering properly. There is no white box there just is nothing except for a shadow. Please be specific as you can with answers and keep in mind I am still kinda new to java. Main Class: package masterminer.mods; import masterminer.mods.entity.EntityDeer; import masterminer.mods.entity.RenderDeer; import masterminer.mods.init.ModItems; import masterminer.mods.proxy.CommonProxy; import masterminer.mods.utils.Reference; import masterminer.mods.utils.Utils; import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.EntityRegistry; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION) public class MastersMobs { @Mod.Instance(Reference.MODID) public static MastersMobs instance; @SidedProxy(serverSide = Reference.SERVER_PROXY_CLASS, clientSide = Reference.CLIENT_PROXY_CLASS) public static CommonProxy proxy; public static final ResourceLocation LOOT_DEER = LootTableList.register(new ResourceLocation("mmm", "loot_tables/entities/deer")); public ModItems items; @Mod.EventHandler public void preinit(FMLPreInitializationEvent event) { ResourceLocation resourceLocation = new ResourceLocation("mmm", "deer"); EntityRegistry.registerModEntity(resourceLocation, EntityDeer.class, resourceLocation.toString(), 0, instance, 64, 1, true, 0, 16777215); } @Mod.EventHandler public void init(FMLInitializationEvent event) { this.items = new ModItems(); this.items.init(); this.items.register(); proxy.registerClient(); RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, new RenderDeer()); } @Mod.EventHandler public void postinit(FMLPostInitializationEvent event) { } } Entity Class: package masterminer.mods.entity; import javax.annotation.Nullable; import masterminer.mods.MastersMobs; import net.minecraft.block.Block; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAvoidEntity; import net.minecraft.entity.ai.EntityAIFollowParent; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMate; import net.minecraft.entity.ai.EntityAIPanic; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAITempt; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWanderAvoidWater; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityPolarBear; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.init.SoundEvents; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.datafix.DataFixer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class EntityDeer extends EntityAnimal { public EntityDeer(World worldIn) { super(worldIn); this.setSize(0.9F, 1.4F); } public static void registerFixesDeer(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, EntityDeer.class); } protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.WHEAT, false)); this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.20000000298023224D); } protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_COW_AMBIENT; } protected SoundEvent getHurtSound() { return SoundEvents.ENTITY_COW_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_COW_DEATH; } protected void playStepSound(BlockPos pos, Block blockIn) { this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F); } /** * Returns the volume for the sounds this mob makes. */ protected float getSoundVolume() { return 0.4F; } @Nullable protected ResourceLocation getLootTable() { return MastersMobs.LOOT_DEER; } public EntityDeer createChild(EntityAgeable ageable) { return new EntityDeer(this.world); } public float getEyeHeight() { return this.isChild() ? this.height : 1.3F; } } Render Class: package masterminer.mods.entity; import javax.annotation.Nonnull; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderDeer extends RenderLiving<EntityDeer> { private static final ResourceLocation mobTexture = new ResourceLocation("mmm:textures/entity/deer/deer.png"); public RenderDeer() { super(Minecraft.getMinecraft().getRenderManager(), new ModelDeer(), 0.5F); } protected ResourceLocation getEntityTexture(EntityDeer entity) { return mobTexture; } } Model Class: package masterminer.mods.entity; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; public class ModelDeer extends ModelBase { private ModelRenderer head; private ModelRenderer body; private ModelRenderer nose1; private ModelRenderer nose2; private ModelRenderer FLLeg; private ModelRenderer FRLeg; private ModelRenderer BLLeg; private ModelRenderer BRLeg; private ModelRenderer tail; private ModelRenderer ant1b; private ModelRenderer ant1m; private ModelRenderer ant1t; private ModelRenderer ant2b; private ModelRenderer ant2m; private ModelRenderer ant2t; private ModelRenderer neck; public ModelDeer() { this.textureWidth = 512; this.textureHeight = 512; this.body = new ModelRenderer(this, 1, 1); // DeerBody this.neck = new ModelRenderer(this, 73, 1); // Neck this.head = new ModelRenderer(this, 105, 1); // Head this.nose1 = new ModelRenderer(this, 137, 1); // Nose1 this.nose2 = new ModelRenderer(this, 161, 1); // Nose2 this.ant1b = new ModelRenderer(this, 1, 1); // Ant1B this.ant1m = new ModelRenderer(this, 65, 1); // Ant1M this.ant1t = new ModelRenderer(this, 73, 1); // Ant1T this.ant2b = new ModelRenderer(this, 97, 1); // Ant2B this.ant2m = new ModelRenderer(this, 105, 1); // Ant2M this.ant2t = new ModelRenderer(this, 185, 1); // Ant2T this.FLLeg = new ModelRenderer(this, 193, 1); // LFLeg this.FRLeg = new ModelRenderer(this, 209, 1); // RFLeg this.BLLeg = new ModelRenderer(this, 225, 1); // LBLeg this.BRLeg = new ModelRenderer(this, 241, 1); // RBLeg this.tail = new ModelRenderer(this, 257, 1); // Tail this.body.addBox(0F, 0F, 0F, 24, 10, 11, 0F); // DeerBody this.body.setRotationPoint(0F, -10F, -5F); this.neck.addBox(0F, 0F, 0F, 7, 8, 7, 0F); // Neck this.neck.setRotationPoint(-3F, -13F, -3F); this.neck.rotateAngleZ = 0.40142573F; this.head.addBox(0F, 0F, 0F, 10, 8, 9, 0F); // Head this.head.setRotationPoint(-6F, -20F, -4F); this.head.rotateAngleZ = 0.12217305F; this.nose1.addBox(0F, 0F, 0F, 5, 2, 5, 0F); // Nose1 this.nose1.setRotationPoint(-9.9F, -14F, -2F); this.nose1.rotateAngleZ = 0.12217305F; this.nose2.addBox(0F, 0F, 0F, 5, 2, 5, 0F); // Nose2 this.nose2.setRotationPoint(-10.2F, -15F, -2F); this.nose2.rotateAngleZ = 0.33161256F; this.ant1b.addBox(0F, 0F, 0F, 1, 4, 1, 0F); // Ant1B this.ant1b.setRotationPoint(-2F, -24F, -5.5F); this.ant1b.rotateAngleX = 0.34906585F; this.ant1b.rotateAngleZ = 0.12217305F; this.ant1m.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant1M this.ant1m.setRotationPoint(-2F, -25.6F, -8.95F); this.ant1m.rotateAngleX = 1.09955743F; this.ant1m.rotateAngleZ = 0.08726646F; this.ant1t.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant1T this.ant1t.setRotationPoint(-2F, -28.8F, -2.2F); this.ant1t.rotateAngleX = -0.62831853F; this.ant2b.addBox(0F, 0F, 0F, 1, 4, 1, 0F); // Ant2B this.ant2b.setRotationPoint(-2F, -24F, 5.5F); this.ant2b.rotateAngleX = -0.34906585F; this.ant2b.rotateAngleZ = 0.12217305F; this.ant2m.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant2M this.ant2m.setRotationPoint(-2F, -26.4F, 9.6F); this.ant2m.rotateAngleX = -1.09955743F; this.ant2m.rotateAngleZ = 0.08726646F; this.ant2t.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant2T this.ant2t.setRotationPoint(-2F, -27.9F, 2F); this.ant2t.rotateAngleX = 0.66322512F; this.FLLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // LFLeg this.FLLeg.setRotationPoint(0.5F, 0F, 3F); this.FRLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // RFLeg this.FRLeg.setRotationPoint(0.5F, 0F, -5F); this.BLLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // LBLeg this.BLLeg.setRotationPoint(20.5F, 0F, 3F); this.BRLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // RBLeg this.BRLeg.setRotationPoint(20.5F, 0F, -5F); this.tail.addBox(0F, 0F, 0F, 2, 3, 3, 0F); // Tail this.tail.setRotationPoint(23F, -12F, -1F); this.tail.rotateAngleZ = -0.29670597F; } public void getItemModel(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (this.isChild) { float f = 2.0F; GlStateManager.pushMatrix(); GlStateManager.translate(0.0F, 6.0F * scale, 0.0F); this.head.render(scale); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); GlStateManager.scale(1.4F / f, 1.0F / f, 1.2F / f); GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); this.body.render(scale); GlStateManager.popMatrix(); } else { this.head.render(scale); this.body.render(scale); } } public void setRotateAngles(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entity) { this.head.rotateAngleX = (headPitch * 0.017453292F); } }
  6. So as the title says, I made my own mob, the problem though is that when I get into minecraft it is just a white box. I think it is because the model isn't rendering correctly and I don't know how to fix it. Am I registering the renderer wrong or am I just forgetting something? (Please be specific) Main Class: @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION) public class MastersMobs { @Mod.Instance(Reference.MODID) public static MastersMobs instance; @SidedProxy(serverSide = Reference.SERVER_PROXY_CLASS, clientSide = Reference.CLIENT_PROXY_CLASS) public static CommonProxy proxy; public static final ResourceLocation LOOT_DEER = LootTableList.register(new ResourceLocation("mmm", "loot_tables/entities/deer")); public ModItems items; @Mod.EventHandler public void preinit(FMLPreInitializationEvent event) { } @Mod.EventHandler public void init(FMLInitializationEvent event) { this.items = new ModItems(); this.items.init(); this.items.register(); ResourceLocation resourceLocation = new ResourceLocation("mmm", "deer"); EntityRegistry.registerModEntity(resourceLocation, EntityDeerAtr.class, resourceLocation.toString(), 0, instance, 64, 1, true, 0, 16777215); proxy.registerClient(); } @Mod.EventHandler public void postinit(FMLPostInitializationEvent event) { } } ModelClass: public class EntityDeer extends ModelBase { private ModelRenderer head; private ModelRenderer body; private ModelRenderer nose1; private ModelRenderer nose2; private ModelRenderer FLLeg; private ModelRenderer FRLeg; private ModelRenderer BLLeg; private ModelRenderer BRLeg; private ModelRenderer tail; private ModelRenderer ant1b; private ModelRenderer ant1m; private ModelRenderer ant1t; private ModelRenderer ant2b; private ModelRenderer ant2m; private ModelRenderer ant2t; private ModelRenderer neck; public EntityDeer() { this.textureWidth = 512; this.textureHeight = 512; this.body = new ModelRenderer(this, 1, 1); // DeerBody this.neck = new ModelRenderer(this, 73, 1); // Neck this.head = new ModelRenderer(this, 105, 1); // Head this.nose1 = new ModelRenderer(this, 137, 1); // Nose1 this.nose2 = new ModelRenderer(this, 161, 1); // Nose2 this.ant1b = new ModelRenderer(this, 1, 1); // Ant1B this.ant1m = new ModelRenderer(this, 65, 1); // Ant1M this.ant1t = new ModelRenderer(this, 73, 1); // Ant1T this.ant2b = new ModelRenderer(this, 97, 1); // Ant2B this.ant2m = new ModelRenderer(this, 105, 1); // Ant2M this.ant2t = new ModelRenderer(this, 185, 1); // Ant2T this.FLLeg = new ModelRenderer(this, 193, 1); // LFLeg this.FRLeg = new ModelRenderer(this, 209, 1); // RFLeg this.BLLeg = new ModelRenderer(this, 225, 1); // LBLeg this.BRLeg = new ModelRenderer(this, 241, 1); // RBLeg this.tail = new ModelRenderer(this, 257, 1); // Tail this.body.addBox(0F, 0F, 0F, 24, 10, 11, 0F); // DeerBody this.body.setRotationPoint(0F, -10F, -5F); this.neck.addBox(0F, 0F, 0F, 7, 8, 7, 0F); // Neck this.neck.setRotationPoint(-3F, -13F, -3F); this.neck.rotateAngleZ = 0.40142573F; this.head.addBox(0F, 0F, 0F, 10, 8, 9, 0F); // Head this.head.setRotationPoint(-6F, -20F, -4F); this.head.rotateAngleZ = 0.12217305F; this.nose1.addBox(0F, 0F, 0F, 5, 2, 5, 0F); // Nose1 this.nose1.setRotationPoint(-9.9F, -14F, -2F); this.nose1.rotateAngleZ = 0.12217305F; this.nose2.addBox(0F, 0F, 0F, 5, 2, 5, 0F); // Nose2 this.nose2.setRotationPoint(-10.2F, -15F, -2F); this.nose2.rotateAngleZ = 0.33161256F; this.ant1b.addBox(0F, 0F, 0F, 1, 4, 1, 0F); // Ant1B this.ant1b.setRotationPoint(-2F, -24F, -5.5F); this.ant1b.rotateAngleX = 0.34906585F; this.ant1b.rotateAngleZ = 0.12217305F; this.ant1m.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant1M this.ant1m.setRotationPoint(-2F, -25.6F, -8.95F); this.ant1m.rotateAngleX = 1.09955743F; this.ant1m.rotateAngleZ = 0.08726646F; this.ant1t.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant1T this.ant1t.setRotationPoint(-2F, -28.8F, -2.2F); this.ant1t.rotateAngleX = -0.62831853F; this.ant2b.addBox(0F, 0F, 0F, 1, 4, 1, 0F); // Ant2B this.ant2b.setRotationPoint(-2F, -24F, 5.5F); this.ant2b.rotateAngleX = -0.34906585F; this.ant2b.rotateAngleZ = 0.12217305F; this.ant2m.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant2M this.ant2m.setRotationPoint(-2F, -26.4F, 9.6F); this.ant2m.rotateAngleX = -1.09955743F; this.ant2m.rotateAngleZ = 0.08726646F; this.ant2t.addBox(0F, 0F, 0F, 1, 5, 1, 0F); // Ant2T this.ant2t.setRotationPoint(-2F, -27.9F, 2F); this.ant2t.rotateAngleX = 0.66322512F; this.FLLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // LFLeg this.FLLeg.setRotationPoint(0.5F, 0F, 3F); this.FRLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // RFLeg this.FRLeg.setRotationPoint(0.5F, 0F, -5F); this.BLLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // LBLeg this.BLLeg.setRotationPoint(20.5F, 0F, 3F); this.BRLeg.addBox(0F, 0F, 0F, 3, 10, 3, 0F); // RBLeg this.BRLeg.setRotationPoint(20.5F, 0F, -5F); this.tail.addBox(0F, 0F, 0F, 2, 3, 3, 0F); // Tail this.tail.setRotationPoint(23F, -12F, -1F); this.tail.rotateAngleZ = -0.29670597F; } public void getItemModel(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (this.isChild) { float f = 2.0F; GlStateManager.pushMatrix(); GlStateManager.translate(0.0F, 6.0F * scale, 0.0F); this.head.render(scale); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); GlStateManager.scale(1.4F / f, 1.0F / f, 1.2F / f); GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); this.body.render(scale); GlStateManager.popMatrix(); } else { this.head.render(scale); this.body.render(scale); } } public void setRotateAngles(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entity) { this.head.rotateAngleX = (headPitch * 0.017453292F); } } Entity Class: public class EntityDeerAtr extends EntityAnimal { public EntityDeerAtr(World worldIn) { super(worldIn); this.setSize(0.9F, 1.4F); } public static void registerFixesDeer(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, EntityDeerAtr.class); } protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.WHEAT, false)); this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.20000000298023224D); } protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_COW_AMBIENT; } protected SoundEvent getHurtSound() { return SoundEvents.ENTITY_COW_HURT; } protected SoundEvent getDeathSound() { return SoundEvents.ENTITY_COW_DEATH; } protected void playStepSound(BlockPos pos, Block blockIn) { this.playSound(SoundEvents.ENTITY_COW_STEP, 0.15F, 1.0F); } /** * Returns the volume for the sounds this mob makes. */ protected float getSoundVolume() { return 0.4F; } @Nullable protected ResourceLocation getLootTable() { return MastersMobs.LOOT_DEER; } public EntityDeerAtr createChild(EntityAgeable ageable) { return new EntityDeerAtr(this.world); } public float getEyeHeight() { return this.isChild() ? this.height : 1.3F; } } Render Class: @SideOnly(Side.CLIENT) public class RenderDeer extends RenderLiving<EntityDeerAtr>{ private static final ResourceLocation DEER_TEXTURES = new ResourceLocation("mmm/textures/entity/deer/deer.png"); public RenderDeer(RenderManager render) { super(render, new EntityDeer(), 0.7F); } @Nonnull protected ResourceLocation getEntityTexture(@Nonnull EntityDeerAtr entity) { return DEER_TEXTURES; } } ClientProxy: public class ClientProxy extends CommonProxy { public void registerClient() { registerModel(ModItems.rdeerMeat, 0, new ModelResourceLocation(ModItems.rdeerMeat.getRegistryName(), "inventory")); registerModel(ModItems.cdeerMeat, 0 , new ModelResourceLocation(ModItems.cdeerMeat.getRegistryName(), "inventory")); registerModel(ModItems.sdeerMeat, 0, new ModelResourceLocation(ModItems.sdeerMeat.getRegistryName(), "inventory")); registerModel(ModItems.deerHide, 0, new ModelResourceLocation(ModItems.deerHide.getRegistryName(), "inventory")); registerModel(ModItems.tanHide, 0, new ModelResourceLocation(ModItems.tanHide.getRegistryName(), "inventory")); registerModel(ModItems.deerAntlers, 0, new ModelResourceLocation(ModItems.deerAntlers.getRegistryName(), "inventory")); RenderingRegistry.registerEntityRenderingHandler(EntityDeerAtr.class, RenderDeer::new); } public void registerModel(Object obj, int meta, ModelResourceLocation loc) { Item item = null; if((obj instanceof Item)) { item = (Item)obj; } else if ((obj instanceof Block)) { item = Item.getItemFromBlock((Block)obj); } else { throw new IllegalArgumentException(); } Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, loc); } } CommonProxy: public class CommonProxy { public void registerClient() {} }
  7. I am using a piece of decompiled code, does anyone know what this is supposed to be? (1.$SwitchMap$net$minecraftforge$client$IItemRenderer$ItemRenderType[type.ordinal()])
  8. I have been looking through the MCP fields and according to that field_72995_K is "isClient", but I get this error "isClient cannot be resolved or is not a field". Here is my code. (This is not the full class.)
  9. Thank you so much, I was using the forge fields.cvs but they didn't have it.
  10. So I decompiled a mod to get the entity bullet and I can't figure out what one of the fields is. Field: field_70170_p Here is the code:
×
×
  • Create New...

Important Information

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