23 lines
584 B
Java
23 lines
584 B
Java
package com.thebrokenrail.reliccraft.data;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
|
|
public interface Action {
|
|
void execute(World world, Entity attacker, Entity target);
|
|
|
|
void execute(World world, Entity attacker, BlockPos pos);
|
|
|
|
int getCost();
|
|
|
|
default PlayerEntity convertToPlayer(Entity entity) {
|
|
if (entity instanceof PlayerEntity) {
|
|
return (PlayerEntity) entity;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|