Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Block
- - PropertyBool VALID, telling if it's part of a validly formed multiblock
- - PropertyEnum<EnumFacing.AXIS> FACING telling what axis the valve is facing (northsouth, updown, westeast)
- - PropertyBool MASTER, telling if it's the master valve in the multiblock
- I assume your valve stores nothing in meta
- So getMetaFromState returns 0
- getStateFromMeta returns getDefaulState
- In your ctor you need to set your default state
- setDefaultState(blockState.getBaseState().withProperty(VALID, false).withProperty(FACING, EnumFacing.Axis.X).withProperty(MASTER, false))
- You fill all those details in using getActualState
- query your TE
- state = state.withProperty(VALID, te.valid).withProperty(FACING, te.facing).withProeprty(MASTER, te.master);
- in your json
- {
- "forge_marker": 1,
- "defaults": {
- "model": "minecraft:cube_column" // by default, we have a model that wants textures "side" and "end"
- "textures": {
- "side": "modid:blocks/valve_side",
- "end": "modid:blocks/valve_end_slave"
- }
- },
- "variants": {
- "valid": {
- "true": {},
- "false": {
- "model": "minecraft:cube_all", // if valid is ever false, change the model to cube all and display the invalid texture on all 6 sides
- "textures": {
- "all": "modid:blocks/invalid"
- }
- }
- },
- "facing": {
- "x": {
- "x": 90,
- "y": 90 // Global rotation by 90 on both axes
- },
- "y": {}, // no rotation
- "z": {
- "x": 90 // Global rotation by 90 on x axis
- }
- },
- "master": {
- true: {
- "textures": {
- "end": "modid:blocks/valve_end_master" // Replace the end texture with the master one
- }
- }
- false: {} // Do nothing
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement