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.
@Raidendex thanks for looking at it. I'll keep looking here regularly, just in case you find a safe way to implement it ;)
@Azpet
All new uploads have to be approved by bukkit staff, that can take from few hours to few days.
@Raidendex
I think something went wrong? In my subscription to the plugin files it said that it was updated and when I press the link in my mail it works, but when you press download on the top of this page or look into the files you can't see 5.6. Might be an update problem of bukkit that will fix itself, but I thought I might tell it to you ;)
@Raidendex
Thank you soo much! You just made my day!
@Azpet Uploaded 5.6
Added new type of sync region /rb sync <region name> 3
Same as 2 but preserves the block order when re-spawning.
@Raidendex
Hello my good sir. Might there be an easy way to make it so the delayed timing thingy will still regen in order (block by block). This will means for a lower pressure on the server and less chance to get stuck within a region. I hope this is possible and if it is it won't take too much time to program. Thanks already for the implementation of the delayed timings!
@Puntafaard
Well I would either have to record all original blocks or keep track of all new placements, either solution seems bad to me. So I can't really do anything to support what you need, sorry.
So basically this plugin resets a region for example: I have a battlefield: one day later, it is all on fire and broken and then this plugin resets that automatically after I create the region?
Basically I want to keep all the trees exactly how they look with players being able to mine them but it comes with a lot of set backs like the ones I just explained.
@Raidendex
Yeah I'm the one that suggested that option. If you remember, my server has at least one hundred thousand custom trees that will not grow back the same if you were to mine them and place a sapling. The problem was that if I set the region for the whole continent, players would not be able to place logs or leaves because they would just reappear. Then you made the monitor place or break option for me. Then I realized that this would not solve the problem because even after a player would set wood or leaves down and try to break them they will just regenerate. So basically what I'm saying is that would it be possible to have regenblock completely ignore regular player placed blocks?
@Puntafaard
Not 100% what you mean, but
in config.yml
monitorBreak: true monitorPlace: true
Set either to false and it won't monitor that action.
@Raidendex
How much work do you think it would take to implement a feature where it does not regenerate regular player placed blocks? I don't know if you remember the problem I was having but this would solve it for good.
Uploaded 5.5
Added new type of sync region /rb sync <region name> 2
This will keep updating respawn time of all blocks in queue for the region as new blocks are broken. Effect - region will respawn all at once when any building / breaking stops in the region is specified respawn time has passed.
-I've played around a bit with sand/gravel falling. If I allow those kind of physics events to happen, I can't for guarantee that region will be able to return to it's initial state. So I'm keeping it as is for now.
I'm sure it's possible, but feel like it would take too much checking. If someone wants to come up with a fool proof code for catching BlockPhysicsEvent and identifying that it should be restored or ignored go ahead I'll add it in.
To start few things to weed out extra events is to make sure that cause block type is Air, if its something else I think that's just placing. a block next to a block. Next that will be called for up to 6 blocks I believe, although it would be hard to break a block that's in the middle of 6 :) So here you probably should check if block under the say sand block is air, i.e. sand block is about to fall. Just this was not enough and some stray blocks found their way to respawn wrong or not respawn at all. Few other things - once the location is in the queue, calling respawn on same location again will not do anything. This is to make sure actual original block repops. Second, when blocks are respawned, physics are cancelled so stuff like sand can repop up in the air and not fall.
This is what I do atm for them.
@Azpet
That's ok I never look there.. in fact just saw some tickets are there for random things.
Only get notifications about comments.
@Raidendex
I will make an enhanched ticket ;)
@Raidendex
Yes! Exactly! Are you going to try to implement it? Just as an option would be awesome too! Thanks!
@Azpet
If I reverse how sync works I suppose that can be done, so every new block added to the queue will update respawn times of all other blocks in queue from the same region
I would like to use this on a pvp server. Is there any way you could make it possible so the regen won't start if there are still blocks edited in the region (maybe an enable/disable feature)? For example: I'm attacking a castle and breaking walls etc. But I don't want the walls te regen when I'm still attacking. After the attack (when no more blocks are being edited and a timer has gone by) the castle would need to regen so it's ready for a next attack. Thanks already! This would really make my server work!
@IgnuzTR
When I was initially writing RB there were some issues with trying to catch the falling blocks like sand which would in the end mean that more and more blocks would disappear from the original set up. So I just started to cancel any physics events in the regions.
I'll try to take a look at it, if there is something I can change to allow for normal operation, but at same time preserve the original state.
Is there a reason gravel and sand don't fall down, when you put them in a regen area? I want to use regenblock to replace some gravel in a dungeon where it falls down when a player walks over a certain point, but once I configure the area and the pistons pull the blocks under it away, it doesn't fall down ... :(