Dynamic block respawn based on player count

Discussion in 'Archived: Plugin Requests' started by vincam, Nov 20, 2013.

  1. Offline

    vincam

    Let me apologize in advance if any parts are not clear. Please ask, and I'll clarify.​

    I'm looking for a plugin that can dynamically control block re-spawn rates based on the amount of players currently online or offline, who have the necessary permission to be counted. Each type of block can then be assigned a credit value (eg. Stone = 2, coal = 4, iron = 8, etc). the trickle of credits is then distributed from the top down to all resources that are being tracked by the plugin.

    For the sake of example, let's assume that Online players feed 2 credit/second into the re-spawn rate, and offline players feed 1 credit/second. There are 20 players online and 15 players offline who have the required permission. So that puts us at (2 x online players)40 credits/second + (1 x offline players)15 credits/second = 55 credits/second.

    So 55 credits/second would be the re-spawn rate of all resources accounted for. Let's say that we are only tracking these 3 resources:

    (16 Credits)Diamond
    (8 Credits)Iron
    (2 Credits)Stone

    Now the credits would be split evenly between each resource type, and any left overs carry over to the next round of re-spawns.

    --------------|-18 Credits % 16 Credits/Diamond = 1 Diamond re-spawn, 2 credits carry over.
    55 Credits --|-18 Credits % 8 Credits/Iron = 2 Iron re-spawn, 2 credits carry over.
    --------------|-18 Credits % 2 Credits/Stone = 9 stone re-spawn this second.
    --------------|-1 Credit left over + 2 Credits from Diamonds + 2 Credits from Iron = 5 carry over.

    -------------|-20 Credits % 16 Credits/Diamond = 1 Diamond re-spawn, 4 credits carry over.
    55 Credits --|-20 Credits % 8 Credits/Iron = 2 Iron re-spawn, 4 credits carry over.
    + 5 Carry --|-20 Credits % 2 Credits/Stone = 10 stone re-spawn this second.
    --------------|-0 Credits left over + 4 Credits from Diamonds + 4 Credits from Iron = 8 Carry over.

    Keep in mind the system MUST be able to scale dynamically in accordance with the current player base. What happens if 10 more players go offline (10 online + 25 offline)?

    -------------|-17 Credits % 16 Credits/Diamond = 1 Diamond re-spawn, 1 credit carry over.
    45 Credits -|-17 Credits % 8 Credits/Iron = 2 Iron re-spawn, 1 credit carry over.
    + 8 Carry--|-17 Credits % 2 Credits/Stone = 8 stone re-spawn this second, 1 credit carry over.
    -------------|-2 Credits left over + 1 Credit from Diamonds + 1 Credit from Iron + 1 Credit from Stone = 5 Carry over.

    And so on...

    When an ore is mined, it turns into a block of bedrock until it respawns, where it then turns back into the ore it was assigned.

    Anyways, thanks for the help in advance!

    <Edit by Jade: Removed discussion violating ToS>
     

Share This Page