Skip to content

Level.getEntities refactored and fixed some spawner related bugs #904

merged 15 commits into from Mar 19, 2012

3 participants

olilo commented Mar 15, 2012

Hey you all.

I am new to this project, but I saw the Mojam live. I began muddling around in the source code on my own after Mojang released it, without knowing that you already built up this github project. It has come along really nice I must say - you have done a great deal of work here :).

So here is the little I have done in the short time:

  • A bit of refactoring in the Level (to eliminate duplicate code and reduce the cyclomatic complexity a bit ... but it will still be a lot of work until it's below 100).
  • (hopefully) fixed issue #823: Spawner should not be placed on treasure chest or under turret
  • added IntelliJ Idea configs (if you don't like them, then I can take them out of this pull request)

So, I hope you'll find it useful and that I may provide more changes in the future.

olilo added some commits Mar 15, 2012
@olilo olilo added idea related config (and necessary ignores) 6f4b188
@olilo olilo some more idea configs 7c00bdb
@olilo olilo enabled some inspections for cleanup dce9085
@olilo olilo code style settings for idea 81492cb
@olilo olilo full configuration to run it from idea d4ad9c5
@olilo olilo overhaul of Level.getEntities
The logic whether a given entity should be considered in the getEntities method is now inside
so-called BBPredicates ("so-called" because I named them so :-P).
On the first glance this appears to be more code for exactly the same effect,
but it eliminates the duplicate content in both methods.
It also opens up further flexibility to use that method.
@olilo olilo RandomSpawner: Combined player/spawner nearby check 287b490
@olilo olilo spawn surroundings check is now in extra class
This should fix issue #823, while at the same time providing some nice refactoring :).
@olilo olilo issue #823: also fixed in vanilla gamemode 7739acc
@olilo olilo spaces -> tabs
Sorry, I didn't know before that you use tabs. I will stick to tabs from now on.
@olilo olilo issue #823: don't place spawner on spike trap either fc53e17

Hi @olilo thanks for the refactor, looks good to me
No problem if you add an extra IDE, i don't mind for extra support, makes it easier on the people who start with this project, to use their own favored IDE, but it's strange nobody yet gave vim or emacs profiles (evil ancient war ;))

is this one ok for the rest?
no answer after couple of days is auto merge by me :)

Flafla2 commented Mar 19, 2012

I'm okay with it. +1

@Maescool Maescool merged commit 45ea3ba into Maescool:develop Mar 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.