-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: 秋雨落 <[email protected]>
- Loading branch information
Showing
8 changed files
with
43 additions
and
12 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
src/main/java/cuteneko/catsplus/client/entity/CatPlayerRenderer.java
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
32 changes: 32 additions & 0 deletions
32
src/main/java/cuteneko/catsplus/mixin/client/LivingEntityRendererMixin.java
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 |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...us/mixin/cattify/PlayerRendererMixin.java → ...n/client/cattify/PlayerRendererMixin.java
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
2 changes: 1 addition & 1 deletion
2
...catsplus/mixin/dancing/CatModelMixin.java → ...s/mixin/client/dancing/CatModelMixin.java
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
2 changes: 1 addition & 1 deletion
2
...mixin/paper_model/HumanoidModelMixin.java → ...lient/paper_model/HumanoidModelMixin.java
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
2 changes: 1 addition & 1 deletion
2
...per_model/PlayerItemInHandLayerMixin.java → ...per_model/PlayerItemInHandLayerMixin.java
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
2 changes: 1 addition & 1 deletion
2
...ixin/paper_model/PlayerRendererMixin.java → ...ient/paper_model/PlayerRendererMixin.java
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