Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ashjack0

Members
  • 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?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.