Jump to content

Minecraft client wings Cosmetics funktionieren nicht wie sie sollten (Textur)


tryyan

Recommended Posts

Hallo ich habe probiert cosmetics für meinen Minecraft client zu Programmieren. So weit so gut aber da man keinne Runden Objekte zu minecraft hinzfügen kann möchte ich gerne einfach die Textur rund machen. (Da es 2D ist) ober es nimmt schwartz an der stelle an der die textur blanck ist. Kann mir bitte jemand helfen?

 

 

 

package net.minecraft.client.model; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import java.util.List; import java.util.Random; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.CubeDeformation; import net.minecraft.client.model.geom.builders.CubeListBuilder; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; import net.minecraft.client.renderer.RenderType; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.HumanoidArm; import net.minecraft.world.entity.LivingEntity; public class PlayerModel<T extends LivingEntity> extends HumanoidModel<T> { private static final String EAR = "ear"; private static final String CLOAK = "cloak"; private static final String Wings = "wings"; private static final String LEFT_SLEEVE = "left_sleeve"; private static final String RIGHT_SLEEVE = "right_sleeve"; private static final String LEFT_PANTS = "left_pants"; private static final String RIGHT_PANTS = "right_pants"; private final List<ModelPart> parts; public final ModelPart leftSleeve; public final ModelPart rightSleeve; public final ModelPart leftPants; public final ModelPart rightPants; public final ModelPart jacket; private final ModelPart cloak; private final ModelPart wings; private final ModelPart ear; private final boolean slim; public PlayerModel(ModelPart pRoot, boolean pSlim) { super(pRoot, RenderType::entityTranslucent); this.slim = pSlim; this.ear = pRoot.getChilds("ear"); this.wings = pRoot.getChilds("bb_main"); this.cloak = pRoot.getChilds("cloak"); this.leftSleeve = pRoot.getChilds("left_sleeve"); this.rightSleeve = pRoot.getChilds("right_sleeve"); this.leftPants = pRoot.getChilds("left_pants"); this.rightPants = pRoot.getChilds("right_pants"); this.jacket = pRoot.getChilds("jacket"); this.parts = pRoot.getAllParts().filter((p_170824_) -> { return !p_170824_.isEmpty(); }).collect(ImmutableList.toImmutableList()); } public static MeshDefinition createMesh(CubeDeformation pCubeDeformation, boolean pSlim) { MeshDefinition meshdefinition = HumanoidModel.createMesh(pCubeDeformation, 0.0F); PartDefinition partdefinition = meshdefinition.getRoot(); CubeDeformation cubedeformation = new CubeDeformation(1.0F); partdefinition.addOrReplaceChild("ear", CubeListBuilder.create().texOffs(2400, 0).addBox(-3.0F, -6.0F, -1.0F, 6.0F, 6.0F, 1.0F, pCubeDeformation), PartPose.ZERO); partdefinition.addOrReplaceChild("cloak", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, 0.0F, -1.0F, 10.0F, 16.0F, 1.0F, pCubeDeformation, 1.0F, 0.5F), PartPose.offset(0.0F, 0.0F, 0.0F)); //PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -2.0F, -1.0F, 13.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); //PartDefinition cube_r1 = bb_main.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-10.0F, -6.0F, -1.0F, 16.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.5236F)); PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(10, 0).addBox(-6.5F, -8.0F, 0.0F, 12.0F, 8.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); PartDefinition cube_r1 = bb_main.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(6, 30).addBox(-6.0F, 0.0F, -0.5F, 6.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.5272F)); PartDefinition cube_r2 = bb_main.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(10, 0).addBox(-4.0F, 3.0F, -0.5F, 6.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 2.1817F)); PartDefinition cube_r3 = bb_main.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 0).addBox(-1.1F, 5.0F, -0.5F, 6.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 2.8362F)); PartDefinition cube_r4 = bb_main.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(0, 0).addBox(5.5F, -8.0F, -0.5F, 1.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, -1.309F)); PartDefinition cube_r5 = bb_main.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(4, 20).addBox(-2.0F, -7.0F, -1.0F, 6.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.2618F)); float f = 0.25F; if (pSlim) { partdefinition.addOrReplaceChild("left_arm", CubeListBuilder.create().texOffs(32, 48).addBox(-1.0F, -2.0F, -2.0F, 3.0F, 12.0F, 4.0F, pCubeDeformation), PartPose.offset(5.0F, 2.5F, 0.0F)); partdefinition.addOrReplaceChild("right_arm", CubeListBuilder.create().texOffs(40, 16).addBox(-2.0F, -2.0F, -2.0F, 3.0F, 12.0F, 4.0F, pCubeDeformation), PartPose.offset(-5.0F, 2.5F, 0.0F)); partdefinition.addOrReplaceChild("left_sleeve", CubeListBuilder.create().texOffs(48, 48).addBox(-1.0F, -2.0F, -2.0F, 3.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.offset(5.0F, 2.5F, 0.0F)); partdefinition.addOrReplaceChild("right_sleeve", CubeListBuilder.create().texOffs(40, 32).addBox(-2.0F, -2.0F, -2.0F, 3.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.offset(-5.0F, 2.5F, 0.0F)); } else { partdefinition.addOrReplaceChild("left_arm", CubeListBuilder.create().texOffs(32, 48).addBox(-1.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, pCubeDeformation), PartPose.offset(5.0F, 2.0F, 0.0F)); partdefinition.addOrReplaceChild("left_sleeve", CubeListBuilder.create().texOffs(48, 48).addBox(-1.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.offset(5.0F, 2.0F, 0.0F)); partdefinition.addOrReplaceChild("right_sleeve", CubeListBuilder.create().texOffs(40, 32).addBox(-3.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.offset(-5.0F, 2.0F, 0.0F)); } partdefinition.addOrReplaceChild("left_leg", CubeListBuilder.create().texOffs(16, 48).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, pCubeDeformation), PartPose.offset(1.9F, 12.0F, 0.0F)); partdefinition.addOrReplaceChild("left_pants", CubeListBuilder.create().texOffs(0, 48).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.offset(1.9F, 12.0F, 0.0F)); partdefinition.addOrReplaceChild("right_pants", CubeListBuilder.create().texOffs(0, 32).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.offset(-1.9F, 12.0F, 0.0F)); partdefinition.addOrReplaceChild("jacket", CubeListBuilder.create().texOffs(16, 32).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, pCubeDeformation.extend(0.25F)), PartPose.ZERO); return meshdefinition; } protected Iterable<ModelPart> bodyParts() { return Iterables.concat(super.bodyParts(), ImmutableList.of(this.leftPants, this.rightPants, this.leftSleeve, this.rightSleeve, this.jacket)); } public void renderEars(PoseStack pPoseStack, VertexConsumer pBuffer, int pPackedLight, int pPackedOverlay) { this.ear.copyFrom(this.head); this.ear.x = 0.0F; this.ear.y = 0.0F; this.ear.render(pPoseStack, pBuffer, pPackedLight, pPackedOverlay); } public void renderWings(PoseStack pPoseStack, VertexConsumer pBuffer, int pPackedLight, int pPackedOverlay) { this.wings.render(pPoseStack, pBuffer, pPackedLight, pPackedOverlay); } public void renderCloak(PoseStack pPoseStack, VertexConsumer pBuffer, int pPackedLight, int pPackedOverlay) { this.cloak.render(pPoseStack, pBuffer, pPackedLight, pPackedOverlay); } public void renderWing(PoseStack pPoseStack, VertexConsumer pBuffer, int pPackedLight, int pPackedOverlay) { this.wings.x = -10F; this.wings.y = 6.0F; this.wings.render(pPoseStack, pBuffer, pPackedLight, pPackedOverlay); } public void setupAnim(T pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { super.setupAnim(pEntity, pLimbSwing, pLimbSwingAmount, pAgeInTicks, pNetHeadYaw, pHeadPitch); this.leftPants.copyFrom(this.leftLeg); this.rightPants.copyFrom(this.rightLeg); this.leftSleeve.copyFrom(this.leftArm); this.rightSleeve.copyFrom(this.rightArm); this.jacket.copyFrom(this.body); this.jacket.copyFrom(this.body); if (pEntity.getItemBySlot(EquipmentSlot.CHEST).isEmpty()) { if (pEntity.isCrouching()) { this.cloak.z = 1.4F; this.cloak.y = 1.85F; } else { this.cloak.z = 0.0F; this.cloak.y = 0.0F; } } else if (pEntity.isCrouching()) { this.cloak.z = 0.3F; this.cloak.y = 0.8F; } else { this.cloak.z = -1.1F; this.cloak.y = -0.85F; } } public void setAllVisible(boolean pVisible) { super.setAllVisible(pVisible); this.leftSleeve.visible = pVisible; this.rightSleeve.visible = pVisible; this.leftPants.visible = pVisible; this.rightPants.visible = pVisible; this.jacket.visible = pVisible; this.cloak.visible = pVisible; this.ear.visible = pVisible; } public void translateToHand(HumanoidArm pSide, PoseStack pPoseStack) { ModelPart modelpart = this.getArm(pSide); if (this.slim) { float f = 0.5F * (float)(pSide == HumanoidArm.RIGHT ? 1 : -1); modelpart.x += f; modelpart.translateAndRotate(pPoseStack); modelpart.x -= f; } else { modelpart.translateAndRotate(pPoseStack); } } public ModelPart getRandomModelPart(Random pRandom) { return this.parts.get(pRandom.nextInt(this.parts.size())); } }

 

package LYX_Launcher.client.cosmetics; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Vector3f; import net.minecraft.client.model.PlayerModel; import net.minecraft.client.player.AbstractClientPlayer; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.RenderLayerParent; import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ambient.Bat; import net.minecraft.world.entity.animal.IronGolem; import net.minecraft.world.entity.player.PlayerModelPart; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.state.BlockState; import net.optifine.Config; import net.optifine.CustomItems; public class Wings1Layer extends RenderLayer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> { public Wings1Layer(RenderLayerParent<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> p_117346_) { super(p_117346_); } public void render(PoseStack pMatrixStack, MultiBufferSource pBuffer, int pPackedLight, AbstractClientPlayer pLivingEntity, float pLimbSwing, float pLimbSwingAmount, float pPartialTicks, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch) { if (pLivingEntity.isCapeLoaded() &&pLivingEntity.isModelPartShown(PlayerModelPart.JACKET)) { ItemStack itemstack = pLivingEntity.getItemBySlot(EquipmentSlot.CHEST); pMatrixStack.pushPose(); pMatrixStack.translate(0.0D, 0.0D, 0.125D); float f5 = Config.getAverageFrameTimeSec() * 20.0F; f5 = Config.limit(f5, 0.02F, 1.0F); VertexConsumer vertexconsumer = pBuffer.getBuffer(RenderType.entitySolid(pLivingEntity.getTextureLocation())); this.getParentModel().renderWing(pMatrixStack, vertexconsumer, pPackedLight, OverlayTexture.NO_OVERLAY); pMatrixStack.popPose(); } } }

https://www.swisstransfer.com/d/bb72f1b9-394c-410a-92d1-01ccde129c32 (Bild zum Problem)

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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