use of WayofTime.bloodmagic.ritual.RitualComponent in project BloodMagic by WayofTime.
the class RitualHelper method checkValidRitual.
public static boolean checkValidRitual(World world, BlockPos pos, String ritualId, EnumFacing direction) {
Ritual ritual = RitualRegistry.getRitualForId(ritualId);
if (ritual == null) {
return false;
}
List<RitualComponent> components = Lists.newArrayList();
ritual.gatherComponents(components::add);
for (RitualComponent component : components) {
BlockPos newPos = pos.add(component.getOffset(direction));
if (isRuneType(world, newPos, component.getRuneType())) {
continue;
} else {
return false;
}
}
return true;
}
Aggregations