Jump to content

Retrogen acting weird


brandon3055

Recommended Posts

Im not sure if retrogen it the rite word for it but basically i am replacing all of one block in the world (Existing chunks) with another.

 

I have it working when the world loads it finds all of the blocks its looking for and replaces them and everything works fine. The weird part is when i then save and quit and then go back into the world... The code runs again even though it has already replaced all of the blocks it is looking for (i have it print a message to the console for each block it finds and replaces)

 

This is my Forge event handler class that dose all of the work.

 

https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/common/core/handler/MinecraftForgeEventHandler.java

(skip to ChunkEvent)

 

The blocks i am finding and the blocks i am replacing them with are from my mod

 

https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/common/core/utills/Utills.java

 

https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/common/blocks/ModBlocks.java

 

The reason i want to do this is because i made a mistake when registering some of my blocks and used their unlocalized name so they were registered as tile.blockName instead of blockName. So i corrected that error and to prevent those blocks from being deleted from existing worlds i created a block that is registered as the old name (tile.blockName) that will be changed to the correct block (by this code) on world load.   

I am the author of Draconic Evolution

Link to comment
Share on other sites

Thanks jabelar that seems to have fixed it! 

 

You are searching an area of 16x16x16, when a chunk is 16x256x16

 

for (ExtendedBlockStorage storage : chunk.getBlockStorageArray()) 

 

diesieben07 posted this code in this post http://www.minecraftforge.net/forum/index.php?topic=21625.0 from what i can tell it breaks each chunk into 16x16x16 blocks.

 

 

I am the author of Draconic Evolution

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.

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

×   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.

Announcements



×
×
  • Create New...

Important Information

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