RegenBlock
Part of the Minds of Chimera Project (dev)
CodeBlocks | MOCPlaytimeTracker | MOCDBLib | RegenBlock | MOCGoodEats | MOC3DImporter | ImageImport | MOCKiosk | MOCRater | MOCFizziks | GravitySheep | MOCChemistry | MOCRegistry
RegenBlock allows a creation of regions within Minecraft worlds that have a certain re-spawn timer assigned to them. Once a block in the region is destroyed by a player or a new block is placed it will regenerate to the old state after the timer is up.
Example uses
Regeneration of natural resources in certain areas, resetting of region to an earlier state - in a tutorial area on my server, there is a broken bridge that has to be repaired by the player, but after the player does so the bridge would normally remain fixed for the next player that does the tutorial, with RegenBlock I am able to "regenerate" old broken bridge. Can be possibly used as anti-griefing to some degree, but it will only check events associated with played placing or destroying blocks, not tnt, lava fire etc.
Permissions
regenblock.self - all or nothing permission for the use of any commands
Commands
(all at op level)
- Selection
- /rb select (ex,ey,ez) - Starts/stops player's selection mode. ex/ey/ez will expand selection in that direction. Y is vertical.
- /rb listselection - Lists player's current selection points.
- Editor
- /rb edit - Puts you into editor mode that allows you to change blocks in a region without triggering the re-spawn.
- Info
- /rb info - Print out information about the region in front of the character
- /rb list - lists all regions
- Global Blacklist
- /rb blacklist add/remove (id id id ...) - adds/removes supplied block IDs. Blacklisted blocks will be ignored by the plugin and not regenerated.
- Reload
- /rb reload - Reloads the configuration file. Use this if you updated regions through config.yml and have to reload it.
- Region management
- /rb create (name) [re-spawn time] - Creates a region based on your selection from /rb select
- /rb remove (name) - removes region from the list
- /rb type [typeId] - sets region type, 0 for normal, 1 for mine. Mine will regenerate only upwards and with random blocks that you specify with /rb spawnblock
- /rb sync [0/1/2/3] - sets region to regenerate all at once or not, 0 - normal operation, 1 - all blocks re-spawn at once based on first block broken, 2 - same as 1, but based on last block broken, 3 - blocks re-spawn in normal order, but shifted in time based on last block broken.
- /rb modify (name) [re-spawn time] - modify existing region
- /rb modify time (name) (re-spawn time) - modify existing region's re-spawn time
- /rb alarm time/message/radius (name) (value)- changes the region's alarm settings. Alarm will go off before blocks are due for re-pop to warn players.
- /rb rblacklist (name) add/remove (id id id ...) - adds/removes supplied block IDs for region. Blacklist blocks for a specific region.
- /rb feedback (name) (type) - sets feedback type for the region. 0 - none, 1 - on place, 2 - on place/remove
- /rb feedback set (string) - sets string sent to player during region feedback. Use TIME to show re-spawn time.
- /rb spawnblock (name) - lists region's spawn blocks.
- /rb spawnblock add (name) [id chance id chance...] - adds new blocks with spawn chance. Chances do not need to add up to 100.
- /rb spawnblock remove (name) [id id id...] - removes blocks.
- /rb repop (name) - Re-spawns all blocks in a given region
API
Method available directly from RegenBlock class.
public void regenBlock(Location location, Material material, byte data, Player player, Boolean isBreakEvent) location - block's location material - what material block should be set to once restored data - data value for the restored block player - player that broke/placed the block isBreakEvent - test if this is a BlockBreak of BlockPlace event.
http://pastiebin.com/?page=p&id=4f529966025a8 Does not work with 1.1-R5+ I am sure but I was using 1.2.3 Dev builds
@bigscary Things like torches, signs etc wouldn't get replaced correctly as well as beds, doors. Also explosions, lava, fire, water would not be corrected, but all those things are really out of the scope of the plugin. Although it does not mean I will not add those extra features in as the core that I need to work functions well.
As far as WorldEdit doing something similar, as far as I know it can only regenerate area back to a map's default state which is something totally different from what this plugin does. But if it does some sort of timed regeneration of certain regions to some non default state, I'd gladly use that instead.
Have you tested this with torches and all other kinds of blocks? Many blocks have to be placed in a certain order, respective to the other blocks nearby. For example, if you place a torch before the block it's attached to, it drops as an item and you fail to correctly restore the torch to its original state.
Also, any checks to make sure you're not regenerating an area where a player is standing? That will kill them.
Finally, maybe you know this, but WorldEdit already has a very powerful feature just like this one.
@Raidendex
Maybe a feature to allow blocks to regen all in the same time on a interval set via command? Maybe toggleable in config?
@Crayder
Yep, everything will be converted to whatever your spawnblocks table is.
And yes feedback is sent on every block. I guess it can be on some delay, though I'm not sure if that defeats the purpose of the feedback in the first place. I don't use it myself, so whatever works for you.
@Raidendex So basically, if I am truly creating a "respawnable mine", I should ONLY select a region that I expect (or already is) to be completely mineable? I can't be sloppy and select a huge region for it, that includes grass, etc., because once destroyed their will respawn as stones or ores, whatever I determine?
Also, for both RM and RB, does the feedback message occur EVERY time a block is destroyed/placed? It'd probably be less of an annoyance to display it once every minute or two if so.
Another project of mine, if you want to play around with it. Not sure how would you really use it, but it's something different, maybe for fun of punting people around or something lol
http://dev.bukkit.org/server-mods/mocfizziks/
@Crayder
Works kinda the same as regenblock, if fact i just copied it all over and added couple lines.
If block is placed within a mine... it will be removed on a respawnTime. if block is destroyed within a mine... we first figure out which block we should re-spawn instead by reading the spawnBlocks field and their probabilities and generating a random number from which we get block type. You can add / remove blocks from the list and set any probabilities, do not have to add up to 100. command is /rm region respawnblocks regionName add/remove typeId probability typeId probability etc (for remove just types)
or can just edit the yml file and reload.
say you have type 1 with probability 50, type 2 with prob 50, and 3 with prob 50... it will basically give each type a 33% chance to pop instead of whatever was destroyed. Block that was there initially is not considered at all so if you place this in sandy area and set it to pop rock it will replace everything with rock eventually as you mine through it
@Raidendex
Awesome dude! Really loving this progression and development. Does it just fill the region with stones and ores, or will it only replace the stones and ores in a region you select?
@Raidendex
Try this out guys. http://minecraft.dmg2.net/RegenMine/RegenMine.jar
Mostly same stuff, but allows for randomized regeneration. By default regions will spawn 80% stone, 15% coal, 5% iron. Can add more, remove etc ... if you remove all i think it would just regen whatever it was so in a way work like regenblock, but this will only regen upwards, so if there is no block under, it will wait until there is.
Will probably add this into the RegenBlock eventually, so you could have different region Types. 0 for normal, 1 for mine, maybe more?
@bruuff
Sounds good but I don't want to clutter this plugin too much with diff features like that. It would be cleaner to do something like that as a separate plugin. I will be making one for a mine regen with upwards regen only and some % chance to spawn different ore etc.
some nice suggestions came to my mind:
would it be possible to have a regeneration mode that takes replaced blockes from a supply chest that needs to be refilled by the player(s) if something was damaged and repaired? this way a town could recover easily from an attack, but it has to get atleast the materials for that.
another intresting feature could be that regeneration stops/slows if a player is near. this way a) noone can wait in front of diamond ore and mine it in every commercial b) noone can suffocate from regenerating blocks or c) loose the small emergency hut that he might have built to be save from mobs and regenerate
greetings, bruuff
Just tried destroying and placing blocks within a region, everything re-pops correctly as far as I can tell. So it's likely you have block that you are placing blacklisted and thus it is ignored by the plugin.
@watdidyusaey
Well for now I will be updating it as my server needs it. In worst case, each jar file I upload also has source code included so anyone is welcome to take over :)
As far as lava/water and tnt. I've tried to handle those before even though that's not the purpose of the plugin, but fighting lava and water did not work out too well lol. And tnt I can sort of catch the explosion and restore the blocks, but for whatever reason about 15-20% of the blocks do not get caught by the plugin. Perhaps too many events are being called at same time so some fall through. In either case for tnt best way would be to just cancel the explosions or not even allow them on the server, which other plugins can do. Also what I've noticed, to catch the tnt even I have to monitor block physics event and that one fires a lot, causing a large amount of blocks to be queued for re-spawn that aren't even damaged.
@squatingyeti
I'll test it later, make sure there is no blacklist set up that is ignoring the blocks you are placing perhaps?
@kahlilnc
There is a setting that can notify the player that what they just placed or destroyed will be regenerated in the re-spawn time. and that is for each block they place or destroy. As far as doing some sort of announcements, first each block will regenerate at its own time so there would be quite a few of broadcasts, second I do not think there is a very efficient way to see if players are close to a particular area, so that whole thing would just add extra load to the plugin.
The latest build is not removing blocks that are placed in a defined region, just broken blocks. Also, is there no way to define a region down to a set level and up to a set level?
For instance, if I want to regen a starting area in which new players can hang out to gather some resources and survive until they are ready to move on, blocks below the two points I set are not regenerated.
Hey, I'm thinking of using this plugin for a core feature in our server.
Do you know if you'd support/update this plugin consistently? or if not how long would you support it?
Also do you know if you'd ever add support for lava or tnt? I'm looking for a replacement for creeperheal that doesn't actively replace blocks and replaces player destroyed blocks as well.
IDK IF I asked this already but could you add, warning support? Such as 1 min before the blocks regenerate in the region there will be a warning locally in a radius saying [RB] Regenerating in 1 minute. Something like that. As an option at least set up with commands? :D
Ok added feedback message customizations and per region blacklists.
Will be version 2.7 when it gets approved.