TehNut-Mods / Soul-Shards-The-Old-Ways

Custom spawners for any and all mobs!
http://minecraft.curseforge.com/projects/soul-shards-the-old-ways
MIT License
14 stars 11 forks source link

[API] API-ify Soul Cage so integration with other mods is easier. #12

Closed TehNut closed 8 years ago

TehNut commented 8 years ago

Requested by @ProfessorProspector for https://github.com/TechReborn/TechReborn

Prospector commented 8 years ago

well probably more for an addon but yes.

Prospector commented 8 years ago

Preferably I could just extend a BaseCage and tell it when to handle the mob spawning. Something like canSpawn() and I could return true if it has enough energy and stuff.

TehNut commented 8 years ago

Well I assume you would want to be able to modify speed as well

Prospector commented 8 years ago

ah yes, that too. I also need to add a Nicolas Soul Cage that is super fast :P

TehNut commented 8 years ago

I'm not sure how feasible doing it all through the API is. But I can move some checks into their own methods. So you'd extend TileEntityCage and override getCooldown() (to change spawn speed), getSpawnAmount() (to change amount of mobs spawned), and canSpawn() (if spawning is allowed). Other than those three methods (and any helper methods you need for your own stuff), the rest should be able to be left untouched.

http://paste.ubuntu.com/15623779/

Prospector commented 8 years ago

Yeah, looks good.