Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kentnl/minecraft-sectionfilter

Strip/Process magical § characters from minecraft
https://github.com/kentnl/minecraft-sectionfilter

Last synced: 4 days ago
JSON representation

Strip/Process magical § characters from minecraft

Awesome Lists containing this project

README

        

# NAME

Minecraft::SectionFilter - Strip/Process magical § characters from minecraft

# VERSION

version 0.003004

# SYNOPSIS

use Minecraft::SectionFilter;
while(<$some_stream_of_text>){
if( $ENV{MODE} eq 'STRIP' ) {
print(strip_sections($_))
}
else {
print(ansi_encode_sections($_));
}
}

# FUNCTIONS

## translate\_sections

Parse a string into a series of elements;

my (@list) = translate_sections($string)

Resulting list will be a list of hashrefs, either:

{ type => text , content => "the string itself" }

or

{ type => section, section_code => $char }

## strip\_sections

Strip section codes from a string.

my $output = strip_sections( $input );

## ansi\_encode\_sections

Translate section codes to Term::ANSIColor color codes.

STDOUT->print( ansi_encode_sections( $minecraft_string ) );

# SEE ALSO

[Minecraft::RCON](https://metacpan.org/pod/Minecraft::RCON) which has a similar feature, except its not user-acessible/reusable.

# AUTHOR

Kent Fredric

# COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Kent Fredric .

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.