Skip to content

Commit

Permalink
Small finish touches
Browse files Browse the repository at this point in the history
  • Loading branch information
N1nn1 committed May 13, 2024
1 parent b7de2f1 commit 4777467
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected void renderBg(GuiGraphics poseStack, float partialTicks, int x, int y)
tropicalFish.noPhysics = true;
TropicalFish.Variant variant = new TropicalFish.Variant(TropicalFish.getPattern(tag), TropicalFish.getBaseColor(tag), TropicalFish.getPatternColor(tag));
((TropicalFishAccessor) tropicalFish).callSetPackedVariant(variant.getPackedId());
renderMovableEntity(poseStack, imgX + 107, imgY + 54, 40, tropicalFish, 1);
renderMovableEntity(poseStack, imgX + 107, imgY + 50, 40, tropicalFish, 1);
tropicalFish.discard();
}

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/ninni/spawn/mixin/client/AxolotlModelMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,44 @@

import net.minecraft.client.model.AgeableListModel;
import net.minecraft.client.model.AxolotlModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.world.entity.LerpingModel;
import net.minecraft.world.entity.animal.axolotl.Axolotl;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(AxolotlModel.class)
public abstract class AxolotlModelMixin<T extends Axolotl & LerpingModel> extends AgeableListModel<T> {

@Shadow @Final private ModelPart body;
@Shadow @Final private ModelPart head;
@Shadow @Final private ModelPart leftHindLeg;
@Shadow @Final private ModelPart rightHindLeg;
@Shadow @Final private ModelPart leftFrontLeg;
@Shadow @Final private ModelPart rightFrontLeg;
@Shadow @Final private ModelPart leftGills;
@Shadow @Final private ModelPart rightGills;
@Shadow @Final private ModelPart topGills;
@Shadow @Final private ModelPart tail;

@Inject(method = "setupAnim(Lnet/minecraft/world/entity/animal/axolotl/Axolotl;FFFFF)V", at = @At("HEAD"), cancellable = true)
private void setupAnim(T axolotl, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch, CallbackInfo ci) {
if (axolotl.noPhysics) {
ci.cancel();
this.body.setRotation(0.15f, 0, 0.0F);
this.head.setRotation(-0.25f, 0.0F, 0.0F);
this.leftHindLeg.setRotation(0.65f, 0.0F, 0.0F);
this.rightHindLeg.setRotation(0.625f, 0.0F, 0.0F);
this.leftFrontLeg.setRotation(0.5f, 0.0F, 0.0F);
this.rightFrontLeg.setRotation(0.475f, 0.0F, 0.0F);
this.leftGills.setRotation(0.0F, 0.25F, 0.0F);
this.rightGills.setRotation(0.0F, -0.25F, 0.0F);
this.topGills.setRotation(-0.25F, 0.0F, 0.0F);
this.tail.setRotation(0.15f, 1.0F, 0.0F);
}
}
}

0 comments on commit 4777467

Please sign in to comment.