Advertisement
Guest User

Untitled

a guest
Jan 11th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. Block
  2. - PropertyBool VALID, telling if it's part of a validly formed multiblock
  3. - PropertyEnum<EnumFacing.AXIS> FACING telling what axis the valve is facing (northsouth, updown, westeast)
  4. - PropertyBool MASTER, telling if it's the master valve in the multiblock
  5.  
  6. I assume your valve stores nothing in meta
  7. So getMetaFromState returns 0
  8. getStateFromMeta returns getDefaulState
  9.  
  10. In your ctor you need to set your default state
  11. setDefaultState(blockState.getBaseState().withProperty(VALID, false).withProperty(FACING, EnumFacing.Axis.X).withProperty(MASTER, false))
  12.  
  13. You fill all those details in using getActualState
  14. query your TE
  15. state = state.withProperty(VALID, te.valid).withProperty(FACING, te.facing).withProeprty(MASTER, te.master);
  16.  
  17. in your json
  18. {
  19. "forge_marker": 1,
  20. "defaults": {
  21. "model": "minecraft:cube_column" // by default, we have a model that wants textures "side" and "end"
  22. "textures": {
  23. "side": "modid:blocks/valve_side",
  24. "end": "modid:blocks/valve_end_slave"
  25. }
  26. },
  27. "variants": {
  28. "valid": {
  29. "true": {},
  30. "false": {
  31. "model": "minecraft:cube_all", // if valid is ever false, change the model to cube all and display the invalid texture on all 6 sides
  32. "textures": {
  33. "all": "modid:blocks/invalid"
  34. }
  35. }
  36. },
  37. "facing": {
  38. "x": {
  39. "x": 90,
  40. "y": 90 // Global rotation by 90 on both axes
  41. },
  42. "y": {}, // no rotation
  43. "z": {
  44. "x": 90 // Global rotation by 90 on x axis
  45. }
  46. },
  47. "master": {
  48. true: {
  49. "textures": {
  50. "end": "modid:blocks/valve_end_master" // Replace the end texture with the master one
  51. }
  52. }
  53. false: {} // Do nothing
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement