Skip to content

Commit

Permalink
Merge branch '1.20' into 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyploszaj committed Dec 2, 2023
2 parents 51495ca + 3eda554 commit f3ba9b2
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 18 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build
run: ./gradlew build
- name: Build Fabric
run: ./gradlew :fabric:build

- name: Build Forge
run: ./gradlew :forge:build

- name: Upload Artifacts
uses: actions/upload-artifact@v2
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,22 @@ jobs:
id: composite_version
run: echo "composite_version=${{ steps.mod_version.outputs.mod_version }}+${{ steps.minecraft_version.outputs.minecraft_version }}" >> $GITHUB_OUTPUT

- name: Build Fabric
env:
RELEASE: true
run: ./gradlew :fabric:build

- name: Build Forge
env:
RELEASE: true
run: ./gradlew :forge:build

- name: Publish
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
RELEASE: true
run: ./gradlew build publish modrinth curseforge -PmavenUrl="${{ secrets.MAVEN_URL }}" -PmavenUsername="${{ secrets.MAVEN_USERNAME }}" -PmavenPassword="${{ secrets.MAVEN_PASSWORD }}"
run: ./gradlew publish modrinth curseforge -PmavenUrl="${{ secrets.MAVEN_URL }}" -PmavenUsername="${{ secrets.MAVEN_USERNAME }}" -PmavenPassword="${{ secrets.MAVEN_PASSWORD }}"

- name: Create Release
id: create_release
Expand Down
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
### Additions
* Added option to use all registered items instead of creative tabs to source the index.
* Added tab scrolling on hover #308
* Added better support for JEI slot highlighting
* Updated Chinese translation

### Fixes
* Fixed ingredient serializer errors #354
* Fixed #346
* Fixed highlighting for mods like Refined Storage
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.19.4
enabled_platforms=fabric,forge

archives_base_name=emi
mod_version=1.0.25
mod_version=1.0.26
maven_group=dev.emi

