Add spell quick access keys
This commit is contained in:
@@ -65,6 +65,16 @@ public interface ISpellCastingItem {
|
||||
// Nothing here either
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the spell at the given index bound to the given itemstack. The given itemstack will be of this item.
|
||||
* @param stack The itemstack to query.
|
||||
* @param index The index to set.
|
||||
* @return True if the operation succeeded, false if not.
|
||||
*/
|
||||
default boolean selectSpell(ItemStack stack, int index){
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the spell HUD should be shown when a player is holding this item. Only called client-side.
|
||||
* @param player The player holding the item.
|
||||
|
||||
@@ -113,6 +113,11 @@ public class ItemWand extends Item implements IWorkbenchItem, ISpellCastingItem,
|
||||
WandHelper.selectPreviousSpell(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean selectSpell(ItemStack stack, int index){
|
||||
return WandHelper.selectSpell(stack, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showSpellHUD(EntityPlayer player, ItemStack stack){
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user