dslake / WorldDownloader

Clones a Minecraft multiplayer world from a remote server to your singleplayer folder
http://www.minecraftforum.net/topic/1444862-
62 stars 19 forks source link

Distance Extender (original title: voxelmap compatibility) #47

Open MamiyaOtaru opened 10 years ago

MamiyaOtaru commented 10 years ago

first tiny commit is to ensure that (!WDL.downloading && !WDL.saving) means it is safe for another mod (like VoxelMap) to mess with chunk.isModified instead of having a (very very) brief period where downloading is false but before saving is true

Second updates some methods and fields to mcptest, didn't touch anything in conf folder though :(

also adds Distance Extender functionality where Minecraft will actually listen to the render distance the user chooses in the video UI. Works in SP as is, and in SMP if a download is running (to be sure WDL.chunkLoader is the right one for that world - it's not set to null after download is stopped, even after world is switched. Could probably do something about that but eh

nairol commented 10 years ago

Hey MamiyaOtaru, thanks for this pull request and sorry for the long silence. Afaik cubic72 didn't have time to work on Minecraft mods and I haven't really followed the mod anymore for almost a year.

I'll have a look at your code. So the problem is that VoxelMap uses the Chunk.isModified field to keep track of some per Chunk state and WDL doesn't know about that, right? Maybe I can get rid of the isModified check. I didn't use it in the very first version of WDL but that resulted in empty chunks being written to disk. Maybe this is no longer the case...

Changing VoxelMap to store the state in some mod-local data structure wouldn't work, would it? E.g. a HashMap<ChunkPosition, YourStateDataType> inside your main class. I've used a HashMap like this in early versions of WDL to keep track of new TileEntities that should be merged into the loaded chunks later.

You also included a distance extender in this PR. I'd rather test the two changes separately. Which changes are for voxelmap compatibility and which ones for the distance extender? Do I need the new ChunkProviderWDL for compatibility? I hope you still remember :)

Again, sorry for the long wait and thanks!