Published Jul 25th, 2013, 7/25/13 4:11 pm
- 9,584 views, 1 today
- 653 downloads, 0 today
8
A great many players use extreme survival maps like the SkyBlock (and related) maps. Unfortunately there is a "bug" right now in vanilla Minecraft that causes players to randomly move around the spawn location. This is particularly bad for players on maps where the areas right near the spawn are deadly.... where you can fall into lava or into the void (like the SkyBlock map). This can be very irritating to even making some maps impossible to use at the moment.
The bit of code in vanilla Minecraft which causes this is as follows:
if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) { int var9 = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6); var6 += this.rand.nextInt(var9 * 2) - var9; var7 += this.rand.nextInt(var9 * 2) - var9; var8 = par2World.getTopSolidOrLiquidBlock(var6, var7); }
Note the "getSpawnProtectionSize" function is as following in vanilla Minecraft:
public int getSpawnProtectionSize()
{
return 16;
}
For non-programmers, what this means is that in vanilla Minecraft you will move around about 16 blocks in a random direction from the spawn point when you die or appear on the map for the first time. This is a really good thing in a multi-player server on ordinary maps, as multiple players will appear in slightly different locations when they are respawning in large numbers. For survival single player games and some specialized maps, this is not a very good thing.
What this mod attempts to do is simply "fix" Minecraft to get rid of that "fuzz", making the spawn point as selected with MC Edit or other tools to be a fixed and specific point on the map. What I've done is pretty much remove the above code from a single class that isn't used by many mods. This should be compatible with both ModLoader and Minecraft Forge, and goes into the "minecraft.jar" file or rather whatever you have named the modified Minecraft jar file with the new launcher where you would like to use this fix.
The bit of code in vanilla Minecraft which causes this is as follows:
if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) { int var9 = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6); var6 += this.rand.nextInt(var9 * 2) - var9; var7 += this.rand.nextInt(var9 * 2) - var9; var8 = par2World.getTopSolidOrLiquidBlock(var6, var7); }
Note the "getSpawnProtectionSize" function is as following in vanilla Minecraft:
public int getSpawnProtectionSize()
{
return 16;
}
For non-programmers, what this means is that in vanilla Minecraft you will move around about 16 blocks in a random direction from the spawn point when you die or appear on the map for the first time. This is a really good thing in a multi-player server on ordinary maps, as multiple players will appear in slightly different locations when they are respawning in large numbers. For survival single player games and some specialized maps, this is not a very good thing.
What this mod attempts to do is simply "fix" Minecraft to get rid of that "fuzz", making the spawn point as selected with MC Edit or other tools to be a fixed and specific point on the map. What I've done is pretty much remove the above code from a single class that isn't used by many mods. This should be compatible with both ModLoader and Minecraft Forge, and goes into the "minecraft.jar" file or rather whatever you have named the modified Minecraft jar file with the new launcher where you would like to use this fix.
Progress | 100% complete |
Game Version | Minecraft 1.6.2 |
Tags |
2345853
7
Create an account or sign in to comment.
The specific spawn location is stored in the save file, and is editable by MCEdit as well as other programs. It is not a chunk, but a specific location. That data is also requested in the WorldChunkManager.findBiomePosition method, which calculates that original position which is in turn saved in the data file.
You are simply wrong on what you are are saying, as the code of Minecraft itself contradicts everything you said. Mind you, this "fix" is already done, and it works with Noobcrew's Skyblock map.... which is one of the reasons why Noobcrew edited his original Skyblock post to link to my mod.
At least try it before you throw cold water on this and claim it doesn't work. I certainly did the research on this.
Mind you, I think the reason for this is because Mojang wants to spread players out from the original spawn point on multi-player servers. This became an issue even with LAN servers, but the fuzz distance setting has not been brought forward into the configuration file. It is indeed a bug that needs to be fixed eventually in Minecraft. This mod really doesn't "fix" the bug in the sense of loading the data from the Minecraft config file like a proper fix would do, but it does the same thing as setting that fuzz distance to zero.
Note that the "/set spawn point" does the same thing as sleeping in a bed, which is a different X,Y,Z location and not the "default" spawn point.
{
return 16;
}
This means the game chooses a 32x32 X, Z coordinate centered around the original spawnpoint to spawn the player when they die...if the spawn wasn't set directly to an X, Y, Z location. If the spawnpoint was modified, the game will spawn you where it was set to.
I don't know how to program, but I understand programming just fine.
Yes, there are alternatives for map makers to do things like setting the spawn point as you suggest. Not all map makers have done that, for whatever reason that may be. There are even some vanilla maps (depending on the seed) where this can be a problem... although admittedly Minecraft tries to make that not happen. The SkyBlock map in particular and some of the older extreme survival maps have not set this spawn point, because the randomization was something Dinnerbone (I am presuming) added to Minecraft about version 1.3 of Minecraft. Setting the spawn point like you suggest also doesn't work if other people are getting into your world through LANs or in a multiplayer server either.
BTW, that particular version was even more buggy than it was now, where the randomization would even throw you into solid rock to sufficate upon spawning in some situations. Thank goodness this particular problem has been fixed (as of MC 1.5), but the random fuzzy spawning still does happen.
I'm not saying this is a universal fix, as it isn't. For most people playing Minecraft, they really wouldn't care. But for those who are frustrated with a particular thing that I still insist is a bug in Minecraft that hasn't been fixed yet as of 1.6.2, this particular patch to Minecraft might help them play on some custom maps that otherwise are unplayable when you die.
I'll also note that this mod was more of an afterthought for something else I was working on. I made it available to people to use because they were complaining about problems on some of these maps, so I figured "why not" to make it available.
I sure am not interested in trying to earn "Planet Minecraft" points or any other such drivel from this, as I posted the mod originally almost a year ago. In fact, I didn't really expect anybody to use the mod, but apparently it is quite popular and has been used by far more people than I ever imagined. That is why I also updated it to 1.6.2. I threw it on Planet Minecraft simply to expose it to more people as I think it is perhaps a bit useful in some situations.
Perhaps Dinnerbone will get around to finishing the "fix" to what was originally a pretty serious bug. At the moment it still is a minor bug, and an annoyance in some situations.