architectury_version=4.9.83
Expand Down
16 changes: 9 additions & 7 deletions xplat/src/main/java/dev/emi/emi/jemi/JemiRecipeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public boolean supportsRecipe(EmiRecipe recipe) {

@Override
public boolean canCraft(EmiRecipe recipe, EmiCraftContext<T> context) {
IRecipeTransferError err = jeiCraft(recipe, context, false);
IRecipeTransferError err = jeiCraft(recipe, context, false, null);
return err == null || err.getType().allowsTransfer;
}

@Override
public boolean craft(EmiRecipe recipe, EmiCraftContext<T> context) {
IRecipeTransferError err = jeiCraft(recipe, context, true);
IRecipeTransferError err = jeiCraft(recipe, context, true, null);
if (err == null || err.getType().allowsTransfer) {
MinecraftClient.getInstance().setScreen(context.getScreen());
}
Expand All @@ -84,7 +84,9 @@ public boolean craft(EmiRecipe recipe, EmiCraftContext<T> context) {
@Override
public void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> widgets, MatrixStack raw) {
EmiDrawContext draw = EmiDrawContext.wrap(raw);
IRecipeTransferError err = jeiCraft(recipe, context, false);
R rawRecipe = getRawRecipe(recipe);
JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, widgets);
IRecipeTransferError err = jeiCraft(recipe, context, false, view);
if (err != null) {
if (err.getType() == IRecipeTransferError.Type.COSMETIC) {
for (Widget widget : widgets) {
Expand All @@ -94,8 +96,6 @@ public void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> wi
}
}
}
R rawRecipe = getRawRecipe(recipe);
JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, widgets);
if (view != null) {
view.getSlotViews().forEach(v -> {
if (v instanceof JemiRecipeSlot jrs) {
Expand All @@ -117,12 +117,14 @@ public void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> wi
}

@SuppressWarnings("unchecked")
private IRecipeTransferError jeiCraft(EmiRecipe recipe, EmiCraftContext<T> context, boolean craft) {
private IRecipeTransferError jeiCraft(EmiRecipe recipe, EmiCraftContext<T> context, boolean craft, JemiRecipeSlotsView view) {
try {
MinecraftClient client = MinecraftClient.getInstance();
R rawRecipe = getRawRecipe(recipe);

JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, List.of());
if (view == null) {
view = createSlotsView(recipe, rawRecipe, List.of());
}

if (view == null) {
return () -> IRecipeTransferError.Type.INTERNAL;
Expand Down
26 changes: 24 additions & 2 deletions xplat/src/main/resources/assets/emi/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"config.emi.tooltip.binds.view_tree": "查看配方树界面",
"key.emi.back": "返回",
"config.emi.tooltip.binds.back": "回到上一个打开的EMI界面",
"key.emi.forward": "前进",
"config.emi.tooltip.binds.forward": "在返回后重新打开被关闭的界面\n(就像浏览器的前进键)",
"key.emi.craft_one": "填充单次配方",
"config.emi.tooltip.binds.craft_one": "在当前工作方块中填充单次合成配方",
"key.emi.craft_all": "填充最大次配方",
Expand Down Expand Up @@ -51,6 +53,9 @@
"key.emi.hide_stack_by_id": "隐藏物品ID",
"key.emi.tooltip.hide_stack_by_id": "仅在编辑模式下生效:\n在EMI中隐藏所有与 光标选中物品 有相同ID的物品",

"emi.index_source.creative": "创造模式物品栏",
"emi.index_source.registered": "物品注册顺序",
"emi.index_source.creative_plus_registered": "创造物品栏+注册顺序",
"emi.help_level.verbose": "啰里吧嗦",
"emi.help_level.normal": "普通",
"emi.help_level.none": "隐藏",
Expand Down Expand Up @@ -113,6 +118,8 @@
"config.emi.tooltip.general.cheat_mode": "允许开启作弊时直接获得物品",
"config.emi.general.help_level": "引导等级",
"config.emi.tooltip.general.help_level": "EMI界面中物品提示框\n和帮助信息的数量",
"config.emi.general.index_source": "物品索引来源",
"config.emi.tooltip.general.index_source": "EMI应该以什么的顺序排序物品索引",
"config.emi.general.search_tooltip_by_default": "默认搜索包含物品提示",
"config.emi.tooltip.general.search_tooltip_by_default": "可以直接搜索物品提示框中的内容,\n而无需使用“#”前缀",
"config.emi.general.search_mod_name_by_default": "默认搜索包含模组名",
Expand Down Expand Up @@ -240,10 +247,12 @@
"config.emi.presets.binds": "热键预设",
"config.emi.presets.restore": "恢复与重置",

"config.emi.presets.productive": "高效工作",
"config.emi.tooltip.presets.productive": "右侧索引、左侧可合成、左上角收藏夹。\n完美利用EMI提供的功能!",
"config.emi.presets.recipe_book_plus": "配方书增强",
"config.emi.tooltip.presets.recipe_book_plus": "将左侧边栏缩小用作配方书(显示可合成物品),\n也可切换成收藏夹",
"config.emi.presets.empty_search_craftable": "未搜索时显示可合成物品",
"config.emi.tooltip.presets.empty_search_craftable": "右侧边栏使用“物品索引”与“可合成物品”:\n不搜索时显示可合成物品\n搜索时显示物品索引",
"config.emi.presets.recipe_book_plus": "配方书+",
"config.emi.tooltip.presets.recipe_book_plus": "将左侧边栏缩小用作配方书(显示可合成物品),\n也可切换成收藏夹",

"config.emi.presets.author_binds": "作者用的热键",
"config.emi.tooltip.presets.author_binds": "试试作者用的热键组合,说不定对你胃口呢?",
Expand Down Expand Up @@ -731,6 +740,19 @@
"tag.item.c.water_buckets": "水桶",
"tag.item.c.wrenches": "扳手",

"tag.item.c.budding_blocks": "生芽方块",
"tag.item.c.buds": "",
"tag.item.c.clusters": "群落",
"tag.item.c.entity_water_buckets": "实体水桶",
"tag.item.c.raw_ores": "粗矿",
"tag.item.c.red_sandstone_blocks": "红砂岩方块",
"tag.item.c.sandstone_blocks": "砂岩方块",
"tag.item.c.uncolored_sandstone_blocks": "未染色的砂岩方块",
"tag.item.c.uncolored_sandstone_slabs": "未染色的砂岩台阶",
"tag.item.c.uncolored_sandstone_stairs": "未染色的砂岩楼梯",
"tag.item.c.villager_job_sites": "村民工作方块",
"tag.item.c.wooden_barrels": "木桶",

"tag.item.c.armors": "盔甲",
"tag.item.c.armors.boots": "靴子",
"tag.item.c.armors.chestplates": "胸甲",
Expand Down

0 comments on commit f3ba9b2

Please sign in to comment.