Not Valid Java Name

Published by Fredzik on Mon, 05/04/2020 - 11:37
Status
Duplicate
Type
Product/platform
MCreator/Windows
Priority
Normal
Issue description

I made a model with Blockbench and after exporting I haven't edited the code. In Mcreator I simply tried to open it and it says:

"That's not a valid java name".

Here's the model code:

// Made with Blockbench 3.5.2
// Exported for Minecraft version 1.14
// Paste this class into your mod and generate all required imports

public class rock_crab extends EntityModel {
    private final RendererModel body;
    private final RendererModel right_eye;
    private final RendererModel left_eye;
    private final RendererModel rock;
    private final RendererModel rock2;
    private final RendererModel rock4;
    private final RendererModel rock3;
    private final RendererModel right_claw;
    private final RendererModel left_claw;
    private final RendererModel right_legs;
    private final RendererModel right_leg1;
    private final RendererModel right_leg2;
    private final RendererModel right_leg3;
    private final RendererModel left_legs;
    private final RendererModel left_leg4;
    private final RendererModel left_leg5;
    private final RendererModel left_leg6;

    public rock_crab() {
        textureWidth = 64;
        textureHeight = 64;

        body = new RendererModel(this);
        body.setRotationPoint(6.0F, 21.0F, -4.0F);
        setRotationAngle(body, -0.1745F, 0.0F, 0.0F);
        body.cubeList.add(new ModelBox(body, 0, 0, -12.0F, -6.0F, -2.0F, 12, 6, 12, 0.0F, false));

        right_eye = new RendererModel(this);
        right_eye.setRotationPoint(0.0F, 0.0F, 0.0F);
        body.addChild(right_eye);
        setRotationAngle(right_eye, 0.2618F, 0.0F, -0.1745F);
        right_eye.cubeList.add(new ModelBox(right_eye, 0, 32, -9.0F, -11.0F, -1.0F, 2, 5, 2, 0.0F, false));

        left_eye = new RendererModel(this);
        left_eye.setRotationPoint(-12.0F, 0.0F, 0.0F);
        body.addChild(left_eye);
        setRotationAngle(left_eye, 0.2618F, 0.0F, 0.1745F);
        left_eye.cubeList.add(new ModelBox(left_eye, 0, 0, 7.0F, -11.0F, -1.0F, 2, 5, 2, 0.0F, false));

        rock = new RendererModel(this);
        rock.setRotationPoint(-3.0F, 0.0F, 0.0F);
        body.addChild(rock);
        setRotationAngle(rock, -0.2618F, 0.0F, 0.2618F);
        rock.cubeList.add(new ModelBox(rock, 0, 18, -7.0F, -11.0F, -1.0F, 7, 7, 7, 0.0F, false));

        rock2 = new RendererModel(this);
        rock2.setRotationPoint(-3.0F, 0.0F, 0.0F);
        body.addChild(rock2);
        setRotationAngle(rock2, -0.2618F, -0.5236F, -0.5236F);
        rock2.cubeList.add(new ModelBox(rock2, 36, 0, -3.7F, -13.0F, 2.0F, 5, 6, 5, 0.0F, false));

        rock4 = new RendererModel(this);
        rock4.setRotationPoint(-9.0F, 0.0F, 0.0F);
        body.addChild(rock4);
        setRotationAngle(rock4, -0.2618F, 0.5236F, 0.6981F);
        rock4.cubeList.add(new ModelBox(rock4, 40, 18, -0.3F, -13.0F, -1.0F, 4, 5, 4, 0.0F, false));

        rock3 = new RendererModel(this);
        rock3.setRotationPoint(-3.0F, 0.0F, 0.0F);
        body.addChild(rock3);
        setRotationAngle(rock3, -0.8727F, -0.1745F, 0.4363F);
        rock3.cubeList.add(new ModelBox(rock3, 28, 35, -4.7F, -13.0F, 1.7F, 5, 6, 5, 0.0F, false));

        right_claw = new RendererModel(this);
        right_claw.setRotationPoint(-4.0F, 23.0F, 5.0F);
        setRotationAngle(right_claw, 0.1745F, -0.3491F, 0.0F);
        right_claw.cubeList.add(new ModelBox(right_claw, 0, 32, -10.0F, -6.0F, -15.0F, 6, 3, 8, 0.5F, false));

        left_claw = new RendererModel(this);
        left_claw.setRotationPoint(4.0F, 23.0F, 5.0F);
        setRotationAngle(left_claw, 0.1745F, 0.3491F, 0.0F);
        left_claw.cubeList.add(new ModelBox(left_claw, 20, 24, 4.0F, -6.0F, -15.0F, 6, 3, 8, 0.5F, false));

        right_legs = new RendererModel(this);
        right_legs.setRotationPoint(0.0F, 24.0F, 0.0F);
        

        right_leg1 = new RendererModel(this);
        right_leg1.setRotationPoint(1.5F, -4.0F, -1.0F);
        right_legs.addChild(right_leg1);
        setRotationAngle(right_leg1, 0.0F, -0.2618F, -0.4363F);
        right_leg1.cubeList.add(new ModelBox(right_leg1, 38, 46, -14.0F, -4.0F, 0.0F, 8, 2, 2, 0.0F, false));

        right_leg2 = new RendererModel(this);
        right_leg2.setRotationPoint(1.5F, -4.0F, -1.0F);
        right_legs.addChild(right_leg2);
        setRotationAngle(right_leg2, 0.0F, 0.0873F, -0.4363F);
        right_leg2.cubeList.add(new ModelBox(right_leg2, 18, 46, -14.0F, -4.0F, 0.0F, 8, 2, 2, 0.0F, false));

        right_leg3 = new RendererModel(this);
        right_leg3.setRotationPoint(1.5F, -4.0F, -0.5F);
        right_legs.addChild(right_leg3);
        setRotationAngle(right_leg3, 0.0F, 0.3491F, -0.4363F);
        right_leg3.cubeList.add(new ModelBox(right_leg3, 43, 35, -14.0F, -4.0F, 0.0F, 8, 2, 2, 0.0F, false));

        left_legs = new RendererModel(this);
        left_legs.setRotationPoint(0.0F, 24.0F, 0.0F);
        

        left_leg4 = new RendererModel(this);
        left_leg4.setRotationPoint(-1.5F, -4.0F, -1.0F);
        left_legs.addChild(left_leg4);
        setRotationAngle(left_leg4, 0.0F, 0.2618F, 0.4363F);
        left_leg4.cubeList.add(new ModelBox(left_leg4, 0, 43, 6.0F, -4.0F, 0.0F, 8, 2, 2, 0.0F, false));

        left_leg5 = new RendererModel(this);
        left_leg5.setRotationPoint(-1.5F, -4.0F, -1.0F);
        left_legs.addChild(left_leg5);
        setRotationAngle(left_leg5, 0.0F, -0.0873F, 0.4363F);
        left_leg5.cubeList.add(new ModelBox(left_leg5, 40, 27, 6.0F, -4.0F, 0.0F, 8, 2, 2, 0.0F, false));

        left_leg6 = new RendererModel(this);
        left_leg6.setRotationPoint(-1.5F, -4.0F, -0.5F);
        left_legs.addChild(left_leg6);
        setRotationAngle(left_leg6, 0.0F, -0.3491F, 0.4363F);
        left_leg6.cubeList.add(new ModelBox(left_leg6, 21, 18, 6.0F, -4.0F, 0.0F, 8, 2, 2, 0.0F, false));
    }

