Posted September 14, 201510 yr Hello, it's me again just now i have finished an ISBRH to render my block(in order to make it always point to the direction it was placed), cause this block itself has 8 states(each has one unique icon), i have decided to use metadata for these 8 icon and make a TileEntity to store the blocks orientation and other infos. So there comes the problem. The block dose get rendered correctly when i place them, but after i restarted the server, its orientation get reset. I have figured out, that minecraft will render a block before its tileentity read the infos from NBT, so that i always get 0(orientation -- south) after restarted the server. Are there anyway that i can force my block to re-render after its tileentity has loaded all the infos from NBT? i have tried updateTick method in my block class, but it seems it never be called. i also tried to use worldObj.markBlockForUpdate() as well as MineCraft.getMinecraft().renderGlobal.markBlockForRenderUpdate() at the end of readFromNBT method in my tileentity, but all i've got is nullPointerException are there anyway to do this? or i must put orientation info in metadata in order to get it work? Thx for help.
September 14, 201510 yr You should worldObj.markBlockForUpdate() with appropriate flag. I think I used 3 and worked well. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
September 14, 201510 yr Author You should worldObj.markBlockForUpdate() with appropriate flag. I think I used 3 and worked well. what i get from worldObj.markBlockForUpdate() is only 3 parameter, which ,i guess, is the coordinate of the block to update...how can i set flag? also another question is, where should i put this command? when i put it at the end of readFromNBT, it throws a NullPointerException, should i use a flag and then put this command in updateEntity? or maybe use worldObj.scheduledBlockUpdate? have tried these in updateEntity, and nothing happens(well it do be called each tick, but block is not re-rendered)
September 15, 201510 yr Oh; Just worldObj#markBlockForUpdate() worked for me. It should update rendering. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
September 15, 201510 yr Author yep, i figured out the actual problem... this tileentity is not synchronized after server restart lol... client side always get a new tileentity with new compound so its always blank... well, so its actually the problem, how to synchronize tileentity after server restart lol
September 15, 201510 yr Did you implement getDescriptionPacket and onDataPacket? Then calling worldObj#markBlockForUpdate() from server will synchronize the block and update rendering. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
September 15, 201510 yr Author Did you implement getDescriptionPacket and onDataPacket? Then calling worldObj#markBlockForUpdate() from server will synchronize the block and update rendering. ill have a try thx for helping
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.