Started by
ToyChicaMangle
on
Topic category: Troubleshooting, bugs, and solutions
I was working on my mod and I added my first mob, the mouse, and using Vegetto's tutorial on how to work with Tabula Models and then I got this error:
warning: [options] bootstrap class path not set in conjunction with -source 1.6C:\Pylo\MCreator174\forge\build\sources\main\java\mod\mcreator\mcreator_mouse.java:235: error: cannot find symbol
this.setRotateAngle(MouseTailL, -0.17453292519943295F, 0.0F, 0.0F);
^
symbol: method setRotateAngle(ModelRenderer,float,float,float)
C:\Pylo\MCreator174\forge\build\sources\main\java\mod\mcreator\mcreator_mouse.java:242: error: cannot find symbol
this.setRotateAngle(MouseTailF, -0.44261549830576197F, 0.0F, 0.0F);
^
symbol: method setRotateAngle(ModelRenderer,float,float,float)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
1 warning FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details. * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
These peices of the model arent being animated and are rotated in the modeler.
Edited by ToyChicaMangle on Fri, 09/15/2017 - 21:44
Paste your code
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.registry.RegistryNamespaced;
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.entity.player.EntityPlayer;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.EntityAgeable;
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 java.util.Random;
import java.util.Iterator;
import java.util.ArrayList; @SuppressWarnings("unchecked")
public class mcreator_mouse { 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(Minecraft.getMinecraft().getRenderManager(), new mcreator_mouse.ModelMouse(), 0) {
protected ResourceLocation getEntityTexture(Entity par1Entity) {
return new ResourceLocation("Mouse-texturemap.png");
}
};
RenderingRegistry.registerEntityRenderingHandler(mcreator_mouse.Entitymouse.class, customRender); } public void serverLoad(FMLServerStartingEvent event) {
} public void preInit(FMLPreInitializationEvent event) {
int entityID = MathHelper.getRandomUUID().hashCode();
mobid = entityID;
EntityRegistry.registerModEntity(mcreator_mouse.Entitymouse.class, "mouse", entityID, instance, 64, 1, true, (153 << 16) + (153 << 8) + 153,
(255 << 16) + (255 << 8) + 255);
EntityRegistry.addSpawn(mcreator_mouse.Entitymouse.class, 50, 1, 5, EnumCreatureType.CREATURE,
Biome.REGISTRY.getObject(new ResourceLocation("plains"))); } 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 Entitymouse extends EntityAnimal {
World world = null; public Entitymouse(World var1) {
super(var1);
world = var1;
experienceValue = 5;
this.isImmuneToFire = false;
addRandomArmor();
setNoAI(!true); this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(10, new EntityAILookIdle(this));
this.tasks.addTask(10, new EntityAISwimming(this));
this.tasks.addTask(9, new EntityAITempt(this, 0.8D, mcreator_cheese.block, false));
this.tasks.addTask(10, new EntityAIPanic(this, 1.2D));
this.setSize(0.9F, 1.4F);
this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); } protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(4D);
if (this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE) != null)
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(1D);
} protected void addRandomArmor() { } public Entitymouse createChild(EntityAgeable ageable) {
return new Entitymouse(world);
} public float getEyeHeight() {
return this.isChild() ? this.height : 1.3F;
} public boolean isBreedingItem(ItemStack stack) {
return stack != null && com.google.common.collect.Sets.newHashSet(new Item[]{mcreator_cheese.block,}).contains(stack.getItem());
} protected void dropRareDrop(int par1) {
this.dropItem(new ItemStack(mcreator_cheese.block).getItem(), 1);
} @Override
protected Item getDropItem() {
return new ItemStack(mcreator_mouseFur.block).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;
} } /**
* Mouse - ToyChicaMangle Created using Tabula 5.1.0
*/
public static class ModelMouse extends ModelBase {
public ModelRenderer MouseLegFR;
public ModelRenderer MouseBody;
public ModelRenderer MouseLegFL;
public ModelRenderer MouseLegBR;
public ModelRenderer MouseLegBL;
public ModelRenderer MouseHead;
public ModelRenderer MouseEarL;
public ModelRenderer MouseEarR;
public ModelRenderer MouseSnout;
public ModelRenderer MouseTailF;
public ModelRenderer MouseTailL; public ModelMouse() {
this.textureWidth = 32;
this.textureHeight = 32;
this.MouseLegFR = new ModelRenderer(this, 0, 17);
this.MouseLegFR.setRotationPoint(-1.5F, 22.0F, -2.5F);
this.MouseLegFR.addBox(-0.5F, 0.0F, -0.5F, 1, 2, 1, 0.0F);
this.MouseTailL = new ModelRenderer(this, 0, 26);
this.MouseTailL.setRotationPoint(0.0F, 20.5F, 2.5F);
this.MouseTailL.addBox(-1.0F, 0.25F, 2.4F, 2, 1, 2, 0.0F);
this.setRotateAngle(MouseTailL, -0.17453292519943295F, 0.0F, 0.0F);
this.MouseLegFL = new ModelRenderer(this, 0, 17);
this.MouseLegFL.setRotationPoint(1.5F, 22.0F, -2.5F);
this.MouseLegFL.addBox(-0.5F, 0.0F, -0.5F, 1, 2, 1, 0.0F);
this.MouseTailF = new ModelRenderer(this, 0, 21);
this.MouseTailF.setRotationPoint(0.0F, 20.5F, 2.5F);
this.MouseTailF.addBox(-1.0F, -0.5F, 0.0F, 2, 1, 3, 0.0F);
this.setRotateAngle(MouseTailF, -0.44261549830576197F, 0.0F, 0.0F);
this.MouseEarL = new ModelRenderer(this, 24, 9);
this.MouseEarL.setRotationPoint(0.0F, 20.0F, -3.0F);
this.MouseEarL.addBox(1.5F, -6.0F, -1.0F, 3, 3, 1, 0.0F);
this.MouseLegBR = new ModelRenderer(this, 0, 17);
this.MouseLegBR.setRotationPoint(-0.5F, 22.0F, -0.5F);
this.MouseLegBR.addBox(-1.5F, 0.0F, 2.5F, 1, 2, 1, 0.0F);
this.MouseEarR = new ModelRenderer(this, 15, 9);
this.MouseEarR.setRotationPoint(0.0F, 20.0F, -3.0F);
this.MouseEarR.addBox(-4.5F, -6.0F, -1.0F, 3, 3, 1, 0.0F);
this.MouseHead = new ModelRenderer(this, 0, 9);
this.MouseHead.setRotationPoint(0.0F, 20.0F, -3.0F);
this.MouseHead.addBox(-2.0F, -3.0F, -3.0F, 4, 3, 3, 0.0F);
this.MouseBody = new ModelRenderer(this, 0, 0);
this.MouseBody.setRotationPoint(0.0F, 21.0F, 0.0F);
this.MouseBody.addBox(-2.0F, -1.0F, -3.0F, 4, 2, 6, 0.0F);
this.MouseSnout = new ModelRenderer(this, 16, 13);
this.MouseSnout.setRotationPoint(0.0F, 20.0F, -3.0F);
this.MouseSnout.addBox(-1.0F, -1.0F, -4.0F, 2, 1, 1, 0.0F);
this.MouseLegBL = new ModelRenderer(this, 0, 17);
this.MouseLegBL.setRotationPoint(1.5F, 22.0F, 2.5F);
this.MouseLegBL.addBox(-0.5F, 0.0F, -0.5F, 1, 2, 1, 0.0F);
} @Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.MouseLegFR.render(f5);
this.MouseTailL.render(f5);
this.MouseLegFL.render(f5);
this.MouseTailF.render(f5);
this.MouseEarL.render(f5);
this.MouseLegBR.render(f5);
this.MouseEarR.render(f5);
this.MouseHead.render(f5);
this.MouseBody.render(f5);
this.MouseSnout.render(f5);
this.MouseLegBL.render(f5);
} /**
* This is a helper function from Tabula to set the rotation of model
* parts
*/
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.MouseHead.rotateAngleY = f3 / (180F / (float) Math.PI);
this.MouseHead.rotateAngleX = f4 / (180F / (float) Math.PI);
this.MouseEarL.rotateAngleY = f3 / (180F / (float) Math.PI);
this.MouseEarL.rotateAngleX = f4 / (180F / (float) Math.PI);
this.MouseEarR.rotateAngleY = f3 / (180F / (float) Math.PI);
this.MouseEarR.rotateAngleX = f4 / (180F / (float) Math.PI);
this.MouseSnout.rotateAngleY = f3 / (180F / (float) Math.PI);
this.MouseSnout.rotateAngleX = f4 / (180F / (float) Math.PI);
this.MouseLegFL.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
this.MouseLegFR.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
this.MouseLegBL.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 2.0F * f1 * 0.5F;
this.MouseLegBR.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
}
} }
The method setRotateAngle() does not exist, you have to create it. The method should take as arguments ModelRenderer - the part that is being rotated, and 3 float values - each one from them for each axis. The method itself just sets an angle of each axis to one of these.
Can you explain a bit more exactly what I'm adding and where I put it in the code to make the model work?
I found a solution, I just switch to Techne rather than Tabula and it worked..
you need to add a import for your rotate angle (beginning of the file) copy and paste from a vanilla block like a fence