Jump to content

[1.7.10] Containers always point south when placed. Why?


Recommended Posts

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.



Link to comment
Share on other sites

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.  :)


Link to comment
Share on other sites

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.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

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