kangarko / CoreArena

A high-end monster arena Minecraft plugin with procedural damage and RPG system. Maps included!
https://www.mc-market.org/resources/21643/
30 stars 12 forks source link

Quick Request... Next Phase Mode: Timer / Monsters combo #422

Closed LeehamElectronics closed 3 years ago

LeehamElectronics commented 3 years ago

Hey Matej, I know it's open source now and you're not really taking feature requests, but do you think you could find the time to implement this? Basically while your playing, the game will go to the next phase if you kill all of the mobs, OR if the timer runs up it will go to the next phase.

The code has already been written, all it takes is to implement both methods of checking for if all mobs are killed, or, has timer run exceeded.

Thanks heaps Matej!

LeehamElectronics commented 3 years ago

This is really important on my server, it would mean a lot to me! If I knew a bit more about Java I would try it myself 😂

kangarko commented 3 years ago

Got it, yeah if you're asking for a combination of these so both A) AND B) conditions must be met, I'll add that within 24h :)

kangarko commented 3 years ago

Oh you can just use arena.getAliveMonsters() method and if they are 0 then all mobs are killed.

I've added arena.getPhase().getWaitedBetweenNextPhase() method to return the amount of seconds we've waited since the last phase. CoreArena-2.8.10.jar.zip

LeehamElectronics commented 3 years ago

Great thanks! So what do I put in the field for next_phase_mode? is it both? cheers

LeehamElectronics commented 3 years ago

Got it, yeah if you're asking for a combination of these so both A) AND B) conditions must be met, I'll add that within 24h :)

Actually what I am looking for is checking if EITHER condition is met. So if there are no monsters, OR if the timer runs out, it will go next phase. The reason I need it is because in some larger arenas a player will get stuck because they can not find a hidden mob.

kangarko commented 3 years ago

Can't you just get the arena region using Arena#getSettings#getRegion and then use a method to return all entities within a 3D region (primary and secondary location)? Then you just iterate through these entities and remove the forgotten ones.

LeehamElectronics commented 3 years ago

Oh sorry I thought you implemented it already in the jar file you sent me. I don't know much about Java but I guess I will try to implement it. I don't think I'll be able to but if it works I'll make a pull request 😂

kangarko commented 3 years ago

So sorry, just made it all public: https://github.com/kangarko/CoreArena/releases/tag/2.8.11

Was just this commit I added: https://github.com/kangarko/CoreArena/commit/a2c5dc71817f4d48d1e45085f441a553554ecd5f