Add stack-aware CraftingRemainingItem (#277)

* Add stack-aware CraftingRemainingItem
* Add JavaDocs

[norelease]
This commit is contained in:
shedaniel
2022-06-16 17:58:10 +08:00
committed by GitHub
parent 547f06f45e
commit 146fe8b8b9
3 changed files with 93 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
package dev.architectury.hooks.item;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
@@ -53,4 +54,28 @@ public final class ItemStackHooks {
}
}
}
/**
* Returns whether the given item stack has a remaining item after crafting.
* This method is stack-aware only on Forge.
*
* @param stack the item stack
* @return whether the given item stack has a remaining item after crafting
*/
@ExpectPlatform
public static boolean hasCraftingRemainingItem(ItemStack stack) {
throw new AssertionError();
}
/**
* Returns the remaining item for a given item stack after crafting.
* This method is stack-aware only on Forge.
*
* @param stack the item stack
* @return the remaining item for a given item stack after crafting
*/
@ExpectPlatform
public static ItemStack getCraftingRemainingItem(ItemStack stack) {
throw new AssertionError();
}
}