forked from zhaixianyu/litematica-printer
-
-
Notifications
You must be signed in to change notification settings - Fork 31
新增功能: 将选区内容器中的物品算做材料列表中的已有物品 #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
425577a
feat: 获取选区内容器材料列表
Cjsah f22710d
feat: 添加选区材料配置和应用逻辑
Cjsah fbaf6ba
feat: 添加i18n翻译和容器内物品处理
Cjsah 274c99c
refactor: 移除未使用的导入和注释
Cjsah 5e368c3
Merge remote-tracking branch 'refs/remotes/center/master'
Cjsah 881e65b
refactor: 1.20.4+ 才有收纳袋对应的物品处理
Cjsah 7abd364
feat: 设置deprecation的忽略注解只在1.21.11生效
Cjsah 4bbe296
feat: 合并util方法
Cjsah 539f6ab
feat: 解决多版本问题
Cjsah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
38 changes: 38 additions & 0 deletions
38
.../me/aleksilassila/litematica/printer/mixin/printer/litematica/MixinMaterialListUtils.java
This file contains hidden or 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,38 @@ | ||
| package me.aleksilassila.litematica.printer.mixin.printer.litematica; | ||
|
|
||
| import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
| import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
| import fi.dy.masa.litematica.materials.MaterialListUtils; | ||
| import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; | ||
| import me.aleksilassila.litematica.printer.utils.LitematicaUtils; | ||
| import net.minecraft.world.Container; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.injection.At; | ||
|
|
||
| //#if MC >= 260000 | ||
| //$$ import fi.dy.masa.malilib.util.data.ItemType; | ||
| //#else | ||
| import fi.dy.masa.malilib.util.ItemType; | ||
| //#endif | ||
|
|
||
| @Mixin(MaterialListUtils.class) | ||
| public class MixinMaterialListUtils { | ||
| //#if MC == 12111 | ||
| @SuppressWarnings("deprecation") | ||
| //#endif | ||
| @WrapOperation(method = "getMaterialList", at = @At(value = "INVOKE", target = "Lfi/dy/masa/litematica/materials/MaterialListUtils;getInventoryItemCounts(Lnet/minecraft/world/Container;)Lit/unimi/dsi/fastutil/objects/Object2IntOpenHashMap;")) | ||
| private static Object2IntOpenHashMap<ItemType> initApplySelectionArea(Container inv, Operation<Object2IntOpenHashMap<ItemType>> original) { | ||
| Object2IntOpenHashMap<ItemType> result = original.call(inv); | ||
| LitematicaUtils.applySelectionArea(result); | ||
| return result; | ||
| } | ||
| //#if MC == 12111 | ||
| @SuppressWarnings("deprecation") | ||
| //#endif | ||
| @WrapOperation(method = "updateAvailableCounts", at = @At(value = "INVOKE", target = "Lfi/dy/masa/litematica/materials/MaterialListUtils;getInventoryItemCounts(Lnet/minecraft/world/Container;)Lit/unimi/dsi/fastutil/objects/Object2IntOpenHashMap;")) | ||
| private static Object2IntOpenHashMap<ItemType> updateApplySelectionArea(Container inv, Operation<Object2IntOpenHashMap<ItemType>> original) { | ||
| Object2IntOpenHashMap<ItemType> result = original.call(inv); | ||
| LitematicaUtils.applySelectionArea(result); | ||
| return result; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.