Allow simple use of int blockstates
SkySom opened this issue ยท 10 comments
Basically add a simple meta int property that can exist. Also some stuff for rotating/placing like a piston, so people can make their facing blocks.
Suggestion for a simple way to allow the creation of directional blocks:
Add parameters to IBlockAction
The addition of ICTPlayer player
and Facing facing
parameters that behave exactly as they do for IItemUse Function
would grant access to the information needed to code both log-like and piston-like placing (direction determined by block being placed against and on player facing direction, respectively).
The programmer would modify the existing ICTBlockState state
parameter based on either the facing
parameter or the player
parameter's rotationYaw
, rotationPitch
, and/or lookingDirection
properties (inherited from IPlayer>IEntityLivingBase>IEntity).
Another even simpler but less flexible appraoch could be to add two properties to mods.contenttweaker.Block
.
The first would be an enum called Directional directional
with three possible values: FALSE
, PLAYER_DIRECTION
, or AGAINST_FACE
; these would control the way directionality is determined.
The second would be an array of Facing
enums called directionality
giving the possible directions the block would support. This property would be ignored if directional
was FALSE
.
You can't just add parameters to a method like that without breaking all existing content. And the way you suggests does still not handle model generation or any of the other surrounding parts.
Ok so I'm assuming the method that adds properties to mods.contenttweaker.Block
is more feasible then.
I'm not sure what you mean by model generation and other surrounding parts.
I'm under the impression that directional blocks only need a single blockstate json and a single model json.
I looked at the vanilla acacia_log assets for reference and that seems to be the case, with one blockstate json referencing one model json multiple times, one for each orientation (acacia also has axis: none
referencing a second model but that could be omitted for CoT).
I understand if it's still not feasible, I would like to understand the issue though.
ContentTweaker generations all the models for created blocks, so I'd need ot handle templates, and those options and generating the correct one. Honestly it's not hard to write. It's generally just a tedious process, but it's the documentation and support. It creates a situation where rather than writing all the documentation and handling all that support, it'd actually be simpler at that point for people to learn how to mod.
@SkySom Can you explain what is meant by this? Does it mean we can add a meta int property in ZenScript for created blocks that are easier to differentiate?
The complexity it invited in models and handling was not worth the gains. It was to the point of being a better option to just write a mod.