winston#stream TypeScript Examples
The following examples show how to use
winston#stream.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockMappings.ts From JSPrismarine with Mozilla Public License 2.0 | 6 votes |
public static initMappings(): void {
const stream = new BinaryStream(
BedrockData.canonical_block_states // Vanilla states
);
const reader: NBTReader = new NBTReader(stream, ByteOrder.ByteOrder.LITTLE_ENDIAN);
reader.setUseVarint(true);
let runtimeId = 0;
do {
const vanillaBlock = reader.parse();
const vanillaBlockName = vanillaBlock.getString('name', 'unknown');
const vanillaBlockStates = vanillaBlock.getCompound('states', false);
if (vanillaBlockStates === null) {
throw new Error(`Vanilla block=${vanillaBlockName} has no states`);
}
// TODO: every block state implementation
// for (const _ of vanillaBlockStates.entries()) {
// }
this.registerMapping(vanillaBlockName, runtimeId++);
} while (!stream.feof());
}