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.

Featured Replies

Posted

I need to be able to

 

1) get a block from the world (done).

2) rotate that block to the player's direction (done- but messy atm).

3) place the block back in the world (done).

 

I was wondering what the best way to rotate a block in this instance (right now I am manipulating the property "FACING" (if it exists) in its IBlockState) to face the correct direction. Is there a way to change ANY block's facing without having to manipulate the properties directly ?

 

Let me add a little more info as well:

a) I get a block from the world, save all its data to a file and bring it back. (this works)

b) I have to be able to bring the block back into existence and using the properties I've saved (this works)

c) Its when bringing back the block into the world and having to change the facing (because its not facing the original direction that it was selected from) that I am dealing with (works, but messy and has to deal directly with the FACING property).

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

Thanks, I'll give it a look see :D

 

I've got a cut/paste thing (multiple blocks) going for my mod and would prefer a better way to perform the paste portion with a rotation without having to directly manipulate the properties (which is messy)....

 

I did something similiar to your class (although not as well thought out as yours :)) for facing, but it seems messy....

 

I'm looking for a way to maybe use the block.rotateBlock instead as this will handle any other changes besides facing that have to be handled....

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

Hi

 

From memory, the block.rotateBlock() was a Forge addition and it only works rotating the block in place (i.e. a block which is already placed into the world). You could use that if you're willing to place the block then rotate it.

 

-TGG

  • Author

Suppose I could do that after I re-create the block. I would hope that any attachments (fences etc) are updated when the block is rotated as well. If not then it could get VERY ugly code :D

 

It does not seem to work- I set the BlockProperties correctly and it places the block, but when I attempt the rotate after that (passing block.rotateBlock(((EntityPlayer) sender).worldObj, pos, rot) it returns true but doesn't seem to update the world.

 

If its an older part of Forge, maybe its not working correctly since 1.8 ? Or is there another process to correctly using rotateBlock ?

 

 

For the record for now I've settled on a direction re-map function (I know the direction the block was "grabbed" and the player direction) and just re-map the grabbed direction based on the player direction (simple enough but it would be nice not to have to manipulate the facing property directly)....

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.