-
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
26 changed files
with
257 additions
and
166 deletions.
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
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/15e558425d03769b4c939a16ffd55f843ac56d0f
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// 1.21.1 2024-12-29T17:32:40.4693369 Cats+/Language (en_us) | ||
// 1.21.1 2024-12-29T21:45:19.613345 Cats+/Language (en_us) | ||
4c954a23ddc8e4a06ac36b5dd90df1616bbb774f assets\catsplus\lang\en_us.json |
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/49e5c65ca1ab59f598f710846fb0f8d549021d95
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// 1.21.1 2024-12-29T17:32:40.4708451 Cats+/Language (zh_cn) | ||
// 1.21.1 2024-12-29T21:45:19.6143505 Cats+/Language (zh_cn) | ||
48c49b72a471aa7dc799813b98f69a62d1c6a0dc assets\catsplus\lang\zh_cn.json |
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/5e79d2cdbf486275146451d641b6d6e823f0432d
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 |
---|---|---|
@@ -1 +1 @@ | ||
// 1.21.1 2024-12-29T17:32:40.4708451 Cats+/Tags for minecraft:block | ||
// 1.21.1 2024-12-29T21:45:19.6143505 Cats+/Tags for minecraft:block |
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/aaa80d5935224bd236f347a63f6c896153bd61b8
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
// 1.21.1 2024-12-29T17:32:40.4708451 Cats+/Tags for minecraft:item | ||
// 1.21.1 2024-12-29T21:45:19.6143505 Cats+/Tags for minecraft:item | ||
bc229f680fa773a41269c1569f5a700f669eb8e5 data\catsplus\tags\item\cooked_fishes.json | ||
95b8ddf7fc19e46661b4d7924f76d5bab642dbfe data\catsplus\tags\item\cat_interactable.json |
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/d5ee957bafb940ae78b04b56b65ec8b9002aa9dc
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
src/generated/resources/.cache/dcf38aaf6b2f28016e34adbe561ad13afee480c8
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// 1.21.1 2024-12-29T17:32:40.4698411 Cats+/Model Definitions | ||
// 1.21.1 2024-12-29T21:45:19.613345 Cats+/Model Definitions | ||
882a1bd93aa3b1750ec3f9e2176a49e5561f45a9 assets\catsplus\models\item\totemeow.json |
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/catsplus/tags/item/cat_interactable.json
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,6 @@ | ||
{ | ||
"values": [ | ||
"catsplus:cat_bag", | ||
"catsplus:totemeow" | ||
] | ||
} |
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,15 @@ | ||
package cuteneko.catsplus.bridge; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public interface ICatBridge { | ||
boolean catsplus$isSoundPlaying(); | ||
|
||
@NotNull | ||
BlockPos catsplus$getSoundSource(); | ||
|
||
void catsplus$startSound(@NotNull BlockPos pos); | ||
|
||
void catsplus$stopSound(); | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cuteneko.catsplus.item; | ||
|
||
import cuteneko.catsplus.CatsPlusData; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.entity.animal.Cat; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class TotemeowItem extends Item { | ||
public TotemeowItem(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public @NotNull InteractionResult interactLivingEntity(ItemStack stack, Player player, LivingEntity entity, InteractionHand hand) { | ||
if (entity instanceof Cat cat) { | ||
var geniusCat = CatsPlusData.getGeniusCat(cat); | ||
if (geniusCat.hasTotem()) { | ||
return InteractionResult.FAIL; | ||
} | ||
|
||
geniusCat.setTotem(true); | ||
stack.shrink(1); | ||
return InteractionResult.SUCCESS; | ||
} | ||
|
||
return super.interactLivingEntity(stack, player, entity, hand); | ||
} | ||
} |
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
33 changes: 0 additions & 33 deletions
33
src/main/java/cuteneko/catsplus/mixin/client/dancing/CatModelMixin.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/main/java/cuteneko/catsplus/mixin/client/musician/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package cuteneko.catsplus.mixin.client.musician; | ||
|
||
import cuteneko.catsplus.bridge.ICatBridge; | ||
import net.minecraft.client.model.CatModel; | ||
import net.minecraft.client.model.OcelotModel; | ||
import net.minecraft.client.model.geom.ModelPart; | ||
import net.minecraft.util.Mth; | ||
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.CallbackInfo; | ||
|
||
@Mixin(CatModel.class) | ||
public abstract class CatModelMixin<T extends Cat> | ||
extends OcelotModel<T> { | ||
|
||
public CatModelMixin(ModelPart root) { | ||
super(root); | ||
} | ||
|
||
@Inject(method = "setupAnim(Lnet/minecraft/world/entity/animal/Cat;FFFFF)V", at = @At("TAIL")) | ||
public void catsplus$setupAnim(T cat, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, CallbackInfo ci) { | ||
// Random shake head to left or right. | ||
|
||
var bridge = (ICatBridge) cat; | ||
if (!bridge.catsplus$isSoundPlaying()) { | ||
return; | ||
} | ||
|
||
var type = Math.floorMod(cat.getUUID().getLeastSignificantBits(), 4); | ||
|
||
if (type == 0 || type == 1) { | ||
var bias = type == 0 ? -0.8F : 0.8F; | ||
this.head.xRot = Mth.sin(ageInTicks * bias) * 0.3f; | ||
this.head.yRot = Mth.cos(ageInTicks * bias) * -0.3f; | ||
} else if (type == 2 || type == 3) { | ||
var bias = type == 2 ? -0.8F : 0.8F; | ||
this.head.xRot = Mth.cos(ageInTicks * bias) * 0.3f; | ||
this.head.yRot = Mth.sin(ageInTicks * bias) * -0.3f; | ||
} | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
src/main/java/cuteneko/catsplus/mixin/dancing/CatMixin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.