resource: add comments to generated file

This commit is contained in:
Matthias Schiffer 2024-12-31 13:05:47 +01:00
parent 00216341ca
commit 7b98954c80
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 11 additions and 3 deletions

View file

@ -1,7 +1,12 @@
//! Block type information
//!
//! This file is generated using resource/generate.py, do not edit
use enumflags2::make_bitflags; use enumflags2::make_bitflags;
use super::*; use super::*;
/// List if known block types and their properties
pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[
( (
"acacia_button", "acacia_button",

View file

@ -4,12 +4,10 @@
mod biomes; mod biomes;
mod block_color; mod block_color;
mod block_types;
mod legacy_biomes; mod legacy_biomes;
mod legacy_block_types; mod legacy_block_types;
#[allow(clippy::missing_docs_in_private_items)] // Generated module
mod block_types;
use std::collections::HashMap; use std::collections::HashMap;
use enumflags2::{bitflags, BitFlags}; use enumflags2::{bitflags, BitFlags};

View file

@ -14,10 +14,15 @@ with open(sys.argv[1]) as f:
output = {} output = {}
with open(sys.argv[2], 'w') as f: with open(sys.argv[2], 'w') as f:
print('//! Block type information', file=f);
print('//!', file=f);
print('//! This file is generated using resource/generate.py, do not edit', file=f);
print('', file=f)
print('use enumflags2::make_bitflags;', file=f); print('use enumflags2::make_bitflags;', file=f);
print('', file=f) print('', file=f)
print('use super::*;', file=f) print('use super::*;', file=f)
print('', file=f) print('', file=f)
print('/// List if known block types and their properties', file=f);
print('pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[', file=f) print('pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[', file=f)
for name, info in colors.items(): for name, info in colors.items():