    @Override
    public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
        body.render(f5);
        right_claw.render(f5);
        left_claw.render(f5);
        right_legs.render(f5);
        left_legs.render(f5);
    }

    public void setRotationAngle(RendererModel modelRenderer, float x, float y, float z) {
        modelRenderer.rotateAngleX = x;
        modelRenderer.rotateAngleY = y;
        modelRenderer.rotateAngleZ = z;
    }
}

Issue comments

But, now the model is causing compilation error:

Executing Gradle task: build
Build info: MCreator 2020.2.14217, 1.14.4, 64-bit, 16335 MB, Windows 10, JVM 1.8.0_232, JAVA_HOME: C:\Users\Frodig\Documents\MCreator 2020.2 Windows 64bit\MCreator20202\jdk
> Configure project :
New Dep: net.minecraftforge:forge:1.14.4-28.2.3_mapped_snapshot_20190719-1.14.3
> Task :compileJava FAILED
C:\Users\Frodig\MCreatorWorkspaces\mysticalmobs\src\main\java\net\mcreator\mysticalmobs\entity\RockCrabEntity.java:265: error: cannot find symbol       public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue,
                         ^
  symbol:   class MatrixStack
  location: class Modelrock_crab
C:\Users\Frodig\MCreatorWorkspaces\mysticalmobs\src\main\java\net\mcreator\mysticalmobs\entity\RockCrabEntity.java:265: error: cannot find symbol       public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue,
                                                  ^
  symbol:   class IVertexBuilder
  location: class Modelrock_crab
2 errors
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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:c…
BUILD FAILED in 3s
1 actionable task: 1 executed
BUILD FAILED
Task completed in 5245 milliseconds
 



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.