Jump to content

ashjack0

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by ashjack0

  1. Thank you! I was able to figure it out from that.
  2. Ah, BlockHorizontal and BlockDirectional? I initially thought of using these, but BlockTorch for example has a FACING property but does not extend from either of these, and I would still like to access this property. I suppose I could add individual checks for each block that has a FACING property that's not from the two classes above, but this could be tedious and would not account for blocks from other mods which I would ideally like to support. I know that it's hacky, but would it be sensible to use the block meta numbers, and then add 0-3 to it based on what direction the block is already in? myBlockState.getValue(p) would work to verify it's initial direction, my issue above was that I couldn't then change the value of p.
  3. I don't seem to have a BlockFacingHorizontal or BlockFacing class anywhere in my Forge library
  4. I am trying to check if each block in a list has a PropertyDirection property FACING, and to then change it based on external criteria. I tried to use instanceof BlockHorizontal at first, but quickly learnt that blocks like torches have a FACING variable but only extend from Block. I also tried iterating through the IBlockState.getPropertyKeys() of the block: for(IProperty<?> p : myBlockState.getPropertyKeys()) { if(x == y) { world.setBlockState(myBlockPos, myBlockState.withProperty(p, Rotation.COUNTERCLOCKWISE_90.rotate((EnumFacing) myBlockState.getValue(p)))); } } but this gives me the error: The method withProperty(IProperty<T>, V) in the type IBlockState is not applicable for the arguments (IProperty<capture#4-of ?>, EnumFacing) Are there any better ways of looking for the property of a block regardless of its type?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.