Skip to content

Commit

Permalink
[+] TACO CAT will be upside down.
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Dec 29, 2024
1 parent dc9b1e9 commit 4c14f64
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package cuteneko.catsplus.client.entity;

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.model.OcelotModel;
import net.minecraft.client.model.geom.ModelLayers;
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cuteneko.catsplus.mixin.client;

import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.OcelotModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.animal.Cat;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(LivingEntityRenderer.class)
public abstract class LivingEntityRendererMixin<T extends LivingEntity, M extends EntityModel<T>> extends EntityRenderer<T> implements RenderLayerParent<T, M> {
protected LivingEntityRendererMixin(EntityRendererProvider.Context context) {
super(context);
}

@Inject(method = "isEntityUpsideDown", at = @At("HEAD"), cancellable = true)
private static void catsplus$isEntityUpsideDown(LivingEntity entity, CallbackInfoReturnable<Boolean> cir) {
if (entity instanceof Cat cat && cat.hasCustomName() && cat.getCustomName() != null) {
var name = cat.getCustomName().getString();
if ("taco".equalsIgnoreCase(name)) {
cir.setReturnValue(true);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cuteneko.catsplus.mixin.cattify;
package cuteneko.catsplus.mixin.client.cattify;

import com.mojang.blaze3d.vertex.PoseStack;
import cuteneko.catsplus.client.entity.CatPlayerRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cuteneko.catsplus.mixin.dancing;
package cuteneko.catsplus.mixin.client.dancing;

import cuteneko.catsplus.CatsPlusData;
import net.minecraft.client.model.CatModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cuteneko.catsplus.mixin.paper_model;
package cuteneko.catsplus.mixin.client.paper_model;

import cuteneko.catsplus.item.ModItems;
import net.minecraft.client.model.HumanoidModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cuteneko.catsplus.mixin.paper_model;
package cuteneko.catsplus.mixin.client.paper_model;

import com.mojang.blaze3d.vertex.PoseStack;
import cuteneko.catsplus.item.ModItems;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cuteneko.catsplus.mixin.paper_model;
package cuteneko.catsplus.mixin.client.paper_model;

import cuteneko.catsplus.item.ModItems;
import net.minecraft.client.model.HumanoidModel;
Expand Down
11 changes: 6 additions & 5 deletions src/main/resources/catsplus-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
"totemeow.TamableAnimalMixin"
],
"client": [
"cattify.PlayerRendererMixin",
"dancing.CatModelMixin",
"paper_model.HumanoidModelMixin",
"paper_model.PlayerItemInHandLayerMixin",
"paper_model.PlayerRendererMixin"
"client.LivingEntityRendererMixin",
"client.cattify.PlayerRendererMixin",
"client.dancing.CatModelMixin",
"client.paper_model.HumanoidModelMixin",
"client.paper_model.PlayerItemInHandLayerMixin",
"client.paper_model.PlayerRendererMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 4c14f64

Please sign in to comment.