Skip to content

Commit

Permalink
[C] Fix actions.
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 791260d commit dc9b1e9
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 39 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
Expand All @@ -21,7 +21,8 @@ jobs:
- name: Publish build
uses: actions/upload-artifact@v3
with:
name: build
name: artifacts
path: |
catsplus-fabric/build/libs/catsplus-fabric-[0-9.]+.jar
fabric/build/libs/*.jar
neoforge/build/libs/*.jar
retention-days: 90
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unified_publishing_version=0.1.+

# Mod
enabled_platforms=fabric,neoforge
archive_base_name=cats-plus
archive_base_name=catsplus
mod_id=catsplus
mod_version=1.0.0

Expand Down
57 changes: 30 additions & 27 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
modLoader="javafml"
loaderVersion="${neoforge_loader_version_range}"
license="MIT"
issueTrackerURL="https://github.com/CuteNekoOwO/CatsPlus/issues"
modLoader = "javafml"
loaderVersion = "${neoforge_loader_version_range}"
license = "MIT"
issueTrackerURL = "https://github.com/CuteNekoOwO/CatsPlus/issues"

[[mods]]
modId="catsplus"
version="${mod_version}"
displayName="Cats+"
displayURL="https://github.com/CuteNekoOwO/CatsPlus"
modId = "catsplus"
version = "${mod_version}"
displayName = "Cats+"
displayURL = "https://github.com/CuteNekoOwO/CatsPlus"
#logoFile=""
credits="CuteNekoOwO"
authors="MeowBot233, YukieMiona and qyl27"
displayTest="MATCH_VERSION"
description='''
credits = "CuteNekoOwO"
authors = "MeowBot233, YukieMiona and qyl27"
displayTest = "MATCH_VERSION"
description = '''
Make cats in Minecraft more fun!
'''

[[dependencies.catsplus]]
modId="neoforge"
mandatory=true
versionRange="${neoforge_version_range}"
ordering="NONE"
side="BOTH"
modId = "neoforge"
mandatory = true
versionRange = "${neoforge_version_range}"
ordering = "NONE"
side = "BOTH"

[[dependencies.catsplus]]
modId="minecraft"
mandatory=true
versionRange="${neoforge_minecraft_version_range}"
ordering="NONE"
side="BOTH"
modId = "minecraft"
mandatory = true
versionRange = "${neoforge_minecraft_version_range}"
ordering = "NONE"
side = "BOTH"

[[dependencies.catsplus]]
modId="sinocore"
mandatory=true
versionRange="${neoforge_sinocore_version_range}"
ordering="NONE"
side="BOTH"
modId = "sinocore"
mandatory = true
versionRange = "${neoforge_sinocore_version_range}"
ordering = "NONE"
side = "BOTH"

[[mixins]]
config = "catsplus-common.mixins.json"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.1 2024-12-29T17:25:32.8356958 Cats+/Language (en_us)
// 1.21.1 2024-12-29T17:32:40.4693369 Cats+/Language (en_us)
4c954a23ddc8e4a06ac36b5dd90df1616bbb774f assets\catsplus\lang\en_us.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.1 2024-12-29T17:25:32.8366935 Cats+/Language (zh_cn)
// 1.21.1 2024-12-29T17:32:40.4708451 Cats+/Language (zh_cn)
48c49b72a471aa7dc799813b98f69a62d1c6a0dc assets\catsplus\lang\zh_cn.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// 1.21.1 2024-12-29T17:25:32.8376931 Cats+/Tags for minecraft:block
// 1.21.1 2024-12-29T17:32:40.4708451 Cats+/Tags for minecraft:block
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.1 2024-12-29T17:25:32.8376931 Cats+/Tags for minecraft:item
// 1.21.1 2024-12-29T17:32:40.4708451 Cats+/Tags for minecraft:item
bc229f680fa773a41269c1569f5a700f669eb8e5 data\catsplus\tags\item\cooked_fishes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21.1 2024-12-29T17:25:32.8366935 Cats+/Recipes
// 1.21.1 2024-12-29T17:32:40.4698411 Cats+/Recipes
42d7ddfe18f0e54b5b8899b35b51d6317bd6746b data\catsplus\recipe\cat_bag.json
1e24c90e0b77a584a20cae12e030f5721fe2de72 data\catsplus\recipe\totemeow.json
bc8eed3e40d27434c01dc0762c38ea6444076bb2 data\catsplus\advancement\recipes\tools\cat_bag.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21.1 2024-12-29T17:25:32.8366935 Cats+/Model Definitions
// 1.21.1 2024-12-29T17:32:40.4698411 Cats+/Model Definitions
882a1bd93aa3b1750ec3f9e2176a49e5561f45a9 assets\catsplus\models\item\totemeow.json
10 changes: 9 additions & 1 deletion src/main/java/cuteneko/catsplus/mixin/CatMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ protected CatMixin(EntityType<? extends TamableAnimal> entityType, Level level)

@Inject(method = "isFood", at = @At("RETURN"), cancellable = true)
public void catsplus$isFood(ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
if (this.isTame()) {
if (isTame()) {
cir.setReturnValue(stack.is(ModItemTags.COOKED_FISHES));
}
}

@Inject(method = "usePlayerItem", at = @At("TAIL"))
protected void catsplus$eat(Player player, InteractionHand hand, ItemStack stack, CallbackInfo ci) {
if (!isTame()) {
return;
}

var geniusCat = CatsPlusData.getGeniusCat((Cat) (Object) this);

var intimacy = 1;
Expand All @@ -53,6 +57,10 @@ protected CatMixin(EntityType<? extends TamableAnimal> entityType, Level level)

@Inject(method = "mobInteract", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/animal/Cat;setOrderedToSit(Z)V"), cancellable = true)
public void catsplus$mobInteract(Player player, InteractionHand hand, CallbackInfoReturnable<InteractionResult> cir) {
if (!isTame()) {
return;
}

var geniusCat = CatsPlusData.getGeniusCat((Cat) (Object) this);

if (player.isShiftKeyDown() && !player.isVehicle() && !CattifyHelper.cattified(player)) {
Expand Down

0 comments on commit dc9b1e9

Please sign in to comment.