Conversation
…ior trait on block structs
…s to separate modules
|
@MSKatKing the added docs are helpful, but could you add something to explain how to actually use the new stuff? Like how do we define the block behavior, how would we use the new block behavior once we've defined it, how do we get block properties, etc. |
| } | ||
|
|
||
| /// Returns the translation vector that will get the block that touches this face. | ||
| pub fn translation_vec(&self) -> IVec3 { |
| fn decode<R: Read>(reader: &mut R, opts: &NetDecodeOpts) -> Result<Self, NetDecodeError> { | ||
| let VarInt(data) = VarInt::decode(reader, opts)?; | ||
|
|
||
| match data { |
There was a problem hiding this comment.
sure, but it'd probably better to use the enum denominator instead of hardcoding the ids in two places
| for (block_pos, block_state) in placed_blocks.blocks { | ||
| let placed_blocks = vec![(offset_pos, block_state)]; | ||
|
|
||
| // let placed_blocks = block_placing::place_item( |
There was a problem hiding this comment.
non-draft PRs shouldn't contain commented-out code in my oppinion
| @@ -0,0 +1,14 @@ | |||
| [package] | |||
| name = "temper-block-properties" | |||
| version = "0.1.0" | |||
There was a problem hiding this comment.
isn't there a mechanism for workspace cargo.tomls to supply a default version property to all workspace members? same for edition I think
| use temper_macros::match_block; | ||
|
|
||
| impl BlockBehavior for SlabBlock { | ||
| #[inline(always)] |
There was a problem hiding this comment.
pretty much never manually specify always inline. compiler will do anyways when smart, and especially in this context, not worth it at all
| impl BlockStateProperty for i32 {} | ||
| impl BlockStateProperty for bool {} | ||
|
|
||
| /// Helper macro to implement enum property types. The syntax is simple: |
There was a problem hiding this comment.
nit: remove the "The syntax is simple:"
Implements a compile time block behavior system.