Just some useful function for my minecraft mods.