Skip to content

Commit

Permalink
Updated to 1.20.4.
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Feb 21, 2024
1 parent fca6570 commit 4a81609
Show file tree
Hide file tree
Showing 48 changed files with 150 additions and 161 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Gradle Build

on:
push:
workflow_dispatch:

jobs:
build-gradle-project:
Expand All @@ -21,4 +22,6 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: build
path: build/libs
path: |
catsplus-fabric/build/libs/catsplus-fabric-[0-9.]*.jar
retention-days: 90
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

.architectury-transformer/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Make cats in Minecraft more fun!
- [ ] Tell me your ideas.

## About MeowBot233
MeowBot233, the main developer of CatsPlus, was passed away on September 16, 2023, due to Ewing's sarcoma.
MeowBot233, the creator of CatsPlus, was passed away on September 16, 2023, due to Ewing's sarcoma.
We will always remember her.
This project will be continually maintained by CuteNekoOwO organize and qyl27.
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ allprojects {
}

loom {
accessWidenerPath = file('src/main/resources/catsplus.accesswidener')
}

repositories {

}

dependencies {
Expand Down Expand Up @@ -94,8 +94,4 @@ architectury {
common(project.enabled_platforms.split(','))
}

loom {
accessWidenerPath = file('src/main/resources/catsplus.accesswidener')
}

sourceSets.main.resources.srcDir 'src/main/generated'
1 change: 1 addition & 0 deletions catsplus-fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ loom {
dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modApi "dev.architectury:architectury-fabric:${project.architectury_version}"

common(project(path: ':', configuration: 'namedElements')) { transitive = false }
shadowCommon(project(path: ':', configuration: 'transformProductionFabric')) { transitive = false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package cuteneko.catsplus.fabric;

import cuteneko.catsplus.CatsPlus;
import cuteneko.catsplus.fabric.platform.CatsPlusFabricPlatform;
import net.fabricmc.api.ModInitializer;

public class CatsPlusFabric implements ModInitializer {
private final CatsPlus mod;

public CatsPlusFabric() {
mod = new CatsPlus();
mod.setPlatform(new CatsPlusFabricPlatform());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cuteneko.catsplus.fabric;

import cuteneko.catsplus.fabric.platform.CatPlayer;
import cuteneko.catsplus.fabric.platform.GeniusCat;
import cuteneko.catsplus.platform.ICatPlayer;
import cuteneko.catsplus.platform.IGeniusCat;
import net.minecraft.entity.passive.CatEntity;
import net.minecraft.entity.player.PlayerEntity;

public class CatsPlusPlatformImpl {
public static ICatPlayer getCatPlayer(PlayerEntity player) {
return new CatPlayer(player);
}

public static IGeniusCat getGeniusCat(CatEntity cat) {
return new GeniusCat(cat);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CatsPlusFabricClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ModelPredicateProviderRegistry.register(
ModItems.CAT_BAG,
ModItems.CAT_BAG.get(),
new Identifier("catsplus", "cat"),
(itemStack, clientWorld, livingEntity, index) -> {
if(!itemStack.hasNbt() || !Objects.requireNonNull(itemStack.getNbt()).contains("Cat")) {
Expand All @@ -38,8 +38,8 @@ public void onInitializeClient() {
});

ColorProviderRegistry.ITEM.register(
((stack, tintIndex) -> tintIndex > 0 ? -1 : ((DyeableItem) stack.getItem()).getColor(stack)),
ModItems.CAT_BAG
((stack, tintIndex) -> tintIndex > 0 ? -1 : ((DyeableItem) stack.getItem()).getColor(stack)),
ModItems.CAT_BAG.get()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public void generateBlockStateModels(BlockStateModelGenerator generator) {

@Override
public void generateItemModels(ItemModelGenerator generator) {
generator.register(ModItems.TOTEMEOW, Models.GENERATED);
generator.register(ModItems.TOTEMEOW.get(), Models.GENERATED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
import cuteneko.catsplus.item.ModItems;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.data.server.recipe.RecipeJsonProvider;
import net.minecraft.data.server.recipe.RecipeExporter;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
import net.minecraft.item.Items;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.registry.tag.TagKey;

import java.util.function.Consumer;

public class ModRecipeProvider extends FabricRecipeProvider {
public ModRecipeProvider(FabricDataOutput output) {
super(output);
}

private static <T> String hasTag(TagKey<T> tag) {
return "has_tag_" + tag.id().getNamespace() + "_" + tag.id().getPath();
}

@Override
public void generate(Consumer<RecipeJsonProvider> exporter) {
ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, ModItems.CAT_BAG)
public void generate(RecipeExporter exporter) {
ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, ModItems.CAT_BAG.get())
.pattern("LLL")
.pattern("LGL")
.pattern("LLL")
Expand All @@ -29,7 +31,7 @@ public void generate(Consumer<RecipeJsonProvider> exporter) {
.criterion(hasItem(Items.GLASS_PANE), conditionsFromItem(Items.GLASS_PANE))
.offerTo(exporter);

ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, ModItems.TOTEMEOW)
ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, ModItems.TOTEMEOW.get())
.pattern("FFF")
.pattern("FTF")
.pattern("FFF")
Expand All @@ -39,8 +41,4 @@ public void generate(Consumer<RecipeJsonProvider> exporter) {
.criterion(hasItem(Items.TOTEM_OF_UNDYING), conditionsFromItem(Items.TOTEM_OF_UNDYING))
.offerTo(exporter);
}

private static <T> String hasTag(TagKey<T> tag) {
return "has_tag_" + tag.id().getNamespace() + "_" + tag.id().getPath();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ public ModLangProviderENUS(FabricDataOutput dataOutput) {

@Override
public void generateTranslations(TranslationBuilder builder) {
builder.add(ModItems.CAT_BAG, "Cat Bag");
builder.add(ModItems.TOTEMEOW, "Totemeow");
builder.add(ModItems.CAT_SPIRIT, "Cat Spirit");
builder.add(ModItems.FANG_LUO, "Paper Model of Fang_Luo");
builder.add(Constants.MESSAGE_FANG_LUO_DESCRIPTION, "Don't be sad, have a hug..."); // Don't change to other language when translating.
builder.add(ModItems.CAT_BAG.get(), "Cat Bag");
builder.add(ModItems.TOTEMEOW.get(), "Totemeow");
builder.add(ModItems.CAT_SPIRIT.get(), "Cat Spirit");
builder.add(ModItems.FANG_LUO.get(), "Doll of Fang_Luo");
builder.add(Constants.MESSAGE_FANG_LUO_DESCRIPTION_1, "In memory of Fang_Luo, a girl who was passed away because of cancer.");
builder.add(Constants.MESSAGE_FANG_LUO_DESCRIPTION_2, "Rest in peace.");

builder.add(ModBlocks.CAT_RESURRECTION_STATION_BLOCK, "Cat Resurrection Station");
builder.add(ModBlocks.CAT_RESURRECTION_STATION_BLOCK.get(), "Cat Resurrection Station");

builder.add(ModEffects.CATTIFY, "Cattify");
builder.add(ModEffects.CATTIFY.get(), "Cattify");
builder.add(Constants.MESSAGE_CATTIFY_POTION, "Potion of Cattify");
builder.add(Constants.MESSAGE_CATTIFY_SPLASH_POTION, "Splash Potion of Cattify");
builder.add(Constants.MESSAGE_CATTIFY_LINGERING_POTION, "Lingering Potion of Cattify");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ public ModLangProviderZHCN(FabricDataOutput dataOutput) {

@Override
public void generateTranslations(TranslationBuilder builder) {
builder.add(ModItems.CAT_BAG, "猫包");
builder.add(ModItems.TOTEMEOW, "不死猫腾");
builder.add(ModItems.CAT_SPIRIT, "猫魂");
builder.add(ModItems.FANG_LUO, "坊洛纸模");
builder.add(Constants.MESSAGE_FANG_LUO_DESCRIPTION, "Don't be sad, have a hug...");
builder.add(ModItems.CAT_BAG.get(), "猫包");
builder.add(ModItems.TOTEMEOW.get(), "不死猫腾");
builder.add(ModItems.CAT_SPIRIT.get(), "猫魂");
builder.add(ModItems.FANG_LUO.get(), "坊洛玩偶");
builder.add(Constants.MESSAGE_FANG_LUO_DESCRIPTION_1, "纪念因肿瘤离去的坊洛。");
builder.add(Constants.MESSAGE_FANG_LUO_DESCRIPTION_2, "缅怀……");

builder.add(ModBlocks.CAT_RESURRECTION_STATION_BLOCK, "猫咪复活台");
builder.add(ModBlocks.CAT_RESURRECTION_STATION_BLOCK.get(), "猫咪复活台");

builder.add(ModEffects.CATTIFY, "猫咪化");
builder.add(ModEffects.CATTIFY.get(), "猫咪化");
builder.add(Constants.MESSAGE_CATTIFY_POTION, "变猫药水");
builder.add(Constants.MESSAGE_CATTIFY_SPLASH_POTION, "喷溅型变猫药水");
builder.add(Constants.MESSAGE_CATTIFY_LINGERING_POTION, "滞留型变猫药水");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void setCatEntity(CatEntity cat) {

@Override
public boolean isCat() {
return ((IPlayerEntityMixin) player).catsplus$isCat() || player.hasStatusEffect(ModEffects.CATTIFY);
return ((IPlayerEntityMixin) player).catsplus$isCat() || player.hasStatusEffect(ModEffects.CATTIFY.get());
}

@Override
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ yarn_mappings=1.20.4+build.3
forge_version=49.0.30

# Fabric
fabric_loader_version=0.14.22
fabric_api_version=0.89.0+1.20.1
fabric_loader_version=0.15.7
fabric_api_version=0.96.3+1.20.4

# NeoForge
neoforge_version=20.4.164
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-09-25T00:10:16.3559439 Cats+/Language (en_us)
295247ddfa3bea24c93b6e2779951f8bb72f67bb assets\catsplus\lang\en_us.json
// 1.20.4 2024-02-21T08:45:46.2924207 Cats+/Language (en_us)
8e251fab5ce5c3f45ea9ac58c25f48ec8466f03f assets\catsplus\lang\en_us.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-09-25T00:10:16.357944 Cats+/Language (zh_cn)
2aa6d1f2a7eb3fe8dcca1abc59010c2d9ea8ff24 assets\catsplus\lang\zh_cn.json
// 1.20.4 2024-02-21T08:45:46.2934204 Cats+/Language (zh_cn)
06df21f6ac57e8fe479a3cec1a60e08adbdf3cdb assets\catsplus\lang\zh_cn.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 1.20.1 2023-09-25T00:10:16.3569444 Cats+/Recipes
36b9feb6d9d01a7e0fa439a01a836ab48f73eee5 data\catsplus\recipes\totemeow.json
b8d76dca507e0850a888665bbe7669701f74f276 data\catsplus\advancements\recipes\tools\totemeow.json
a45c02ea11e144fc2c69b3054203479d4938ab85 data\catsplus\recipes\cat_bag.json
d82f6327d70102537e79bb588482a93e760dbc15 data\catsplus\advancements\recipes\tools\cat_bag.json
// 1.20.4 2024-02-21T08:45:46.2934204 Cats+/Recipes
241ff3a315e1d01731c5b1b8f98108af0ab6656b data\catsplus\advancements\recipes\tools\cat_bag.json
10847e82ba25bc5c21abff40e303a1c023a77613 data\catsplus\recipes\totemeow.json
561f81e965a426c518aba9734d7fb823257b8eb5 data\catsplus\recipes\cat_bag.json
1e78d96156f59459b01f431a870f6a34699012fb data\catsplus\advancements\recipes\tools\totemeow.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-09-25T00:10:16.3569444 Cats+/Model Definitions
// 1.20.4 2024-02-21T08:45:46.2924207 Cats+/Model Definitions
882a1bd93aa3b1750ec3f9e2176a49e5561f45a9 assets\catsplus\models\item\totemeow.json
5 changes: 3 additions & 2 deletions src/main/generated/assets/catsplus/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"item.catsplus.cat_bag.has_cat_named": "%1$s Inside!",
"item.catsplus.cat_bag.no_cat": "Empty.",
"item.catsplus.cat_spirit": "Cat Spirit",
"item.catsplus.fang_luo": "Paper Model of Fang_Luo",
"item.catsplus.fang_luo.desc": "Don't be sad, have a hug...",
"item.catsplus.fang_luo": "Doll of Fang_Luo",
"item.catsplus.fang_luo.desc.1": "In memory of Fang_Luo, a girl who was passed away because of cancer.",
"item.catsplus.fang_luo.desc.2": "Rest in peace.",
"item.catsplus.totemeow": "Totemeow",
"item.minecraft.lingering_potion.effect.cattify": "Lingering Potion of Cattify",
"item.minecraft.potion.effect.cattify": "Potion of Cattify",
Expand Down
5 changes: 3 additions & 2 deletions src/main/generated/assets/catsplus/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"item.catsplus.cat_bag.has_cat_named": "%1$s 在里面!",
"item.catsplus.cat_bag.no_cat": "空的。",
"item.catsplus.cat_spirit": "猫魂",
"item.catsplus.fang_luo": "坊洛纸模",
"item.catsplus.fang_luo.desc": "Don't be sad, have a hug...",
"item.catsplus.fang_luo": "坊洛玩偶",
"item.catsplus.fang_luo.desc.1": "纪念因肿瘤离去的坊洛。",
"item.catsplus.fang_luo.desc.2": "缅怀……",
"item.catsplus.totemeow": "不死猫腾",
"item.minecraft.lingering_potion.effect.cattify": "滞留型变猫药水",
"item.minecraft.potion.effect.cattify": "变猫药水",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@
},
"requirements": [
[
"has_the_recipe",
"has_leather",
"has_glass_pane",
"has_the_recipe"
"has_glass_pane"
]
],
"rewards": {
"recipes": [
"catsplus:cat_bag"
]
},
"sends_telemetry_event": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
},
"requirements": [
[
"has_the_recipe",
"has_tag_minecraft_fishes",
"has_totem_of_undying",
"has_the_recipe"
"has_totem_of_undying"
]
],
"rewards": {
"recipes": [
"catsplus:totemeow"
]
},
"sends_telemetry_event": false
}
}
3 changes: 1 addition & 2 deletions src/main/generated/data/catsplus/recipes/cat_bag.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
],
"result": {
"item": "catsplus:cat_bag"
},
"show_notification": true
}
}
3 changes: 1 addition & 2 deletions src/main/generated/data/catsplus/recipes/totemeow.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
],
"result": {
"item": "catsplus:totemeow"
},
"show_notification": true
}
}
11 changes: 0 additions & 11 deletions src/main/java/cuteneko/catsplus/CatsPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
import cuteneko.catsplus.effect.potion.ModPotions;
import cuteneko.catsplus.item.ModItems;
import cuteneko.catsplus.item.group.ModItemGroups;
import cuteneko.catsplus.platform.ICatsPlusPlatform;

public class CatsPlus {
public static final String MODID = "catsplus";

private static CatsPlus INSTANCE;

private ICatsPlusPlatform platform;

public CatsPlus() {
INSTANCE = this;
}
Expand All @@ -29,12 +26,4 @@ public void init() {
ModEffects.register();
ModPotions.register();
}

public void setPlatform(ICatsPlusPlatform platform) {
this.platform = platform;
}

public ICatsPlusPlatform getPlatform() {
return platform;
}
}
Loading

0 comments on commit 4a81609

Please sign in to comment.