= 创作分享 =
编程开发
有谁帮忙看看问题出在哪吗?(Fabric 1.19.3) ...
墨言魂靈

有谁帮忙看看问题出在哪吗?(Fabric 1.19.3)

墨言魂靈 于 2023-1-16 10:49 ( 1年前 ) [复制链接] [只看楼主] [打印]
499 0
本帖最后由 InkSoul 于 2023-1-16 10:53 编辑

有谁帮忙看看问题出在哪吗?(Fabric 1.19.3)
  1. @Redirect(at = @At(value="INVOKE",target = "Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;"),method = "onTakeItem")
  2.     public ItemStack removeStackProxy(CraftingInventory input, int slot, int amount){
  3.         if(input.getStack(slot).getItem() instanceof CraftingToolIm o){
  4.             var save = input.getStack(slot).copy();
  5.             save.damage(o.getDamageStep(), Random.create(), null);
  6.             input.setStack(slot, save);
  7.         }else{
  8.             //input.removeStack(slot, amount);
  9.         }
  10.         return new ItemStack(Items.AIR);
  11.     }
  12.     /*每次都因为 Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure:Redirector removeStackProxy(Lnet/minecraft/inventory/CraftingInventory;II)Lnet/minecraft/item/ItemStack; in crafttech.mixins.json:CraftingMixin from mod crafttech failed injection check, (0/1) succeeded. Scanned 1 target(s). No refMap loaded. 崩溃*/
复制代码
(真的不太懂Mixin,1.19.3没法直接Overwrite)



城市喧闹,森林归宿。
终有一天,钢筋的海洋会在硝烟中化为尘土。
而那些阴影下的朝阳后裔,将重新统治这个世界
罪恶的本源出自于何?无非是过度的生气
发表于 2023-1-16 10:49:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

回复 | 举报

该帖共收到 0 条回复!
百科目前不允许匿名发帖哦~ 请先 [ 登陆 ][ 注册 ] 吧~

本版积分规则

发新帖
  • 回复
  • 点评
  • 评分

[ MC百科(mcmod.cn) 除另有声明,所有开放公共编辑的内容均使用 BY-NC-SA 3.0 协议 ]

Minecraft百科CC协议
快速回复 返回顶部 返回列表