Posted January 9, 201510 yr 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
January 10, 201510 yr 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.
January 10, 201510 yr Its probably because they are expecting to be placed by a player and even if they arnt the code to update the rotation is still called. I am the author of Draconic Evolution
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.