Posted August 11, 20205 yr public class ProjRenderer extends EntityRenderer<ProjEntity> implements IEntityRenderer<ProjEntity, ProjModel<ProjEntity>> { protected static final ResourceLocation TEXTURE = new ResourceLocation(Test.MOD_ID, "textures/entity/proj_entity.png"); public static final ProjModel<ProjEntity> MODEL = new ProjModel<>(); public ProjRenderer(EntityRendererManager renderManagerIn) { super(renderManagerIn); } @Nonnull @Override public ProjModel<ProjEntity> getEntityModel() { return MODEL; } @Nonnull @Override public ResourceLocation getEntityTexture(@Nonnull ProjEntity entity) { return TEXTURE; } } public class ProjModel<T extends ProjEntity> extends EntityModel<T> { private final ModelRenderer proj; public ShinsuModel() { textureWidth = 64; textureHeight = 64; proj = new ModelRenderer(this); proj.setRotationPoint(0.0F, 16.0F, 0.0F); proj.setTextureOffset(0, 0).addBox(-8.0F, -8.0F, -8.0F, 16.0F, 16.0F, 16.0F, 0.0F, false); } @Override public void setRotationAngles(@Nonnull T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { proj.rotateAngleX = headPitch * ((float) Math.PI / 180f); proj.rotateAngleY = netHeadYaw * ((float) Math.PI / 180f); } @Override public void render(@Nonnull MatrixStack matrixStackIn, @Nonnull IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { proj.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn); } } @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { RenderingRegistry.registerEntityRenderingHandler(RegistryHandler.PROJ_ENTITY.get(), ProjRenderer::new); } ProjEntity is an instance of DamagingProjectileEntity. For some reason it just appears as an invisible hitbox that is on fire. I'm sure the texture is 64x64 and is at the correct location. What is wrong?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.