Jump to content

Recommended Posts

Posted

I created a spherical entity, but when I display it in the world, it has a snoring shape!

 

Renderer


public class CircleSphereEntityRenderer extends EntityRenderer<CircleSphereEntity> {
        private static final ResourceLocation END_CRYSTAL_LOCATION = new ResourceLocation(NijisanjiWorldMod.MOD_ID,"textures/entity/misc/circlesphereentity.png");
        private static final RenderType RENDER_TYPE = RenderType.entityTranslucent(END_CRYSTAL_LOCATION);
        private static final float SIN_45 = (float)Math.sin((Math.PI / 4D));
         private final ModelPart bone;

        public CircleSphereEntityRenderer(EntityRendererProvider.Context p_173970_) {
            super(p_173970_);
           // this.shadowRadius = 0.5F;
            ModelPart modelpart = p_173970_.bakeLayer(ModEntityRenderers.CIRCLESPEHEENTITY_LAYER);
            this.bone = modelpart.getChild("bone");
        }


    public static LayerDefinition createBodyLayer() {
        MeshDefinition meshdefinition = new MeshDefinition();
        PartDefinition partdefinition = meshdefinition.getRoot();

        PartDefinition bone = partdefinition.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(22, 4).addBox(-1.5913F, -2.0F, -8.0F, 3.0F, 4.0F, 16.0F, new CubeDeformation(0.0F))
                .texOffs(126, 0).addBox(-8.0F, -2.0F, -1.5913F, 16.0F, 4.0F, 3.0F, new CubeDeformation(0.0F))
                .texOffs(57, 31).addBox(-1.4918F, -3.5F, -7.5F, 2.0F, 7.0F, 15.0F, new CubeDeformation(0.0F))
                .texOffs(137, 131).addBox(-7.5F, -3.5F, -1.4918F, 15.0F, 7.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(52, 75).addBox(-1.3924F, -4.5F, -7.0F, 2.0F, 9.0F, 14.0F, new CubeDeformation(0.0F))
                .texOffs(137, 7).addBox(-7.0F, -4.5F, -1.3924F, 14.0F, 9.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(30, 89).addBox(-1.2929F, -5.0F, -6.5F, 2.0F, 10.0F, 13.0F, new CubeDeformation(0.0F))
                .texOffs(96, 141).addBox(-6.5F, -5.0F, -1.2929F, 13.0F, 10.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(102, 95).addBox(-1.1935F, -5.5F, -6.0F, 2.0F, 11.0F, 12.0F, new CubeDeformation(0.0F))
                .texOffs(148, 118).addBox(-6.0F, -5.5F, -1.1935F, 12.0F, 11.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(113, 23).addBox(-1.094F, -6.0F, -5.5F, 2.0F, 12.0F, 11.0F, new CubeDeformation(0.0F))
                .texOffs(144, 153).addBox(-5.5F, -6.0F, -1.094F, 11.0F, 12.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(126, 108).addBox(-0.9946F, -6.5F, -5.0F, 1.0F, 13.0F, 10.0F, new CubeDeformation(0.0F))
                .texOffs(88, 167).addBox(-5.0F, -6.5F, -0.9946F, 10.0F, 13.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(22, 135).addBox(-0.8951F, -7.0F, -4.5F, 1.0F, 14.0F, 9.0F, new CubeDeformation(0.0F))
                .texOffs(169, 0).addBox(-4.5F, -7.0F, -0.8951F, 9.0F, 14.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(16, 158).addBox(-0.6962F, -7.5F, -3.5F, 1.0F, 15.0F, 7.0F, new CubeDeformation(0.0F))
                .texOffs(0, 20).addBox(-3.5F, -7.5F, -0.6962F, 7.0F, 15.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(95, 52).addBox(-0.3978F, -8.0F, -2.0F, 0.0F, 16.0F, 4.0F, new CubeDeformation(0.0F))
                .texOffs(110, 167).addBox(-2.0F, -8.0F, -0.3978F, 4.0F, 16.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 16.0F, -0.5F));

        PartDefinition hexadecagon_r1 = bone.addOrReplaceChild("hexadecagon_r1", CubeListBuilder.create().texOffs(48, 158).addBox(-2.0F, -8.0F, -0.3978F, 4.0F, 16.0F, 0.0F, new CubeDeformation(0.0F))
                .texOffs(8, 36).addBox(-0.3978F, -8.0F, -2.0F, 0.0F, 16.0F, 4.0F, new CubeDeformation(0.0F))
                .texOffs(0, 0).addBox(-3.5F, -7.5F, -0.6962F, 7.0F, 15.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(120, 154).addBox(-0.6962F, -7.5F, -3.5F, 1.0F, 15.0F, 7.0F, new CubeDeformation(0.0F))
                .texOffs(158, 167).addBox(-4.5F, -7.0F, -0.8951F, 9.0F, 14.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(76, 132).addBox(-0.8951F, -7.0F, -4.5F, 1.0F, 14.0F, 9.0F, new CubeDeformation(0.0F))
                .texOffs(165, 75).addBox(-5.0F, -6.5F, -0.9946F, 10.0F, 13.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(54, 121).addBox(-0.9946F, -6.5F, -5.0F, 1.0F, 13.0F, 10.0F, new CubeDeformation(0.0F))
                .texOffs(94, 153).addBox(-5.5F, -6.0F, -1.094F, 11.0F, 12.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(28, 112).addBox(-1.094F, -6.0F, -5.5F, 2.0F, 12.0F, 11.0F, new CubeDeformation(0.0F))
                .texOffs(146, 140).addBox(-6.0F, -5.5F, -1.1935F, 12.0F, 11.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(101, 72).addBox(-1.1935F, -5.5F, -6.0F, 2.0F, 11.0F, 12.0F, new CubeDeformation(0.0F))
                .texOffs(22, 44).addBox(-6.5F, -5.0F, -1.2929F, 13.0F, 10.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(84, 84).addBox(-1.2929F, -5.0F, -6.5F, 2.0F, 10.0F, 13.0F, new CubeDeformation(0.0F))
                .texOffs(133, 82).addBox(-7.0F, -4.5F, -1.3924F, 14.0F, 9.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(34, 66).addBox(-1.3924F, -4.5F, -7.0F, 2.0F, 9.0F, 14.0F, new CubeDeformation(0.0F))
                .texOffs(44, 0).addBox(-7.5F, -3.5F, -1.4918F, 15.0F, 7.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(45, 9).addBox(-1.4918F, -3.5F, -7.5F, 2.0F, 7.0F, 15.0F, new CubeDeformation(0.0F))
                .texOffs(82, 0).addBox(-8.0F, -2.0F, -1.5913F, 16.0F, 4.0F, 3.0F, new CubeDeformation(0.0F))
                .texOffs(0, 20).addBox(-1.5913F, -2.0F, -8.0F, 3.0F, 4.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -0.3927F, 0.0F));

        PartDefinition hexadecagon_r2 = bone.addOrReplaceChild("hexadecagon_r2", CubeListBuilder.create().texOffs(56, 169).addBox(-2.0F, -8.0F, -0.3978F, 4.0F, 16.0F, 0.0F, new CubeDeformation(0.0F))
                .texOffs(96, 3).addBox(-0.3978F, -8.0F, -2.0F, 0.0F, 16.0F, 4.0F, new CubeDeformation(0.0F))
                .texOffs(22, 0).addBox(-3.5F, -7.5F, -0.6962F, 7.0F, 15.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(32, 158).addBox(-0.6962F, -7.5F, -3.5F, 1.0F, 15.0F, 7.0F, new CubeDeformation(0.0F))
                .texOffs(169, 15).addBox(-4.5F, -7.0F, -0.8951F, 9.0F, 14.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(42, 135).addBox(-0.8951F, -7.0F, -4.5F, 1.0F, 14.0F, 9.0F, new CubeDeformation(0.0F))
                .texOffs(136, 167).addBox(-5.0F, -6.5F, -0.9946F, 10.0F, 13.0F, 1.0F, new CubeDeformation(0.0F))
                .texOffs(0, 128).addBox(-0.9946F, -6.5F, -5.0F, 1.0F, 13.0F, 10.0F, new CubeDeformation(0.0F))
                .texOffs(62, 155).addBox(-5.5F, -6.0F, -1.094F, 11.0F, 12.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(114, 46).addBox(-1.094F, -6.0F, -5.5F, 2.0F, 12.0F, 11.0F, new CubeDeformation(0.0F))
                .texOffs(152, 62).addBox(-6.0F, -5.5F, -1.1935F, 12.0F, 11.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(0, 105).addBox(-1.1935F, -5.5F, -6.0F, 2.0F, 11.0F, 12.0F, new CubeDeformation(0.0F))
                .texOffs(144, 93).addBox(-6.5F, -5.0F, -1.2929F, 13.0F, 10.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(94, 10).addBox(-1.2929F, -5.0F, -6.5F, 2.0F, 10.0F, 13.0F, new CubeDeformation(0.0F))
                .texOffs(138, 107).addBox(-7.0F, -4.5F, -1.3924F, 14.0F, 9.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(76, 23).addBox(-1.3924F, -4.5F, -7.0F, 2.0F, 9.0F, 14.0F, new CubeDeformation(0.0F))
                .texOffs(142, 53).addBox(-7.5F, -3.5F, -1.4918F, 15.0F, 7.0F, 2.0F, new CubeDeformation(0.0F))
                .texOffs(57, 53).addBox(-1.4918F, -3.5F, -7.5F, 2.0F, 7.0F, 15.0F, new CubeDeformation(0.0F))
                .texOffs(128, 23).addBox(-8.0F, -2.0F, -1.5913F, 16.0F, 4.0F, 3.0F, new CubeDeformation(0.0F))
                .texOffs(22, 24).addBox(-1.5913F, -2.0F, -8.0F, 3.0F, 4.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.3927F, 0.0F));

        PartDefinition hexadecagon_r3 = bone.addOrReplaceChild("hexadecagon_r3", CubeListBuilder.create().texOffs(0, 36).addBox(-0.3978F, -8.0F, -2.0F, 0.0F, 16.0F, 4.0F, new CubeDeformation(0.0F))
                .texOffs(0, 151).addBox(-0.6962F, -7.5F, -3.5F, 1.0F, 15.0F, 7.0F, new CubeDeformation(0.0F))
                .texOffs(126, 131).addBox(-0.8951F, -7.0F, -4.5F, 1.0F, 14.0F, 9.0F, new CubeDeformation(0.0F))
                .texOffs(104, 118).addBox(-0.9946F, -6.5F, -5.0F, 1.0F, 13.0F, 10.0F, new CubeDeformation(0.0F))
                .texOffs(111, 0).addBox(-1.094F, -6.0F, -5.5F, 2.0F, 12.0F, 11.0F, new CubeDeformation(0.0F))
                .texOffs(60, 98).addBox(-1.1935F, -5.5F, -6.0F, 2.0F, 11.0F, 12.0F, new CubeDeformation(0.0F))
                .texOffs(0, 82).addBox(-1.2929F, -5.0F, -6.5F, 2.0F, 10.0F, 13.0F, new CubeDeformation(0.0F))
                .texOffs(64, 0).addBox(-1.3924F, -4.5F, -7.0F, 2.0F, 9.0F, 14.0F, new CubeDeformation(0.0F))
                .texOffs(38, 44).addBox(-1.4918F, -3.5F, -7.5F, 2.0F, 7.0F, 15.0F, new CubeDeformation(0.0F))
                .texOffs(0, 0).addBox(-1.5913F, -2.0F, -8.0F, 3.0F, 4.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -0.7854F, 0.0F));

        PartDefinition hexadecagon_r4 = bone.addOrReplaceChild("hexadecagon_r4", CubeListBuilder.create().texOffs(103, 52).addBox(-0.3978F, -8.0F, -2.0F, 0.0F, 16.0F, 4.0F, new CubeDeformation(0.0F))
                .texOffs(159, 23).addBox(-0.6962F, -7.5F, -3.5F, 1.0F, 15.0F, 7.0F, new CubeDeformation(0.0F))
                .texOffs(139, 30).addBox(-0.8951F, -7.0F, -4.5F, 1.0F, 14.0F, 9.0F, new CubeDeformation(0.0F))
                .texOffs(130, 59).addBox(-0.9946F, -6.5F, -5.0F, 1.0F, 13.0F, 10.0F, new CubeDeformation(0.0F))
                .texOffs(118, 84).addBox(-1.094F, -6.0F, -5.5F, 2.0F, 12.0F, 11.0F, new CubeDeformation(0.0F))
                .texOffs(76, 109).addBox(-1.1935F, -5.5F, -6.0F, 2.0F, 11.0F, 12.0F, new CubeDeformation(0.0F))
                .texOffs(95, 33).addBox(-1.2929F, -5.0F, -6.5F, 2.0F, 10.0F, 13.0F, new CubeDeformation(0.0F))
                .texOffs(77, 61).addBox(-1.3924F, -4.5F, -7.0F, 2.0F, 9.0F, 14.0F, new CubeDeformation(0.0F))
                .texOffs(0, 60).addBox(-1.4918F, -3.5F, -7.5F, 2.0F, 7.0F, 15.0F, new CubeDeformation(0.0F))
                .texOffs(0, 40).addBox(-1.5913F, -2.0F, -8.0F, 3.0F, 4.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.7854F, 0.0F));

        return LayerDefinition.create(meshdefinition, 256, 256);
    }

        public void render(CircleSphereEntity p_114162_, float p_114163_, float p_114164_, PoseStack p_114165_, MultiBufferSource p_114166_, int p_114167_) {
            float f1 = ((float)p_114162_.time + p_114164_) * 30.0F;
            p_114165_.pushPose();
            VertexConsumer vertexconsumer = p_114166_.getBuffer(RENDER_TYPE);
            p_114165_.pushPose();
            p_114165_.scale(1.0F, 1.0F, 1.0F);
            p_114165_.translate(0.0D, 0.0D, 0.0D);
            //p_114165_.mulPose(new Quaternion(new Vector3f(SIN_45, 0.0F, SIN_45), 60.0F, true));
           // p_114165_.mulPose(Vector3f.YP.rotationDegrees(f1));
            int i = OverlayTexture.NO_OVERLAY;
            this.bone.render(p_114165_, vertexconsumer, p_114167_, i);

            p_114165_.popPose();
            p_114165_.popPose();

            super.render(p_114162_, p_114163_, p_114164_, p_114165_, p_114166_, p_114167_);
        }



        public ResourceLocation getTextureLocation(CircleSphereEntity p_114157_) {
            return END_CRYSTAL_LOCATION;
        }

    }

Blockbench

https://ibb.co/wgXYKQm

World Spawn

https://ibb.co/GMtS2Sd

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.