MC百科社群
标题:
有谁帮忙看看问题出在哪吗?(Fabric 1.19.3)
[打印本页]
作者:
InkSoul
时间:
2023-1-16 10:49
标题:
有谁帮忙看看问题出在哪吗?(Fabric 1.19.3)
本帖最后由 InkSoul 于 2023-1-16 10:53 编辑
有谁帮忙看看问题出在哪吗?(Fabric 1.19.3)
@Redirect(at = @At(value="INVOKE",target = "Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;"),method = "onTakeItem")
public ItemStack removeStackProxy(CraftingInventory input, int slot, int amount){
if(input.getStack(slot).getItem() instanceof CraftingToolIm o){
var save = input.getStack(slot).copy();
save.damage(o.getDamageStep(), Random.create(), null);
input.setStack(slot, save);
}else{
//input.removeStack(slot, amount);
}
return new ItemStack(Items.AIR);
}
/*每次都因为 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)
欢迎光临 MC百科社群 (https://bbs.mcmod.cn/)
MC百科
|最大的MineCraft中文模组百科