#Codec help
1 messages · Page 1 of 1 (latest)
Codec.INT and Codec.INT.listOf()
IntProperty doesnt work :(
Why would you want a codec that encodes an IntProperty?
Do you actually want a codec for a BlockState that encodes the value of an IntProperty?
I want a codec with it as my constructor uses it
and I need the codec to match the constructor
What's the codec for?
Codecs shouldn't create new block instances
Does it need to be a Codec<FlowerBlock>? (or MapCodec<FlowerBlock> or smth, I forget)?
MapCodec
huh it looks like vanilla does use constructors, weird
but also it's strange for your block class to take an IntProperty in the constructor
does you have flowers with different age ranges?
yeah
I'd make FlowerCrop abstract and create a subclass for each age range
and what are ageIndices for?
at what age the voxelShape changes
its also used by my datagen for which model to use at which age within the blockstate
ok so you can do basically the same thing with subclasses
I assume one age range always uses the same indices? (so you won't have tons of combinations)
yeah probably