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'm placing various container objects (Chest, trapped chest, dispenser, dropper, furnace) with various DV (2,3,4,5) to vary the orientation.

 

rv = world.setBlock(blockPos.posX,blockPos.posY,blockPos.posZ,block,newDv,2);

 

I have log entries verifying that, yes, the DV is what I think it is, when the setBlock function is called, and it is varying.

 

However, every one of these placed items ends up facing South (DV=2) when I enter the world!  This applies only to the container objects listed above -- all other objects are placing correctly, and have the correct orientation.  Notably, hoppers and ender chests do not have this problem for me either.

 

I am creating the relevant TileEntities as well, but they do not have an orientation attribute (I've tried creating them before, after, or not at all and it's all the same).

 

Does anyone have an idea why these lbock might be having difficulties positioning correctly?  All constructive advice welcomed.  Hopefully I'm just doing something stupid.

 

-Steve

  • Author

The blocks that can rotate apply a default facing when placed. You have to set the metadata separately again after calling setBlock.

 

I'll give this a go.  Strangely, the other (non-container) blocks which can rotate (e.g., stone stairs) seem to work with a single placing; and the setBlock() directive takes DV as a parameter, so you'd think it would be used... also, I thought they defaulted to DV=2, not 3.

 

- goes away and does a quick recompile and test -

 

Well, you were right - that was the problem.  For Container blocks, it seems that DV cannot be set at the time of placement, for some reason known only to Mojang.  Many thanks for clearing this one up for me, have a +1.  :)

 

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.