This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Hi everybody.
Im trying to make my Octopus to move its tentacles; it uses Squid entity (its a child), as you guys can see below, everything works fine, except it wont move the tentacles underwater... what should i add here?
package mod.mcreator; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraft.world.biome.Biome; import net.minecraft.world.World; import net.minecraft.util.math.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.util.EnumHand; import net.minecraft.util.DamageSource; import net.minecraft.item.ItemStack; import net.minecraft.item.Item; import net.minecraft.init.Items; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.passive.EntitySquid; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.Entity; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelBase; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import java.util.Random; import java.util.Iterator; import java.util.ArrayList; @SuppressWarnings("unchecked") public class mcreator_octopus { public int mobid = 0; public static Object instance; public void load(FMLInitializationEvent event) { } public void generateNether(World world, Random random, int chunkX, int chunkZ) { } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { } public int addFuel(ItemStack fuel) { return 0; } @SideOnly(Side.CLIENT) public void registerRenderers() { RenderLiving customRender = new RenderLiving<EntitySquid>(Minecraft.getMinecraft().getRenderManager(), new mcreator_octopus.ModelPolvo(), 0) { protected ResourceLocation getEntityTexture(EntitySquid par1Entity) { return new ResourceLocation("PolvoT.png"); } protected void preRenderCallback(EntitySquid entitylivingbaseIn, float partialTickTime) { float f = 1.0F; GlStateManager.scale(0.5f, 0.5f, 0.5f); } }; RenderingRegistry.registerEntityRenderingHandler(mcreator_octopus.Entityoctopus.class, customRender); } public void serverLoad(FMLServerStartingEvent event) { } public void preInit(FMLPreInitializationEvent event) { int entityID = MathHelper.getRandomUUID().hashCode(); mobid = entityID; EntityRegistry.registerModEntity(mcreator_octopus.Entityoctopus.class, "octopus", entityID, instance, 64, 1, true, (253 << 16) + (0 << 8) + 27, (251 << 16) + (108 << 8) + 128); EntityRegistry.addSpawn(mcreator_octopus.Entityoctopus.class, 10, 1, 3, EnumCreatureType.WATER_CREATURE, Biome.REGISTRY.getObject(new ResourceLocation("ocean"))); } public static Biome[] clean(net.minecraft.util.registry.RegistryNamespaced<ResourceLocation, Biome> in) { Iterator<Biome> itr = in.iterator(); ArrayList<Biome> ls = new ArrayList<Biome>(); while (itr.hasNext()) { ls.add(itr.next()); } return ls.toArray(new Biome[ls.size()]); } public static class Entityoctopus extends EntitySquid { World world = null; public Entityoctopus(World var1) { super(var1); world = var1; experienceValue = 7; this.isImmuneToFire = false; addRandomArmor(); setNoAI(!true); } protected void addRandomArmor() { } protected void dropRareDrop(int par1) { this.dropItem(new ItemStack(Items.FISH).getItem(), 1); } @Override protected Item getDropItem() { return new ItemStack(Items.DYE, 1, 0).getItem(); } @Override protected net.minecraft.util.SoundEvent getAmbientSound() { return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("")); } @Override protected net.minecraft.util.SoundEvent getHurtSound() { return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.hurt")); } @Override protected net.minecraft.util.SoundEvent getDeathSound() { return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.die")); } @Override public void onStruckByLightning(EntityLightningBolt entityLightningBolt) { super.onStruckByLightning(entityLightningBolt); int i = (int) this.posX; int j = (int) this.posY; int k = (int) this.posZ; Entity entity = this; } @Override public void fall(float l, float d) { super.fall(l, d); int i = (int) this.posX; int j = (int) this.posY; int k = (int) this.posZ; super.fall(l, d); Entity entity = this; } @Override public void onDeath(DamageSource source) { super.onDeath(source); int i = (int) this.posX; int j = (int) this.posY; int k = (int) this.posZ; Entity entity = this; } @Override public boolean processInteract(EntityPlayer entity, EnumHand hand, ItemStack stack) { super.processInteract(entity, hand, stack); int i = (int) this.posX; int j = (int) this.posY; int k = (int) this.posZ; return true; } @Override protected float getSoundVolume() { return 1.0F; } } // Date: 29/11/2017 19:58:38 // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX public static class ModelPolvo extends ModelBase { // fields ModelRenderer HeadBase; ModelRenderer Head1; ModelRenderer Eye1; ModelRenderer Eye2; ModelRenderer Head2; ModelRenderer Head3; ModelRenderer Leg1; ModelRenderer Leg2; ModelRenderer Leg3; ModelRenderer Leg4; ModelRenderer Leg5; ModelRenderer Leg6; ModelRenderer Leg7; ModelRenderer Leg8; public ModelPolvo() { textureWidth = 64; textureHeight = 64; HeadBase = new ModelRenderer(this, 6, 54); HeadBase.addBox(-2.5F, -1F, -2F, 6, 2, 6); HeadBase.setRotationPoint(-0.5F, 10F, -1.5F); HeadBase.setTextureSize(64, 64); HeadBase.mirror = true; setRotation(HeadBase, 0F, 0F, 0F); Head1 = new ModelRenderer(this, 6, 42); Head1.addBox(-3F, -2F, -2F, 6, 4, 6); Head1.setRotationPoint(0F, 8F, -1F); Head1.setTextureSize(64, 64); Head1.mirror = true; setRotation(Head1, -0.1745329F, 0F, 0F); Eye1 = new ModelRenderer(this, 11, 2); Eye1.addBox(-1F, -1F, -1F, 2, 2, 2); Eye1.setRotationPoint(-2F, 8F, -3F); Eye1.setTextureSize(64, 64); Eye1.mirror = true; setRotation(Eye1, 0F, 0.2617994F, 0F); Eye2 = new ModelRenderer(this, 2, 2); Eye2.addBox(-1F, -1F, -1F, 2, 2, 2); Eye2.setRotationPoint(2F, 8F, -3F); Eye2.setTextureSize(64, 64); Eye2.mirror = true; setRotation(Eye2, 0F, -0.2617994F, 0F); Head2 = new ModelRenderer(this, 2, 27); Head2.addBox(0F, 0F, 0F, 7, 5, 8); Head2.setRotationPoint(-3.5F, 2F, 0.5F); Head2.setTextureSize(64, 64); Head2.mirror = true; setRotation(Head2, -0.7853982F, 0F, 0F); Head3 = new ModelRenderer(this, 0, 8); Head3.addBox(0F, 0F, 0F, 8, 8, 9); Head3.setRotationPoint(-4F, -1F, 7F); Head3.setTextureSize(64, 64); Head3.mirror = true; setRotation(Head3, -1.186824F, 0F, 0F); Leg1 = new ModelRenderer(this, 35, 3); Leg1.addBox(-1F, 0F, -1F, 2, 13, 2); Leg1.setRotationPoint(-3F, 11F, -3F); Leg1.setTextureSize(64, 64); Leg1.mirror = true; setRotation(Leg1, -0.1745329F, 0.7853982F, 0F); Leg2 = new ModelRenderer(this, 45, 3); Leg2.addBox(-1F, 0F, -2F, 2, 13, 2); Leg2.setRotationPoint(0F, 11F, -2F); Leg2.setTextureSize(64, 64); Leg2.mirror = true; setRotation(Leg2, -0.1745329F, 0F, 0F); Leg3 = new ModelRenderer(this, 55, 3); Leg3.addBox(-1F, 0F, -1F, 2, 13, 2); Leg3.setRotationPoint(3F, 11F, -3F); Leg3.setTextureSize(64, 64); Leg3.mirror = true; setRotation(Leg3, -0.1745329F, -0.7853982F, 0F); Leg4 = new ModelRenderer(this, 35, 23); Leg4.addBox(0F, 0F, -1F, 2, 13, 2); Leg4.setRotationPoint(2F, 11F, 0F); Leg4.setTextureSize(64, 64); Leg4.mirror = true; setRotation(Leg4, 0F, 0F, -0.1745329F); Leg5 = new ModelRenderer(this, 45, 23); Leg5.addBox(-1F, 0F, -1F, 2, 13, 2); Leg5.setRotationPoint(3F, 11F, 3F); Leg5.setTextureSize(64, 64); Leg5.mirror = true; setRotation(Leg5, 0.1745329F, 0.7853982F, 0F); Leg6 = new ModelRenderer(this, 55, 23); Leg6.addBox(-1F, 0F, 0F, 2, 13, 2); Leg6.setRotationPoint(0F, 11F, 2F); Leg6.setTextureSize(64, 64); Leg6.mirror = true; setRotation(Leg6, 0.1745329F, 0F, 0F); Leg7 = new ModelRenderer(this, 35, 41); Leg7.addBox(-1F, 0F, -1F, 2, 13, 2); Leg7.setRotationPoint(-3F, 11F, 3F); Leg7.setTextureSize(64, 64); Leg7.mirror = true; setRotation(Leg7, 0.1745329F, -0.7853982F, 0F); Leg8 = new ModelRenderer(this, 45, 41); Leg8.addBox(-2F, 0F, -1F, 2, 13, 2); Leg8.setRotationPoint(-2F, 11F, 0F); Leg8.setTextureSize(64, 64); Leg8.mirror = true; setRotation(Leg8, 0F, 0F, 0.1745329F); } 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); HeadBase.render(f5); Head1.render(f5); Eye1.render(f5); Eye2.render(f5); Head2.render(f5); Head3.render(f5); Leg1.render(f5); Leg2.render(f5); Leg3.render(f5); Leg4.render(f5); Leg5.render(f5); Leg6.render(f5); Leg7.render(f5); Leg8.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.Leg1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 - 0.1745329F; this.Leg2.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 - 0.1745329F; this.Leg3.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 - 0.1745329F; this.Leg4.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; this.Leg5.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 + 0.1745329F; this.Leg6.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 + 0.1745329F; this.Leg7.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1 + 0.1745329F; this.Leg8.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; } } }
Thank You.
nobody??
hum maybe someone could point me to tutorial for making a aquatic (fish) mob?
Hi everybody.
Im trying to make my Octopus to move its tentacles; it uses Squid entity (its a child), as you guys can see below, everything works fine, except it wont move the tentacles underwater... what should i add here?
Thank You.
nobody??
hum maybe someone could point me to tutorial for making a aquatic (fish) mob?