-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update models of archgrey, grey, commetcube for animation #244
Open
Nimu93
wants to merge
1
commit into
TeamGalacticraft:minecraft/1.19+machinelib
Choose a base branch
from
Nimu93:minecraft/1.19+machinelib
base: minecraft/1.19+machinelib
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,13 +24,19 @@ | |
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import dev.galacticraft.mod.content.entity.GazerEntity; | ||
import net.minecraft.client.model.AnimationUtils; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.model.HumanoidModel; | ||
import net.minecraft.client.model.geom.ModelPart; | ||
import net.minecraft.client.model.geom.PartPose; | ||
import net.minecraft.client.model.geom.builders.*; | ||
import net.minecraft.util.Mth; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.HumanoidArm; | ||
|
||
public class GazerEntityModel<T extends Entity> extends EntityModel<T> { | ||
public class GazerEntityModel<T extends GazerEntity> extends EntityModel<T> { | ||
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor | ||
private final ModelPart Body; | ||
private final ModelPart Left_Arm; | ||
|
@@ -52,31 +58,79 @@ public static LayerDefinition createBodyLayer() { | |
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition Body = partdefinition.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 59).addBox(-4.0F, -13.0F, -3.0F, 8.0F, 7.0F, 8.0F, new CubeDeformation(0.0F)) | ||
partdefinition.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 59).addBox(-4.0F, -13.0F, -3.0F, 8.0F, 7.0F, 8.0F, new CubeDeformation(0.0F)) | ||
.texOffs(82, 32).mirror().addBox(-4.0F, -6.0F, -3.0F, 4.0F, 4.0F, 8.0F, new CubeDeformation(0.0F)).mirror(false) | ||
.texOffs(87, 71).addBox(0.0F, -6.0F, -3.0F, 4.0F, 4.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); | ||
|
||
PartDefinition Left_Arm = partdefinition.addOrReplaceChild("Left_Arm", CubeListBuilder.create().texOffs(54, 59).mirror().addBox(-2.0F, 0.0F, -2.0F, 4.0F, 11.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false) | ||
partdefinition.addOrReplaceChild("Left_Arm", CubeListBuilder.create().texOffs(54, 59).mirror().addBox(-2.0F, 0.0F, -2.0F, 4.0F, 11.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false) | ||
.texOffs(58, 39).mirror().addBox(-2.0F, 8.0F, 2.0F, 4.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-6.0F, 13.0F, 3.0F)); | ||
|
||
PartDefinition Right_Arm = partdefinition.addOrReplaceChild("Right_Arm", CubeListBuilder.create().texOffs(54, 59).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 11.0F, 4.0F, new CubeDeformation(0.0F)) | ||
partdefinition.addOrReplaceChild("Right_Arm", CubeListBuilder.create().texOffs(54, 59).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 11.0F, 4.0F, new CubeDeformation(0.0F)) | ||
.texOffs(58, 39).addBox(-2.0F, 8.0F, 2.0F, 4.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(6.0F, 13.0F, 3.0F)); | ||
|
||
PartDefinition Left_leg = partdefinition.addOrReplaceChild("Left_leg", CubeListBuilder.create().texOffs(58, 0).mirror().addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(-0.01F)).mirror(false), PartPose.offset(-2.0F, 18.0F, 1.0F)); | ||
partdefinition.addOrReplaceChild("Left_leg", CubeListBuilder.create().texOffs(58, 0).mirror().addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(-0.01F)).mirror(false), PartPose.offset(-2.0F, 18.0F, 1.0F)); | ||
|
||
PartDefinition Right_leg = partdefinition.addOrReplaceChild("Right_leg", CubeListBuilder.create().texOffs(58, 0).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(-0.01F)), PartPose.offset(2.0F, 18.0F, 2.0F)); | ||
partdefinition.addOrReplaceChild("Right_leg", CubeListBuilder.create().texOffs(58, 0).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(-0.01F)), PartPose.offset(2.0F, 18.0F, 2.0F)); | ||
|
||
PartDefinition Head = partdefinition.addOrReplaceChild("Head", CubeListBuilder.create().texOffs(0, 39).addBox(-11.0F, -6.01F, -7.0F, 22.0F, 6.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 11.0F, 1.0F)); | ||
PartDefinition head = partdefinition.addOrReplaceChild("Head", CubeListBuilder.create().texOffs(0, 39).addBox(-11.0F, -6.01F, -7.0F, 22.0F, 6.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 11.0F, 1.0F)); | ||
|
||
PartDefinition Mouth = Head.addOrReplaceChild("Mouth", CubeListBuilder.create().texOffs(0, 0).addBox(-11.0F, -23.0F, -14.0F, 22.0F, 25.0F, 14.0F, new CubeDeformation(0.0F)) | ||
head.addOrReplaceChild("Mouth", CubeListBuilder.create().texOffs(0, 0).addBox(-11.0F, -23.0F, -14.0F, 22.0F, 25.0F, 14.0F, new CubeDeformation(0.0F)) | ||
.texOffs(32, 59).addBox(-3.0F, -8.0F, -19.0F, 6.0F, 13.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -6.0F, 7.0F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 128, 128); | ||
} | ||
|
||
@Override | ||
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { | ||
|
||
public void setupAnim(T livingEntity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { | ||
/*boolean bl = livingEntity.getFallFlyingTicks() > 4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please dont leave commented out code in prs |
||
boolean bl2 = livingEntity.isVisuallySwimming(); | ||
this.Head.yRot = netHeadYaw * 0.017453292F; | ||
if (bl) { | ||
this.Head.xRot = -0.7853982F; | ||
} | ||
|
||
this.Head.xRot = headPitch * 0.017453292F; | ||
|
||
this.Body.yRot = 0.0F; | ||
this.Right_Arm.z = 0.0F; | ||
this.Right_Arm.x = -5.0F; | ||
this.Left_Arm.z = 0.0F; | ||
this.Left_Arm.x = 5.0F; | ||
float k = 1.0F; | ||
if (bl) { | ||
k = (float)livingEntity.getDeltaMovement().lengthSqr(); | ||
k /= 0.2F; | ||
k *= k * k; | ||
} | ||
|
||
if (k < 1.0F) { | ||
k = 1.0F; | ||
} | ||
|
||
this.Right_Arm.xRot = Mth.cos(limbSwing * 0.6662F + 3.1415927F) * 2.0F * limbSwingAmount * 0.5F / k; | ||
this.Left_Arm.xRot = Mth.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F / k; | ||
this.Right_Arm.zRot = 0.0F; | ||
this.Left_Arm.zRot = 0.0F; | ||
this.Right_leg.xRot = Mth.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount / k; | ||
this.Left_leg.xRot = Mth.cos(limbSwing * 0.6662F + 3.1415927F) * 1.4F * limbSwingAmount / k; | ||
this.Right_leg.yRot = 0.0F; | ||
this.Left_leg.yRot = 0.0F; | ||
this.Right_leg.zRot = 0.0F; | ||
this.Left_leg.zRot = 0.0F; | ||
|
||
this.Right_Arm.yRot = 0.0F; | ||
this.Left_Arm.yRot = 0.0F; | ||
this.Body.xRot = 0.0F; | ||
this.Right_leg.z = 0.1F; | ||
this.Left_leg.z = 0.1F; | ||
this.Right_leg.y = 12.0F; | ||
this.Left_leg.y = 12.0F; | ||
this.Head.y = 0.0F; | ||
this.Body.y = 0.0F; | ||
this.Left_Arm.y = 2.0F; | ||
this.Right_Arm.y = 2.0F; | ||
AnimationUtils.animateZombieArms(this.Left_Arm, this.Right_Arm, false,10,ageInTicks); | ||
*/ | ||
} | ||
|
||
@Override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats with all the weird field names? is there some model json somewhere that needs them referenced like that or is it just someone before you having a pr accepted without actually following our standards?