Brad
2011-09-19, 22:57
I just spent my evening manually de-obfuscating the big wad of decompiled Minecraft server code. There are over 500 classes in the server itself. Many classes I've found already annotated by Craftbukkit, but even those are mostly populated with "useless" method and variable names. So, I've been using an IDE to refactor the whole code base whenever I can figure out what some method does or some variable means.
I've been looking for a few specific things that have been bothering me, and sure enough, I'm finding some answers...
edit: Oh, and if it's not obvious: SPOILER ALERT.
Q: What's up with animal spawning? Why do some of my old maps generate *no* animals at all?
A: So many factors are working against spawns! :grumble: First, we have biome-specific spawn settings. There are effectively: BigHills, Desert, Forest, Hell, Ocean, Plains, River, Sky, Swamp, and Taiga. Ocean, Desert, and Hell are set to spawn *no* animals. Ever! This means Sedona and South of the Border can't have animal farms. Animals only get the chance to spawn once every 400 ticks (40 seconds!) within 8 chunks in each direction of each player but not within 24 blocks of any player. Generally, Pig and Chicken have equal chance to spawn, Sheep has slightly higher chance, and Cow has slightly lower chance. Wolf only spawns in Forest with less chance than the other four types. A maximum of 4 of any type will spawn at a given time, giving an absolute maximum of 20 animals across the whole world every 40 seconds in the absolute best circumstances.
The answer to my second question there is that some of my maps (like the Survival Island map I kept bitching about) now have their biome data rearranged so that now I'm in the middle of an Ocean biome. Thus, no new animals.
Craftbukkit has no hooks in any of those options, by the way. I'd be tempted to contribute a patch, but I'm still far from that stage of development here...
Q: Why does the creeper seem to have a wider sensitivity radius in SMP than SSP? Why do enemy hitboxes generally seem smaller in SMP than SSP while their reach is farther?
A: Not sure yet, but I'm finding pieces of the puzzle. The creeper fuse lasts 30 ticks (3 seconds). Monsters in general will attack once every 20 ticks. Monsters will seek out players within 16 blocks (except for Endermen at 64 blocks). I've found how attack damage is applied to entities, but I've not quite pinned down how the intersection of the mob and a player's weapon is determined.
Anyone else have some pet peeves with the current version of Minecraft SMP that you're dying to figure out? I'm pretty exhausted from this code spelunking session, but I might have another go at it later this week if you have questions.
I've been looking for a few specific things that have been bothering me, and sure enough, I'm finding some answers...
edit: Oh, and if it's not obvious: SPOILER ALERT.
Q: What's up with animal spawning? Why do some of my old maps generate *no* animals at all?
A: So many factors are working against spawns! :grumble: First, we have biome-specific spawn settings. There are effectively: BigHills, Desert, Forest, Hell, Ocean, Plains, River, Sky, Swamp, and Taiga. Ocean, Desert, and Hell are set to spawn *no* animals. Ever! This means Sedona and South of the Border can't have animal farms. Animals only get the chance to spawn once every 400 ticks (40 seconds!) within 8 chunks in each direction of each player but not within 24 blocks of any player. Generally, Pig and Chicken have equal chance to spawn, Sheep has slightly higher chance, and Cow has slightly lower chance. Wolf only spawns in Forest with less chance than the other four types. A maximum of 4 of any type will spawn at a given time, giving an absolute maximum of 20 animals across the whole world every 40 seconds in the absolute best circumstances.
The answer to my second question there is that some of my maps (like the Survival Island map I kept bitching about) now have their biome data rearranged so that now I'm in the middle of an Ocean biome. Thus, no new animals.
Craftbukkit has no hooks in any of those options, by the way. I'd be tempted to contribute a patch, but I'm still far from that stage of development here...
Q: Why does the creeper seem to have a wider sensitivity radius in SMP than SSP? Why do enemy hitboxes generally seem smaller in SMP than SSP while their reach is farther?
A: Not sure yet, but I'm finding pieces of the puzzle. The creeper fuse lasts 30 ticks (3 seconds). Monsters in general will attack once every 20 ticks. Monsters will seek out players within 16 blocks (except for Endermen at 64 blocks). I've found how attack damage is applied to entities, but I've not quite pinned down how the intersection of the mob and a player's weapon is determined.
Anyone else have some pet peeves with the current version of Minecraft SMP that you're dying to figure out? I'm pretty exhausted from this code spelunking session, but I might have another go at it later this week if you have questions.