I couldn't find anywhere else for support so I'll post it here.
When I join a server it joins, let's me see for a split second and then it disconnects me with the message:
Connection Lost
Internal Exception: java.io.IOException: An existing connection was forcibly closed by remote host
Then if I look at the log it shows this stacktrace:
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_25]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_25]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_25]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_25]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[?:1.8.0_25]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:446) ~[UnpooledUnsafeDirectByteBuf.class:4.0.15.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:871) ~[AbstractByteBuf.class:4.0.15.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:208) ~[NioSocketChannel.class:4.0.15.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:124) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [SingleThreadEventExecutor$2.class:4.0.15.Final]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
This happens when this is the only liteloader mod enabled and other liteloader mods don't do this.
In my previous post I mentioned the client permissions plugin. Some servers use it the wrong way. Instead of using it to turn off features they don't like, they just kick anyone they see using the mod. That could be happening to you. I'll probably put out a version without the client permission stuff (and if server owners are nice it won't include the stuff they would want to turn off), to make the client undetectable again
Changing zoom level where? In the minimap? That should have nothing to do with the display of stored map data in the persistent world map. If you could be a little more specific about what is happening (minimap / world map, what you mean by changing zoom etc)
VoxelMap>Options>Worldmap Options
Change any of those sliders and it wiped the map, turned screen black and I had to start over. It does say edit at own risk. :/
Ah I see Still don't know why it would happen but that's something I can look at. "At your own risk" is because increasing the amount of area shown increases your memory usage. If it gets too high the game would most likely just crash instead of everything turning black but who knows. I'll see if anything obvious is going on
My server recently created a new world and all of the waypoints from survival are now showing in the other world. Yes I've created the world in voxelmap and it's all black except what I've discovered so that part is working correctly.
You definitely fixed the button 4 key bind issue. Works perfect! No more redoing the control keys each time I join the server. Thank you!
yeah the waypoints can be a bit of a mess. If you made a waypoint before defining any multiworld stuff, it isn't sure what to do with them (they weren't created with any multiworld info) so they get displayed everywhere. You're basically stuck editing the .points file (in notepad or something) by hand to add world info to them
We have 7 different worlds in our multiverse. That's a lot of waypoints to start from scratch again. Having a flat file is a savior. Thank you! whew. Brilliant using the ip as the unique identifier.
Yup, I didn't set the world name after first installing it. Didn't realize that it was important to do that even if you're playing in a single world. At the time I didn't need the multiverse stuff so I didn't set it. Here's an example of when the name was set. Can clearly see world:Survival is missing from all previous entries. Survival is the name I gave the world in voxelmap so it will be different for everyone.
Saved the file, restarted minecraft, and voila everything is fixed. Giving the default world a name after initial install is extremely important. It should be mandatory in my opinion. Gotta do a better job of communicating that. Replaced all instances of world: with world:Survival. All better now!
Is there a way to automatically detect the world name so that all of this can be automated instead? Manually selecting the world every time is a bit cumbersome. I'm all for being able to customize the world name with whatever you want but as an alias to the the real world name. I think that would be so much better if everything was handled automatically.
Giving the default world a name after initial install is extremely important. It should be mandatory in my opinion.
Not all servers are multiworld though. And there's no way for the client to detect if it is without warping to a new world with the same dimension as a previous one (when that happens, VoxelMap says multiworld is detected and you should do something about it). I could use a default name for the first (and possibly only) world a player ever visits. Will think about what if anything that might change
Is there a way to automatically detect the world name so that all of this can be automated instead?
Manually selecting the world every time is a bit cumbersome.
Even without those plugins, once the player names a world, it should be detected and selected next time he visits. New worlds are compared against stored data for previous worlds, and as long as the worlds haven't changed too much they will be automatically matched. But the player does need to label them first (or the server needs one of those plugins), there's just no built in method of communication server to client about what world one is in
I was wondering if it would be possible to make this mod detect if the server you're playing on has factions plugin/towny plugin/plots plugin or sth installed and if so it would display which chunks belong to whom on the world map. I guess it would be hard to do for all of the plugins of this kind, but maybe at least for the few most popular ones?
Also, I think the ability to make a kind of "border" on the map would be cool. For instance you would set a border at x axis at -5000 and it would show a wall of light - if you were close enough- and display your distance from it, like it does for beacons. Could be useful for servers with world borders.
borders could be fun Towny might be possible. Alternatively, instead of me coding for every type of plugin like that I could create an API for VoxelMap that lets any plugin communicate to it where to draw rectangles (and hope it doesn't get abused, like the permission system)
Can you tell me what sort of encoding the voxelmap chunk cache date is in? I'm trying to make an online map viewer using my collected voxel map data, but I can't seem to figure out the encoding - once I can, I can have the program automatically process user submitted data.
I just need to be able to extract the raw data for each chunk that voxelmap creates.
sure. I can describe it. It's complex though, and I'll give you a possibly easier solution at the bottom. (skip to **)
what you are looking at is it's one .zip file per region (each with 256 chunks), with the raw data being 17 bytes for each x,z coordinate (256x256 of them in a region).
so with zero based counting, the last byte (16) is the biomeID. The first 16 bytes are in 4 groups of 4, each representing a block from a different "layer" (will explain the layers in a moment)
Within those groups the first is the height, from 0-255. In Java a byte is -128 to 127 so before using it I bitwise-and it with 255 to get the 0-255 value as an int or short or whatever. Same for the rest of the values
the second and third together are the blockstateID, which minecraft gets with getIdFromBlock(state.getBlock()) + (state.getBlock().getMetaFromState(state) << 12). Max value for that is 65536, a Short, or two bytes. I am storing them big endian because my human brain likes that better and I'm handling it explicitly as such and not relying on the platform to figure out big vs little.
the fourth is the light level of the block (blockLight + skyLight*16) which can be used as an entry into the EntityRenderer.lightmapTexture.getTextureData() array, which changes as the sun goes up or down and torches flicker etc.
So the layers. First is the highest partially light blocking block (plus lava. lava blocked light up through 1.5 or 1.6 or something). second is the seafloor (when the first layer is water). third is the highest rain blocking block (catches glass blocks and fences up in the air etc). fourth is mostly vegetation: one block above the first layer, stuff like flowers, torches, rails etc that don't block anything, but also allows for stuff like fences (on the ground anyway) to show under glass. The last three layers might or might not exist at a given coordinate (they'll be zerod out if not, leads to nice zip compression).
If during a conversion there's nothing to put into the last three layers, it won't hurt anything, they just won't show on the map.
Converting that info into a color to display is done at runtime, based on the current resource pack(s), the current light level, and player preferences (height vs slope mapping, etc). Doing that outside of Minecraft would require replicating some Minecraft code, or just using set values for things like each block's color, etc.
**
If you want to make a web viewer, it would be easier perhaps to have VoxelMap output images for each region (it doesn't do that by default, but it can). To output images, open voxelmap.properties and add this line:
Output Images:true
Then run Minecraft. That line will disappear before your next run, so if you wish to do it again, add the line again. Join the server or load the singleplayer world. Ensure you have your chosen resource pack loaded and it is the time of day you want, then pan around the world map. All areas you view will be output as images once they are flushed from the cache (at the very latest, when you leave the world).
images will be created in /VoxelMods/voxelMap/cache/WORLDNAME(/optionalSubworldName)/dimensionName/images/z1
I really appreciate you taking the time to type that out and explain it. Will definitely allow me to continue on with my project!
I will not choose the route of having images outputted. It would be less of a strain on my server if I can manage to parse the uploaded data from my users and store it in a database, and will allow me to be more flexible with possible features for my online map viewer.
you bet If you are serious about it, here's the code used to pull values out of the byte array (code can be easier to read)
public static final int DATABITS = 17;
private static final int HEIGHTPOS = 0;
private static final int BLOCKSTATEPOS = 1;
private static final int LIGHTPOS = 3;
private static final int OCEANFLOORHEIGHTPOS = 4;
private static final int OCEANFLOORBLOCKSTATEPOS = 5;
private static final int OCEANFLOORLIGHTPOS = 7;
private static final int TRANSPARENTHEIGHTPOS = 8;
private static final int TRANSPARENTBLOCKSTATEPOS = 9;
private static final int TRANSPARENTLIGHTPOS = 11;
private static final int FOLIAGEHEIGHTPOS = 12;
private static final int FOLIAGEBLOCKSTATEPOS = 13;
private static final int FOLIAGELIGHTPOS = 15;
private static final int BIOMEIDPOS = 16;
public int getHeight(int x, int z) {
return getData(x, z, HEIGHTPOS) & 255; //& 0xff to convert unsigned byte to 0-255 int
}
public int getBlockstate(int x, int z) {
return (getData(x, z, BLOCKSTATEPOS) & 255) << 8 | (getData(x, z, BLOCKSTATEPOS+1) & 255);
}
public int getLight(int x, int z) {
return getData(x, z, LIGHTPOS) & 255;
}
public int getOceanFloorHeight(int x, int z) {
return getData(x, z, OCEANFLOORHEIGHTPOS) & 255;
}
public int getOceanFloorBlockstate(int x, int z) {
return (getData(x, z, OCEANFLOORBLOCKSTATEPOS) & 255) << 8 | (getData(x, z, OCEANFLOORBLOCKSTATEPOS+1) & 255);
}
public int getOceanFloorLight(int x, int z) {
return getData(x, z, OCEANFLOORLIGHTPOS) & 255;
}
public int getTransparentHeight(int x, int z) {
return getData(x, z, TRANSPARENTHEIGHTPOS) & 255;
}
public int getTransparentBlockstate(int x, int z) {
return (getData(x, z, TRANSPARENTBLOCKSTATEPOS) & 255) << 8 | (getData(x, z, TRANSPARENTBLOCKSTATEPOS+1) & 255);
}
public int getTransparentLight(int x, int z) {
return getData(x, z, TRANSPARENTLIGHTPOS) & 255;
}
public int getFoliageHeight(int x, int z) {
return getData(x, z, FOLIAGEHEIGHTPOS)& 255;
}
public int getFoliageBlockstate(int x, int z) {
return (getData(x, z, FOLIAGEBLOCKSTATEPOS) & 255) << 8 | (getData(x, z, FOLIAGEBLOCKSTATEPOS+1) & 255);
}
public int getFoliageLight(int x, int z) {
return getData(x, z, FOLIAGELIGHTPOS) & 255;
}
public int getBiomeID(int x, int z) {
return getData(x, z, BIOMEIDPOS) & 255;
}
private synchronized byte getData(int x, int z, int bit) {
int index = (x + z * this.width) * DATABITS + bit;
return this.data[index];
}
Is there a way to prevent/block certain feature from this mod to be used on a server?
yes more than one
best way is using http://dev.bukkit.org/bukkit-plugins/clientpermissions/
Anyone able to help? Would be much appreciated!
In my previous post I mentioned the client permissions plugin. Some servers use it the wrong way. Instead of using it to turn off features they don't like, they just kick anyone they see using the mod. That could be happening to you. I'll probably put out a version without the client permission stuff (and if server owners are nice it won't include the stuff they would want to turn off), to make the client undetectable again
VoxelMap>Options>Worldmap Options
Change any of those sliders and it wiped the map, turned screen black and I had to start over. It does say edit at own risk. :/
Ah I see
Still don't know why it would happen but that's something I can look at. "At your own risk" is because increasing the amount of area shown increases your memory usage. If it gets too high the game would most likely just crash instead of everything turning black but who knows. I'll see if anything obvious is going on
My server recently created a new world and all of the waypoints from survival are now showing in the other world. Yes I've created the world in voxelmap and it's all black except what I've discovered so that part is working correctly.
You definitely fixed the button 4 key bind issue. Works perfect! No more redoing the control keys each time I join the server. Thank you!
yeah the waypoints can be a bit of a mess. If you made a waypoint before defining any multiworld stuff, it isn't sure what to do with them (they weren't created with any multiworld info) so they get displayed everywhere. You're basically stuck editing the .points file (in notepad or something) by hand to add world info to them
We have 7 different worlds in our multiverse. That's a lot of waypoints to start from scratch again. Having a flat file is a savior. Thank you! whew. Brilliant using the ip as the unique identifier.
Yup, I didn't set the world name after first installing it. Didn't realize that it was important to do that even if you're playing in a single world. At the time I didn't need the multiverse stuff so I didn't set it. Here's an example of when the name was set. Can clearly see world:Survival is missing from all previous entries. Survival is the name I gave the world in voxelmap so it will be different for everyone.
name:Boat Race,x:-197,z:-182,y:69,enabled:true,red:0.99215686,green:0.88235295,blue:0.39607844,suffix:Gear,world:,dimensions:0#
name:Skeleton Farm,x:-1510,z:-786,y:48,enabled:true,red:0.88235295,green:0.96862745,blue:0.9882353,suffix:Gear,world:Survival,dimensions:0#
Saved the file, restarted minecraft, and voila everything is fixed. Giving the default world a name after initial install is extremely important. It should be mandatory in my opinion. Gotta do a better job of communicating that. Replaced all instances of world: with world:Survival. All better now!
Is there a way to automatically detect the world name so that all of this can be automated instead? Manually selecting the world every time is a bit cumbersome. I'm all for being able to customize the world name with whatever you want but as an alias to the the real world name. I think that would be so much better if everything was handled automatically.
Not all servers are multiworld though. And there's no way for the client to detect if it is without warping to a new world with the same dimension as a previous one (when that happens, VoxelMap says multiworld is detected and you should do something about it). I could use a default name for the first (and possibly only) world a player ever visits. Will think about what if anything that might change
Not without a server plugin. There are a couple: http://www.curse.com/mc-mods/minecraft/225341-journeymap-server and http://dev.bukkit.org/bukkit-plugins/worldinfo/ With either of those installed the server will communicate to the client which world he is in.
Even without those plugins, once the player names a world, it should be detected and selected next time he visits. New worlds are compared against stored data for previous worlds, and as long as the worlds haven't changed too much they will be automatically matched. But the player does need to label them first (or the server needs one of those plugins), there's just no built in method of communication server to client about what world one is in
borders could be fun
Just wondering, Is it supposed to download as a .zip file? Its making it hard for me to even get it working.
What I mean is that I can't find the .liteloader file, and get the thing working.
Am I doing it wrong, or is it a download error?
definitely an error of some kind, but easily fixable. a .litemod file is just a .zip file with a different extension. Change the .zip to .litemod and you are good to go (see the last item here http://windows.microsoft.com/en-us/windows/file-names-extensions-faq#1TC=windows-7 ).
Dunno why your browser feels like it needs to change the extension for you, but just change it back
Well I am using the windows 10 edge. I'll try chrome. If it works, I think there needs to be a warning about it.
Ok, it seems like it was the problem. I got it working with chrome.
I did get another report of the same thing happening with Edge. Seems to be an issue with that browser, I'll add a note in a bit. Thanks
Can you tell me what sort of encoding the voxelmap chunk cache date is in? I'm trying to make an online map viewer using my collected voxel map data, but I can't seem to figure out the encoding - once I can, I can have the program automatically process user submitted data.
I just need to be able to extract the raw data for each chunk that voxelmap creates.
Thanks, please get back to me if/when you can.
sure. I can describe it. It's complex though, and I'll give you a possibly easier solution at the bottom. (skip to **)
what you are looking at is it's one .zip file per region (each with 256 chunks), with the raw data being 17 bytes for each x,z coordinate (256x256 of them in a region).
so with zero based counting, the last byte (16) is the biomeID. The first 16 bytes are in 4 groups of 4, each representing a block from a different "layer" (will explain the layers in a moment)
Within those groups the first is the height, from 0-255. In Java a byte is -128 to 127 so before using it I bitwise-and it with 255 to get the 0-255 value as an int or short or whatever. Same for the rest of the values
the second and third together are the blockstateID, which minecraft gets with getIdFromBlock(state.getBlock()) + (state.getBlock().getMetaFromState(state) << 12). Max value for that is 65536, a Short, or two bytes. I am storing them big endian because my human brain likes that better and I'm handling it explicitly as such and not relying on the platform to figure out big vs little.
the fourth is the light level of the block (blockLight + skyLight*16) which can be used as an entry into the EntityRenderer.lightmapTexture.getTextureData() array, which changes as the sun goes up or down and torches flicker etc.
So the layers. First is the highest partially light blocking block (plus lava. lava blocked light up through 1.5 or 1.6 or something). second is the seafloor (when the first layer is water). third is the highest rain blocking block (catches glass blocks and fences up in the air etc). fourth is mostly vegetation: one block above the first layer, stuff like flowers, torches, rails etc that don't block anything, but also allows for stuff like fences (on the ground anyway) to show under glass. The last three layers might or might not exist at a given coordinate (they'll be zerod out if not, leads to nice zip compression).
If during a conversion there's nothing to put into the last three layers, it won't hurt anything, they just won't show on the map.
Converting that info into a color to display is done at runtime, based on the current resource pack(s), the current light level, and player preferences (height vs slope mapping, etc). Doing that outside of Minecraft would require replicating some Minecraft code, or just using set values for things like each block's color, etc.
**
If you want to make a web viewer, it would be easier perhaps to have VoxelMap output images for each region (it doesn't do that by default, but it can). To output images, open voxelmap.properties and add this line:
Output Images:true
Then run Minecraft. That line will disappear before your next run, so if you wish to do it again, add the line again. Join the server or load the singleplayer world. Ensure you have your chosen resource pack loaded and it is the time of day you want, then pan around the world map. All areas you view will be output as images once they are flushed from the cache (at the very latest, when you leave the world).
images will be created in /VoxelMods/voxelMap/cache/WORLDNAME(/optionalSubworldName)/dimensionName/images/z1
From there, you can process them yourself, or use the VoxelMap Image Processor (creates a google maps like html page): https://github.com/MamiyaOtaru/anvilmapper
If you come up with your own tool to process the image files I'd love to hear about it. Someone else already made one too: https://github.com/GauthIronstaff/VoxelStitch/
I really appreciate you taking the time to type that out and explain it. Will definitely allow me to continue on with my project!
I will not choose the route of having images outputted. It would be less of a strain on my server if I can manage to parse the uploaded data from my users and store it in a database, and will allow me to be more flexible with possible features for my online map viewer.
you bet
If you are serious about it, here's the code used to pull values out of the byte array (code can be easier to read)
You're just too awesome