2020-04-15 14:22:03 +02:00
|
|
|
package com.minelittlepony.unicopia.magic;
|
2018-09-12 01:29:49 +02:00
|
|
|
|
2019-03-05 13:29:16 +01:00
|
|
|
import javax.annotation.Nullable;
|
2019-01-20 00:07:59 +01:00
|
|
|
|
2018-09-12 01:29:49 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
2020-01-16 12:35:46 +01:00
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
2018-09-12 01:29:49 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
2020-01-17 14:27:26 +01:00
|
|
|
import net.minecraft.item.ItemUsageContext;
|
2018-09-12 01:29:49 +02:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for right-click actions.
|
|
|
|
*
|
|
|
|
*/
|
2020-04-15 18:12:00 +02:00
|
|
|
public interface Useable {
|
2019-01-20 00:07:59 +01:00
|
|
|
|
2019-02-08 22:39:02 +01:00
|
|
|
/**
|
|
|
|
* Triggered when the player right clicks a block
|
|
|
|
*
|
|
|
|
* @param stack The current itemstack
|
|
|
|
* @param affinity The affinity of the casting artifact
|
|
|
|
* @param player The player
|
|
|
|
* @param world The player's world
|
|
|
|
* @param pos The location clicked
|
|
|
|
* @param side The side of the block clicked
|
|
|
|
* @param hitX X offset inside the block
|
|
|
|
* @param hitY Y offset inside the block
|
|
|
|
* @param hitZ Z offset inside the block
|
|
|
|
*
|
|
|
|
* @return ActionResult for the type of action to perform
|
|
|
|
*/
|
2020-01-27 11:05:22 +01:00
|
|
|
CastResult onUse(ItemUsageContext context, Affinity affinity);
|
2019-01-20 00:07:59 +01:00
|
|
|
|
2019-02-08 22:39:02 +01:00
|
|
|
/**
|
|
|
|
* Triggered when the player right clicks
|
|
|
|
*
|
|
|
|
* @param stack The current itemstack
|
|
|
|
* @param affinity The affinity of the casting artifact
|
|
|
|
* @param player The player
|
|
|
|
* @param world The player's world
|
|
|
|
* @param hitEntity The entity in focus, if any
|
|
|
|
*
|
|
|
|
* @return ActionResult for the type of action to perform
|
|
|
|
*/
|
2020-01-27 11:05:22 +01:00
|
|
|
CastResult onUse(ItemStack stack, Affinity affinity, PlayerEntity player, World world, @Nullable Entity hitEntity);
|
2018-09-12 01:29:49 +02:00
|
|
|
}
|