Skip to content

Minigame Regeneration

Narimm edited this page Jul 6, 2018 · 7 revisions

Minigame Regeneration

Minigames 1.6.2+

Minigames 1.6.2 and above have a new regeneration type using regeneration areas. While the old regeneration still exists (without using a regeneration area), the new regeneration type majorly expands upon the possibilities of games that require regeneration. This new regeneration does not need to be used under all circumstances though. A lot of games are still possible without it, such as regular spleef and any game with standard block placing and breaking. The only time you'll need to use a regeneration area would be for TNT spleef, explosion related games, times where blocks will be broken naturally (leaf decay) or by fire/lava and cases where lots of redstone devices are used.

Standard Regeneration

The standard regenerator that is assigned to all games is capable of quite a lot without needing any setup. This regenerator is capable of:

  • Restoring blocks broken or placed by a player
  • Respawning animals attacked by a player
  • Restoring items in a chest where a player breaks or interacts with it
  • Restoring water placed or taken in/from a location.
  • Removing placed paintings and item frames.
  • Removing shot arrows.
  • Removing thrown enderpearls (stopping players teleporting into the game once it ends)
  • Removing or restoring vehicles (boats and minecarts) that were created or destroyed by the player.

Basically anything a player does in a game can be restored, therefore it can be used in spleef and other block related games without any issue. TNT is not included in basic regeneration as of a missing action in the bukkit API. In these cases, advanced regeneration should be used. With a little extra setup, you can add specific restore blocks to be regenerated every time a game is played. This is useful for cases where a player will not interact with a specific block but it needs to be restored after every game. This includes:

  • Hoppers
  • Droppers
  • Dispensers

Since these can be triggered with redstone, they will not regen automatically without a regeneration area from advanced regeneration. However applying a restore block setting to them will make sure they're recorded for every game without the use of this larger restore. Restore blocks can be assigned either by the Minigame Tool or using the set command.

Advanced Regeneration

Advanced regeneration as of 1.6.2 is a fairly complicated regeneration. For this to be used, a Minigame must have a regeneration area set up, this can be done either by using the Minigame Tool or using the set command for creating regeneration areas. What advanced regeneration does is record the entire area selected by the regeneration area and store it so it can be referenced when the game ends. Once the game is over, the restoration process will begin. The restoration will be pretty quick and cause no lag to the server, no matter how much it needs to restore.

This is achieved by the regenerator checking to make sure its not lagging the server for too long, if it starts to pass its set delay time, it will pause, allowing the server to continue running and then it will continue its regeneration. The time that the regenerator can “lag” the server can be set via the main Minigame config file, however the default setting will work fine on most servers. The regeneration happens per chunk as well, this prevents block update lag to the players client. This means the whole regeneration is nearly unnoticeable to any player on the server.

This regenerator also prevents Minecraft related events from happening within the regeneration area, such as:

  • Water and lava flow
  • Fire spread
  • TNT explosions
  • Player interactions (just in case)
  • Block falling (sand and gravel)

However, if a TNT chain reaction starts after the regeneration has completed, this will not be prevented. In this case, there is a setting to delay the rollback initiation which can be set either via the Minigame edit menu or using a set command.

Demonstration Video

Demonstration Video

Pre Minigames 1.6.2

Minigames has its own in build regenerator. So if players break blocks or modify a Minigame in any way, it will be restored when the game ends. Without the use of regeneration areas or Restore Blocks (more advanced options), Minigames can restore:

  • Blocks broken or placed by players
  • Arrows that have been shot by players
  • Player placed and destroyed vehicles
  • Animals killed by a player
  • Player placed pistons
  • Chest changes (Items being removed or the chest being destroyed)

Basically almost anything the player does while in a Minigame will be reverted once it ends. In the case of Single player, everything that a player does will be reverted when they quit or win, other players in the Minigame will still have their changes. Once all the players have quit or finished, any other changes will be reverted too, such as restore blocks or things that happened within a regeneration area.

Advanced Regeneration

If you require more complex regeneration, such as pistons that aren't directly interacted with by a player or TNT or Creeper explosions, there are more advanced ways to regenerate a Minigame.

Restore Blocks

Restore blocks are mainly used for Droppers, Hoppers and Dispensers since they are mostly controlled by redstone. TNT currently must also be a restore block due to the fact that Bukkit currently has no event to control when a TNT block is about to be ignited.

To create a restore block, stand on the block and type:

/minigame set <Minigame_Name> restoreblock add <Name>

This will add a restore block to the Minigame using the name specified. This is not the name of the block you wish to add, this is just a reference name in the event you need to remove this restore block later. Alternatively you can look at the block you wish to add and add the parameter -l at the end of the above command to add the block you're looking at.

Regeneration Areas

Sometimes things are hard to predict and are not directly interfered with by a player. For this there are also regeneration areas. These can be used for things like fire, lava and water spread, tree growth, leaf decay and more. To create a regeneration area, stand at the top most corner of an arena and type:

/minigame set <Minigame_Name> regenarea 1

Then stand at the furthermost bottom corner and type:

/minigame set <Minigame_Name> regenarea 2

You've now created a regeneration area around your Minigame.