mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Add a hook to allow continuously using items through stack changes (#4834)
This commit is contained in:
1 parent
1a7e05a3da
commit
817546e4c8
4 files changed
+167
-7
No files matched your search
@@ -647,6 +647,20 @@ public interface IForgeItem
|
||||
&& (newStack.isDamageable() || newStack.getDamage() == oldStack.getDamage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called while an item is in 'active' use to determine if usage should
|
||||
* continue. Allows items to continue being used while sustaining damage, for
|
||||
* example.
|
||||
*
|
||||
* @param oldStack the previous 'active' stack
|
||||
* @param newStack the stack currently in the active hand
|
||||
* @return true to set the new stack to active and continue using it
|
||||
*/
|
||||
default boolean canContinueUsing(ItemStack oldStack, ItemStack newStack)
|
||||
{
|
||||
return oldStack.equals(newStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to get the Mod ID of the mod that *created* the ItemStack, instead of
|
||||
* the real Mod ID that *registered* it.
|
||||
|
||||
Reference in new issue
Block a user