11-26-2014, 11:27 PM
Metadata is still being used to save and load to and from schematics, it still works that way. Just also discovered that I may use cycleProperty to rotate things instead of trying to do it manually with block data.
I'm now on the way to fix right clicking on buttons, levers, .. I need to get the property "facing". The problem now is that it uses the IProperty's hashCode rather than just the name.
In this case I can't find the lever's property because I'm asking for the wrong kind of direction (because levers on top and bottom can be rotated in 2 directions). But a ton of blocks have their own enums that you'll have to use to get those properties in every class in a case by case basis, which is way too much work.
An EnumFacing is required to activate blocks (as well as EntityPlayer but I'm skipping that for now), and normally that comes from what the player is looking at, so it would require teleporting a player object around and I want to avoid that. My goal now is to find another way to get a EnumFacing of a given coordinate for the couple blocks that need it and just null it in other cases.
I'm now on the way to fix right clicking on buttons, levers, .. I need to get the property "facing". The problem now is that it uses the IProperty's hashCode rather than just the name.
Code:
The IProperty we wish to obtain:
-1224145743 PropertyDirection{name=facing, clazz=class ej, values=[down, up, north, south, west, east]}
BlockLever's property and its value that we need:
-1329114687 PropertyEnum{name=facing, clazz=class axk, values=[down_x, east, west, south, north, up_z, up_x, down_z]}: west
In this case I can't find the lever's property because I'm asking for the wrong kind of direction (because levers on top and bottom can be rotated in 2 directions). But a ton of blocks have their own enums that you'll have to use to get those properties in every class in a case by case basis, which is way too much work.
An EnumFacing is required to activate blocks (as well as EntityPlayer but I'm skipping that for now), and normally that comes from what the player is looking at, so it would require teleporting a player object around and I want to avoid that. My goal now is to find another way to get a EnumFacing of a given coordinate for the couple blocks that need it and just null it in other cases.