The type EntityModel is not generic; it cannot be parameterized with arguments <Entity> #2008
-
I have been having this issue for a day now and I have no clue how to fix it.I don't really know that much of Java, I just sort of have the basics down. This is the error: This is the code where the error is in: package net.backrooms.smp.content.client.renderer;
import net.backrooms.smp.content.client.renderer.model.WrogglerEntityModel;
import net.backrooms.smp.content.entity.WrogglerEntity;
import net.minecraft.client.render.entity.BipedEntityRenderer;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.model.ZombieEntityModel;
import net.minecraft.util.Identifier;
public class WrogglerEntityRenderer extends BipedEntityRenderer<WrogglerEntity, WrogglerEntityModel<WrogglerEntity>> {
public WrogglerEntityRenderer(EntityRenderDispatcher entityRenderDispatcher) {
super(entityRenderDispatcher, new WrogglerEntityModel(), 0.5f);
}
public WrogglerEntityRenderer(
net.backrooms.smp.content.client.renderer.model.WrogglerEntityModel wrogglerEntityModel) {
}
@Override
public Identifier getTexture(WrogglerEntity entity) {
return new Identifier("backroomssmp", "textures/entity/wroggler/wroggler.png");
}
} This is the EntityModel code: package net.backrooms.smp.content.client.renderer.model;
import net.backrooms.smp.content.entity.WrogglerEntity;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.util.math.MatrixStack;
public class WrogglerEntityModel extends EntityModel<WrogglerEntity> {
private final ModelPart head;
private final ModelPart headwear;
private final ModelPart body;
private final ModelPart left_arm;
private final ModelPart right_arm;
private final ModelPart left_leg;
private final ModelPart right_leg;
public WrogglerEntityModel() {
this.textureWidth = 64;
this.textureHeight = 64;
head = new ModelPart(this);
head.setPivot(0.0F, 0.0F, 0.0F);
head.setTextureOffset(0, 0).addCuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.0F, false);
head.setTextureOffset(24, 4).addCuboid(2.0F, -8.0F, -1.0F, 2.0F, 2.0F, 2.0F, 0.5F, false);
head.setTextureOffset(24, 4).addCuboid(-2.0F, -4.0F, 2.5F, 2.0F, 2.0F, 2.0F, 0.5F, false);
head.setTextureOffset(24, 4).addCuboid(-4.0F, -6.5F, -3.0F, 2.0F, 2.0F, 2.0F, 0.5F, false);
head.setTextureOffset(32, 4).addCuboid(-1.45F, -1.9F, -4.25F, 3.0F, 2.0F, 2.0F, 0.5F, false);
headwear = new ModelPart(this);
headwear.setPivot(0.0F, 0.0F, 0.0F);
headwear.setTextureOffset(32, 0).addCuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.5F, false);
body = new ModelPart(this);
body.setPivot(0.0F, 0.0F, 0.0F);
body.setTextureOffset(16, 16).addCuboid(-4.0F, 0.0F, -2.0F, 8.0F, 6.0F, 4.0F, 0.0F, false);
body.setTextureOffset(18, 32).addCuboid(-0.5F, 7.5F, -0.5F, 3.0F, 3.0F, 3.0F, 0.0F, false);
body.setTextureOffset(18, 32).addCuboid(0.0F, 1.75F, -2.5F, 3.0F, 3.0F, 3.0F, 0.0F, false);
body.setTextureOffset(14, 19).addCuboid(-4.0F, 6.0F, -3.0F, 8.0F, 6.0F, 5.0F, 0.0F, false);
left_arm = new ModelPart(this);
left_arm.setPivot(-5.0F, 2.0F, 0.0F);
left_arm.setTextureOffset(40, 16).addCuboid(9.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, true);
left_arm.setTextureOffset(42, 32).addCuboid(10.5F, 0.5F, -0.5F, 3.0F, 3.0F, 3.0F, 0.0F, true);
right_arm = new ModelPart(this);
right_arm.setPivot(5.0F, 2.0F, 0.0F);
right_arm.setTextureOffset(40, 16).addCuboid(-13.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, false);
right_arm.setTextureOffset(42, 32).addCuboid(-13.5F, -1.0F, -2.5F, 3.0F, 3.0F, 3.0F, 0.0F, false);
right_arm.setTextureOffset(42, 32).addCuboid(-12.5F, 4.0F, -0.5F, 3.0F, 3.0F, 3.0F, 0.0F, false);
left_leg = new ModelPart(this);
left_leg.setPivot(-1.9F, 12.0F, 0.0F);
left_leg.setTextureOffset(2, 32).addCuboid(3.4F, 3.75F, -0.5F, 3.0F, 3.0F, 3.0F, 0.0F, true);
left_leg.setTextureOffset(2, 32).addCuboid(2.15F, 7.5F, -2.25F, 3.0F, 3.0F, 3.0F, 0.0F, true);
left_leg.setTextureOffset(0, 16).addCuboid(1.9F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, true);
right_leg = new ModelPart(this);
right_leg.setPivot(1.9F, 12.0F, 0.0F);
right_leg.setTextureOffset(0, 16).addCuboid(-5.9F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.0F, false);
right_leg.setTextureOffset(2, 32).addCuboid(-6.4F, 7.0F, -1.5F, 3.0F, 3.0F, 3.0F, 0.0F, false);
right_leg.setTextureOffset(2, 32).addCuboid(-6.15F, 1.5F, -2.25F, 3.0F, 3.0F, 3.0F, 0.0F, false);
}
@Override
public void setAngles(WrogglerEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
//previously the render function, render code was moved to a method below
}
@Override
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
head.render(matrixStack, buffer, packedLight, packedOverlay);
headwear.render(matrixStack, buffer, packedLight, packedOverlay);
body.render(matrixStack, buffer, packedLight, packedOverlay);
left_arm.render(matrixStack, buffer, packedLight, packedOverlay);
right_arm.render(matrixStack, buffer, packedLight, packedOverlay);
left_leg.render(matrixStack, buffer, packedLight, packedOverlay);
right_leg.render(matrixStack, buffer, packedLight, packedOverlay);
}
public void setRotationAngle(ModelPart bone, float x, float y, float z) {
bone.pitch = x;
bone.yaw = y;
bone.roll = z;
}
} I created the model in BlockBench and converted it into a Java file using a plugin that translates it into Fabric friendly code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Like it says the WrogglerEntityModel is not parameterized. Possible fixes would be to remove the type argument when you create your type:
or keep your entity model type generic so you can create it with the type argument.
Here's a tutorial on java generic types: |
Beta Was this translation helpful? Give feedback.
Like it says the WrogglerEntityModel is not parameterized.
Possible fixes would be to remove the type argument when you create your type:
or keep your entity model type generic so you can create it with the type argument.
H…