There isn't any documentation anywhere but I think I can just tell you the format. Do you need color cache (basically images) or the multiplayer map files containing actual block states?
EDIT: You might have difficulties decoding the color cache because it can contain compressed data if the user has the "Texture Compression" setting enabled. The compression format is picked by the graphics driver (GL_TEXTURE_COMPRESSION_HINT set to GL_NICEST and internal format when uploading being GL_COMPRESSED_RGB). The cache files do contain the actual format used but I don't expect you to handle every format that is thrown at you.
The multiplayer map files would probably be best for my purpose.
The multiplayer map files would probably be best for my purpose.
Ok. Here we go. The map data is separated into multiple files (the .zip ones, NOT .xwmc), 1 per 512x512 block region (or 32x32 chunks). You need to use a ZipInputStream to read the files. The region files are separated into multiple 4x4 chunk sections. And these sections are obviously separated into chunks.
Here's some pseudocode for the format:
major versions: 1.16.1 - 3 ; 1.15.2/1.14.4 - 2 ; 1.13.2 - 1 ; 1.12.2 and below - 0 //used for MC version specific changes
latest minor version: 1 //used for changes in all versions
//Ok, something important. If you want to read map data for MC 1.13.2 and higher, you need to use a block state palette. A list should work. You need to start with an empty palette for each region.
READING THE REGION FILE:
regionLoadPalette.clear();//Clear the old or start a new palette list here.
int minorSaveVersion = -1;
int majorSaveVersion = 0;
int firstByte = in.read();
if(firstByte == 255){//means the the next int is save version because coords byte will never go to 255
int fullVersion = in.readInt();
minorSaveVersion = fullVersion & 65535;
majorSaveVersion = (fullVersion >> 16) & 65535;
firstByte = -1;
}
while (true) {
int sectionCoords = firstByte == -1 ? in.read() : firstByte;
if(sectionCoords == -1)//end reached
break;
firstByte = -1;
//section coordinates inside the region
int sectionX = sectionCoords >> 4;
int sectionZ = sectionCoords & 15;
//start reading the section
for (int chunkX = 0; chunkX < 4; chunkX++)
for (int chunkZ = 0; chunkZ < 4; chunkZ++) {
int firstPixelInfo = in.readInt();//info for the first chunk pixel
if (firstPixelInfo == -1)//-1 if the chunk is empty
continue;
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
//read the x z pixel here using the first pixel info for the first pixel
}
}
}
}
READING A PIXEL:
BlockState state;
if(is the first pixel)
info = firstPixelInfo
else
info = in.readInt();
if ((info & 1) != 0) { // isn't grass
if(majorSaveVersion == 0) {//1.12.2 and below, which uses state ids
int state = in.readInt();
//I have a map which converts old state ids to block states
//You probably know what to do here
} else {//1.13.2+
boolean paletteNew = (info & 2097152) != 0;
if(paletteNew) {
CompoundNBT nbt = //read the NBT compound
if(majorSaveVersion < currentSaveMajorVersion)//older than your current MC version
//convert the nbt to your current MC version however you want
state = getBlockStateFromNBT(nbt);
regionLoadPalette.add(state);//add to the palette
} else {
int paletteIndex = in.readInt();
state = regionLoadPalette.get(paletteIndex);//get from the palette
}
}
} else
state = Blocks.GRASS_BLOCK.getDefaultState();
int heightType = (info >> 4) & 3;//0 - no slope, 1 - bright slope, 2 - dark slope, 3 - unknown slope
int height;
if ((info & 64) != 0)//old height
height = in.read();
else
height = (info >> 12) & 255;
if ((info & 2) != 0) {// has overlays, for example water and ice
int amount = in.read();
for (int i = 0; i < amount; i++)
//read the overlays here
}
int colorType = (info >> 2) & 3;//0 - normal, 1 - grass, 2 - foliage, 3 - custom color
int customColorMultiplier = -1;
int biome = 0;
if (colorType == 3)
customColorMultiplier = in.readInt();//I know this sucks. I'm planning to remove it.
if(colorType != 0 && colorType != 3 || (info & 1048576) != 0)
biome = in.read();
if(colorType == 3 && customColorMultiplier == -1)
colorType = 0;
boolean caveBlock = (info & 128) != 0;
int light = (info >> 8) & 15;
READING AN OVERLAY:
int info = in.readInt();
BlockState state;
if ((info & 1) != 0) { // isn't water
//Slightly different from the pixel one
if(majorSaveVersion == 0) {//1.12.2 and below, which uses state ids
int state = in.readInt();
//I have a map which converts old state ids to block states
//You probably know what to do here
} else {//1.13.2+
boolean paletteNew = (info & 1024) != 0;//!!!THIS IS DIFFERENT FROM THE ONE BEFORE!!!
if(paletteNew) {
CompoundNBT nbt = //read the NBT compound
if(majorSaveVersion < currentSaveMajorVersion)//older than your current MC version
//convert the nbt to your current MC version however you want
state = getBlockStateFromNBT(nbt);
regionLoadPalette.add(state);//add to the palette
} else {
int paletteIndex = in.readInt();
state = regionLoadPalette.get(paletteIndex);//get from the palette
}
}
} else
state = Blocks.WATER.getDefaultState();
int opacity = 1;
if (minorSaveVersion < 1 && (info & 2) != 0) //old file compatibility
in.readInt();//unused now, but you still need to read it
int colorType = (info >> 8) & 3;//0 - normal, 1 - water with biome color, 2 - custom color
int customColorMultiplier = -1;
if (colorType == 2 || (info & 4) != 0){
colorType = 2;
customColorMultiplier = in.readInt();
if(customColorMultiplier == -1)
colorType = 0;
}
if ((info & 8) != 0) // opacity not 1
opacity = in.readInt();
int light = (info >> 4) & 15;
Let me know how it goes. I'll put this in the original post if this works for you.
* Compatibility with Xaero's Minimap / Better PVP version 20.16.0. Not compatible with older versions.
* (1.12.2 - 1.8.9) Fixed updated chunks not being reloaded on the map.
* Compatibility with Xaero's Minimap / Better PVP 20.18.0. No longer compatible with older versions.
* (Fabric) Fixed compatibility with Fabric API 0.15.1.
* Reworked when objects of certain classes are (re)constructed. Every object that can potentially "break" because of an exception is now constructed per game connection and not per client instance. This should fix compatibility with something like VanillaFix. This means that reloading a world now reloads the main parts of the mod. One of the effects of this is the world map always being reloaded after a relog.
* Fixed game crash when loading a corrupt world map cache file.
* Updated the crash message to include the new preferred bug report link.
* (1.14.4) Fixed entering a singleplayer world and very quickly exiting causing a freeze.
* (1.8.9) Fixed updated chunks not being reloaded on the map. I thought I fixed it already but I guess not.
That would be amazing! A few friends and I recently switched to your mini + world maps from another popular map mod, and the world map zoom is the only thing we're missing. I'd love to be able to zoom in 8-10x.
That would be amazing! A few friends and I recently switched to your mini + world maps from another popular map mod, and the world map zoom is the only thing we're missing. I'd love to be able to zoom in 8-10x.
* Compatible with Xaero's Minimap / Better PVP 20.18.0 or newer.
+ Added a new option for ignoring server heightmaps when updating the map. Only use this if the default doesn't work on the server you play on.
+ Added a new option to scale world map waypoints.
* (Forge) Config button in the mod list will now take you to the mod settings.
* Increased maximum zoom in from 5x to 50x. Further zoom out is likely coming in the future.
* Fixed waypoint shadow sprite being affected by global GUI scale.
* Tweaked chunk loading algorithm to work better on very high framerates.
* Fixed map scrolling being a little glitchy, especially on older MC versions.
* Improved the update notification to now include all outdated mods created by me that you have, instead of having to deal with them 1 by 1. This only includes mods that support the improved notification (for example, at least 20.19.0 version of the minimap).
Can an option be added to change the colour of the arrow on the world map as well? We enjoy another color on the minimap and it feels really strange to suddenly have red again on the world map.
Can an option be added to change the colour of the arrow on the world map as well? We enjoy another color on the minimap and it feels really strange to suddenly have red again on the world map.
* Compatible with Xaero's Minimap / Better PVP 20.18.0 or newer.
+ Added the first server side feature. Installing this mod on the server side (in addition to client) will now make world map confirmation automatic and reliable.
IMPORTANT: If you have previously used this mod, make sure to select your old map in the map selection screen (world map -> bottom left icon -> top dropdown menu) and confirm. The mod will pick the correct map (and waypoints) from then on. You will have to do this once for every dimension but it's worth it.
+ Added a new option "ignoreServerLevelId" to server_config.txt for ignoring the new server map selection mode, since it's forced by default.
* Added automatic map name generation for world spawn and server level id based maps. Previously just displayed the map id, which was causing confusion.
* Fixed rare race condition during cleanup.
* Fixed page buttons in mod settings not displaying correctly without the minimap mod.
* (1.14.4 - 1.16.1) Fixed the mod crashing when installed on server side.
* Compatible with Xaero's Minimap / Better PVP 20.18.0 or newer.
* (1.16.2) Upgrade to Minecraft 1.16.2.
* (1.16.2) Started using string biome ids in multiplayer map data to support likely drop of int ids in 1.17.
* Fixed the mod not resetting the server level id when switching between a sub-server, which includes this mod on the server side, and a sub-server that doesn't.
* Fixed entity outline caused by the "Glowing" potion effect not working correctly around held items with this mod installed. This can fix other issues too, so it's not just 1.12.2 and newer.
* Fixed sun light not working correctly on the map. This fix will make the map a bit darker/brighter at night, but that's how it was supposed to be. Might add a slider option for that in the future.
* Fixed server level id mode sometimes not working when a dimension takes very long to load.
The multiplayer map files would probably be best for my purpose.
Ok. Here we go. The map data is separated into multiple files (the .zip ones, NOT .xwmc), 1 per 512x512 block region (or 32x32 chunks). You need to use a ZipInputStream to read the files. The region files are separated into multiple 4x4 chunk sections. And these sections are obviously separated into chunks.
Here's some pseudocode for the format:
Let me know how it goes. I'll put this in the original post if this works for you.
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.7.3.1 (MC 1.7.10):
* Fixed language files not working.
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.7.4 (MC 1.16.1, 1.15.2, 1.14.4, 1.12.2, 1.8.9, 1.7.10):
* Compatibility with Xaero's Minimap / Better PVP version 20.16.0. Not compatible with older versions.
* (1.12.2 - 1.8.9) Fixed updated chunks not being reloaded on the map.
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.8 (MC 1.16.1, 1.15.2, 1.14.4, 1.12.2, 1.8.9, 1.7.10):
* Compatibility with Xaero's Minimap / Better PVP 20.18.0. No longer compatible with older versions.
* (Fabric) Fixed compatibility with Fabric API 0.15.1.
* Reworked when objects of certain classes are (re)constructed. Every object that can potentially "break" because of an exception is now constructed per game connection and not per client instance. This should fix compatibility with something like VanillaFix. This means that reloading a world now reloads the main parts of the mod. One of the effects of this is the world map always being reloaded after a relog.
* Fixed game crash when loading a corrupt world map cache file.
* Updated the crash message to include the new preferred bug report link.
* (1.14.4) Fixed entering a singleplayer world and very quickly exiting causing a freeze.
* (1.8.9) Fixed updated chunks not being reloaded on the map. I thought I fixed it already but I guess not.
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Hi, how can I make map scale smaller than 0.5x? Cause I'd like to see 0.1x or even 0.05x size
You can't.
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.8.1 (MC 1.16.1, 1.15.2, 1.14.4):
* (Forge) Fixed the mod breaking after a relog.
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Is it possible to zoom in on the world map more than 5x?
Not currently, but that can be added.
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
That would be amazing! A few friends and I recently switched to your mini + world maps from another popular map mod, and the world map zoom is the only thing we're missing. I'd love to be able to zoom in 8-10x.
Going to make it 50x in the next update
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.9.0 (MC 1.16.1, 1.15.2, 1.14.4, 1.12.2, 1.8.9, 1.7.10):
* Compatible with Xaero's Minimap / Better PVP 20.18.0 or newer.
+ Added a new option for ignoring server heightmaps when updating the map. Only use this if the default doesn't work on the server you play on.
+ Added a new option to scale world map waypoints.
* (Forge) Config button in the mod list will now take you to the mod settings.
* Increased maximum zoom in from 5x to 50x. Further zoom out is likely coming in the future.
* Fixed waypoint shadow sprite being affected by global GUI scale.
* Tweaked chunk loading algorithm to work better on very high framerates.
* Fixed map scrolling being a little glitchy, especially on older MC versions.
* Improved the update notification to now include all outdated mods created by me that you have, instead of having to deal with them 1 by 1. This only includes mods that support the improved notification (for example, at least 20.19.0 version of the minimap).
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Can an option be added to change the colour of the arrow on the world map as well? We enjoy another color on the minimap and it feels really strange to suddenly have red again on the world map.
Good idea. Thanks!
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.10.0 (MC 1.16.1, 1.15.2, 1.14.4, 1.12.2, 1.8.9, 1.7.10):
* Compatible with Xaero's Minimap / Better PVP 20.18.0 or newer.
+ Added the first server side feature. Installing this mod on the server side (in addition to client) will now make world map confirmation automatic and reliable.
IMPORTANT: If you have previously used this mod, make sure to select your old map in the map selection screen (world map -> bottom left icon -> top dropdown menu) and confirm. The mod will pick the correct map (and waypoints) from then on. You will have to do this once for every dimension but it's worth it.
+ Added a new option "ignoreServerLevelId" to server_config.txt for ignoring the new server map selection mode, since it's forced by default.
* Added automatic map name generation for world spawn and server level id based maps. Previously just displayed the map id, which was causing confusion.
* Fixed rare race condition during cleanup.
* Fixed page buttons in mod settings not displaying correctly without the minimap mod.
* (1.14.4 - 1.16.1) Fixed the mod crashing when installed on server side.
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Update 1.10.1 (MC 1.16.2, 1.16.1, 1.15.2, 1.14.4, 1.12.2, 1.8.9, 1.7.10):
* Compatible with Xaero's Minimap / Better PVP 20.18.0 or newer.
* (1.16.2) Upgrade to Minecraft 1.16.2.
* (1.16.2) Started using string biome ids in multiplayer map data to support likely drop of int ids in 1.17.
* Fixed the mod not resetting the server level id when switching between a sub-server, which includes this mod on the server side, and a sub-server that doesn't.
* Fixed entity outline caused by the "Glowing" potion effect not working correctly around held items with this mod installed. This can fix other issues too, so it's not just 1.12.2 and newer.
* Fixed sun light not working correctly on the map. This fix will make the map a bit darker/brighter at night, but that's how it was supposed to be. Might add a slider option for that in the future.
* Fixed server level id mode sometimes not working when a dimension takes very long to load.
Link Removed
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Quick question:
I want to export those Xaero's Map config
https://imgur.com/a/IudV6wO
https://imgur.com/a/8Dl23MU
For that I need to find the config file in my server minecraft folder.
I already exported those 2 folders: https://imgur.com/a/0iK0AwW but it doesn't contain the map config.
Where is the config in the minecraft folder ?
It's in the "config" directory and it's called xaerominimap.txt. There's also one for the world map.
Flare Jump (Google Play) - my new Android game
patreon.com/xaero96 - support my work & get rewarded with automatic mod updates, capes and more
Xaero's World Map
Better PVP Mod
Xaero's Minimap
Perfect. Thank you !