User Name
Password
AppleNova Forums » GamingNova »

MC: Decompiling and deobfuscating Minecraft Server beta 1.8.1


Register Members List Calendar Search FAQ Posting Guidelines
MC: Decompiling and deobfuscating Minecraft Server beta 1.8.1
Thread Tools
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
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! 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.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2011-09-19, 23:26

If you go into our desert town and create a patch of rich green grass (whatever that biome is) will it operate as THAT biome or does it still in truth belong to the desert biome? I suspect the answer is that it still belongs to the desert biome.


...

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
billybobsky
BANNED
I am worthless beyond hope.
 
Join Date: May 2004
Location: Inner Swabia. If you have to ask twice, don't.
 
2011-09-19, 23:34

I have seen 1 duck spawn in our desert, but it might be because it was *near* a river biome.

A couple comments: it seems that animals are biome specific (not absolutely, but pretty much) -- ie you find a lot of herd animals on planes, ducks in jungles, etc. I have also certainly run into a plain absolutely filled with cows (and others filled with sheep) -- more than 20, to be sure, more like 40. Now it is possible that the persistence thing worked, and they spawned before, remained around, and more spawned later, but it is clear that you can encounter herds of creatures unlike pre1.8. Is this coded somewhere?

I asked about where towns spawn in game tonight -- all of ours are in desert biomes, is this a necessity?

Last edited by billybobsky : 2011-09-19 at 23:46.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2011-09-19, 23:51

When do we finally get horses???

...
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2011-09-20, 05:59

Wait, we found the third town?
  quote
Robo
Formerly Roboman, still
awesome
 
Join Date: Jul 2004
Location: Portland, OR
 
2011-09-20, 06:36

Quote:
Originally Posted by Brad View Post
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...


Quote:
Originally Posted by Brad View Post
...if you have questions.
I'm never going to learn how to computer, am I
  quote
billybobsky
BANNED
I am worthless beyond hope.
 
Join Date: May 2004
Location: Inner Swabia. If you have to ask twice, don't.
 
2011-09-20, 07:46

Quote:
Originally Posted by ThunderPoit View Post
Wait, we found the third town?
And forth evidently.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2011-09-20, 08:13

Yes, I found a town and named it "Piggsburgh". The coords are in the other 1.8 thread. It's a pretty big town and it's in a much nicer clime with lots of critters. SHOULD there have even been a fourth town?

Question for Brad:
So is it likely that there's a stronghold near my town?
Is that the way it works?



...

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-09-20, 08:13

Quote:
Originally Posted by billybobsky View Post
I have seen 1 duck spawn in our desert, but it might be because it was *near* a river biome.
It probably wandered in from the River biome.

Quote:
Originally Posted by billybobsky View Post
more than 20, to be sure, more like 40. [...]
The "20" number I mentioned as a maximum is the number that are able to spawn at a given spawn opportunity. Since spawning can happen once every 40 seconds and mobs persist (for a while at least), you definitely can run into more than 4 of a given animal type at a time. Plus, I think there's a separate algorithm that kicks in upon creation of a brand new chunk, but I haven't pinned down its workings yet.

Quote:
Originally Posted by billybobsky View Post
I asked about where towns spawn in game tonight -- all of ours are in desert biomes, is this a necessity?
I've definitely hit a town outside of a desert in another SSP world (in a Plains biome), but this sounds like a neat one to investigate in the source code. I'll try finding this algorithm tonight too...

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
Bonn89
Member
 
Join Date: Nov 2006
 
2011-09-20, 09:20

I think (but I'm not 100% sure) that Notch and Jeb changed the town spawning requirements to require relatively flat land, after people who where playing the pre-pre-release (o_O) found towns in the middle of oceans and whatnot.

The issue with requiring flat land is that the only two biomes where largish expanses of flat land occur are deserts and plains, and deserts seem to be much more common than plains.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2011-09-20, 09:39

One of the doors of a building in my town was blocked by granite, the roof nearly digging into a hill. But it's a nice spot with relatively gentle terrain.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-09-20, 11:27

Quote:
Originally Posted by drewprops View Post
If you go into our desert town and create a patch of rich green grass (whatever that biome is) will it operate as THAT biome or does it still in truth belong to the desert biome? I suspect the answer is that it still belongs to the desert biome.


...
Biome data is calculated independently before blocks are set down. So, if the area was a desert biome before, it will still be a desert biome after you set down grass or any other block.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
MC: Minecraft beta 1.5 released! 709 GamingNova 120 2011-05-02 19:49
MC: AppleNova Minecraft Server Discussion Brad GamingNova 6 2011-04-14 17:10
MC: Minecraft Beta 1.5 Sneak Preview! Robo GamingNova 32 2011-04-11 16:17
AppleNova Minecraft Server Brad GamingNova 1450 2011-04-10 15:01
Official AppleNova Minecraft Server Details Brad GamingNova 0 2010-12-15 22:31


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 05:38.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova