I have an item in my mod that spawns a structure when used. The exact same code worked just fine in 1.8.9. In 1.9, when I use the item, I only see the block right where I clicked.
The code is very complicated... it's on GitHub though (see lines 50-65 and 95-112... buildLayer is called whenever I set a block through a structure class. generateSmallStructureOverworld is called from here).
Screenshots:
When I use the item:
When I click on the places where these blocks should be:
When I unload the chunk and come back:
Activating the blocks where the structure should be (eg, placing a block there or clicking on the block facing it) reveals the blocks.
Logging out or changing dimensions also shows the blocks when I return.
The server knows the blocks are there, but the client doesn't... For example, trying to walk on top of that solid block results in a collision with the other solid block that does not show.
I have tried scheduling a block update in the same place where I set it, no luck.
I tried marking the chunk as modified. Didn't help.
I tried taking out the check for !world.isRemote , but that didn't help either.
I tried passing 3 as the flag instead of 2, but it made no difference.
Any ideas?
Should I try sending packets manually? I really don't understand why the code that worked in 1.8.9 doesn't work in 1.9.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
I have an item in my mod that spawns a structure when used. The exact same code worked just fine in 1.8.9. In 1.9, when I use the item, I only see the block right where I clicked.
The code is very complicated... it's on GitHub though (see lines 50-65 and 95-112... buildLayer is called whenever I set a block through a structure class. generateSmallStructureOverworld is called from here).
Screenshots:
When I use the item:
When I click on the places where these blocks should be:
When I unload the chunk and come back:
Activating the blocks where the structure should be (eg, placing a block there or clicking on the block facing it) reveals the blocks.
Logging out or changing dimensions also shows the blocks when I return.
The server knows the blocks are there, but the client doesn't... For example, trying to walk on top of that solid block results in a collision with the other solid block that does not show.
I have tried scheduling a block update in the same place where I set it, no luck.
I tried marking the chunk as modified. Didn't help.
I tried taking out the check for !world.isRemote , but that didn't help either.
I tried passing 3 as the flag instead of 2, but it made no difference.
Any ideas?
Should I try sending packets manually? I really don't understand why the code that worked in 1.8.9 doesn't work in 1.9.
Wow... why is it I never find the solution until right after I make a post about it?
This line of code was messing with the item from being used on the client at all:
the !worldIn.isRemote check only caused the server to notify the client of the block that was activated with this item.