This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
RelicCraft/src/main/java/com/thebrokenrail/reliccraft/data/Action.java
TheBrokenRail c19790efc4
All checks were successful
RelicCraft/pipeline/head This commit looks good
1.0
Initial Commit
2020-04-03 22:32:34 -04:00

24 lines
644 B
Java

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