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

23 lines
584 B
Java
Raw Normal View History

2020-04-04 02:32:34 +00:00
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 {
2020-06-28 16:38:49 +00:00
void execute(World world, Entity attacker, Entity target);
2020-04-04 02:32:34 +00:00
2020-06-28 16:38:49 +00:00
void execute(World world, Entity attacker, BlockPos pos);
2020-04-04 02:32:34 +00:00
int getCost();
2020-06-28 16:38:49 +00:00
default PlayerEntity convertToPlayer(Entity entity) {
2020-04-04 02:32:34 +00:00
if (entity instanceof PlayerEntity) {
return (PlayerEntity) entity;
} else {
return null;
}
}
}