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.
Please make a tutorial i don't know how select zones, it can be useful if you can make selections with worldedit wand.
@RafaelPosch
it's there already
i have a suggestion.can you add a ability that i can add costume message with configurable time to a region,so before it regenerate ,it shows up this message like:
"The mine will regenarete in 5 minutes,please leave the area or you will die " :D
@IronPython
well so far it seams like making it go over 24 hours is working but i wont know for sure until 3 days from now, also you changed something now redstone no longer works i need this fixed id rather be forced to be under 24 hours then have all the doors in my world stop working. is there any way you can fix this soon? if not ill have to use version 3.6 until it is fixed sadly
@Raidendex
yeah no worry's ill try it out when it lets me download it and ill let you know. i do understand why the gravel, water and lava act that way i did a few years of game art so i guessed as much from the start but just wanted to make sure i was guessing right and it was not a bug on my side i do hope you add it in so that water and lava can act normally inside the zones but until then i guess my users will have a slightly less dangers mining time. another thing is lighting dose not update if i place a torch and its removed the light is still there.
@IronPython
Most of the issues you are having have to do with me trying to preserve the region as much as possible, thus a lot of physics events are cancelled. Otherwise it's hard for me to make sure that in the end I will get same region as it was originally. There are still quite a few different scenarios where you can mess up the region, but I'm trying to slowly fix them as time allows.
As far as 24h issue, I think I fixed it, was just a minor bug... was comparing respawn time minus system time to 24 hours, not the other way around lol. That is mainly to make sure that no block gets "stuck" in the queue for too long after it's normal timer, whatever it may be, is up.
Try it out and let me know how it works, sucks you have to wait for over a day ><
New version is 3.7 when it pops up in the downloads.
I am having only two problems with the plugin right now and it might be because i didn't set something up but what i did is make a world a mining world i set it up so that it will regen using type 1 so its random to the values i set up so that you can't mine the same diamond vane over and over.
Problem 1, when mine under gravel, water or lava they do not fall making it so there not an obstetrical i don't mind gravel acting like stone and staying in place but i do need lava and water to react when someone mines around them as they are no longer a safety concern another thing is if you place something 1 the water like stone and the regen time kicks in removing the stone the water now has a hole were the stone is once again because water dose not update inside a region.
Problem 2, i can't set up the time longer then 24 hours. i set it up to 86,400 which is 1 day, and it works just like it should i place a stone block 24 hours later it is removed and it keeps the time even after restarts or server crashes just as it should. but if i set the time any longer then that (we were wanting to set it up to be somewhere between 2 and 3 days) it will not work when i set it to even 90,000 once i place a stone block or destroy something it regens it immediately is there a reason for that? i saw previously a post you made showing someone how to set it up for a week but seeing as i can't even go over 24 hours in time i don't know what i might be doing wrong.
@DarkshadeDX
i have a world that has 3 regions for iron, gold and diamond layer i use it for my mining work i have it were worldgard stops you from leaving the border and so i know the XYZ of the edges and i just edited the config file to have the right levels for the left and right points
@Raidendex
D= I unfortunately lack the ability to code, would you be any chance as to be so kind as to do it for me? I understand it's a lot to ask, but it'd really help me out right now.
If not, I completely understand
DarkshadeDX
@DarkshadeDX
It's possible, and if you can code a bit you can do that yourself, source files are included in the jar, but I'm not sure how well will that perform in the long run, mainly because the regen queue is really not optimized for a lot of entries.. something I need to modify :)
I have to say, I think this plugin is fantastic. But I'm having a real issue with it. Is there any way you can, or could impliment a way to select an entire world? >w< Thanks, Darkshade
@iKrzysiek
No, but if you place regenblock's regions around those two, there should be no problems.
Can it regen destroyed blocks in world but dont regen it when they are in chunk claimed by Factions or WorldGuard?
@TCGM
/rb create regionName 604800
/rb sync regionName 1
That should give you a week in seconds and all blocks to repop at once whenever they do.
Depending on the size of the region this may be a bad idea, as the size of block queue will grow and as of right now they way it's processed it will lag the server with bigger sizes.
How would I use this plugin to have an area do nothing until a week's time passes, then revert to it's original state?
@Gaurav1234
everything is in seconds
is the 're-spawn-time' in minutes or seconds?
New version is uploaded (3.6) Should take care of few issues like sand gravel falling and not re-spawning, leaves decaying etc. Most of those are just cancelled so there may be some weird behavior, but in the end it will preserve the region to it's original state.
There are still several issue block combinations that will break re-spawn cycles, will try to get to them eventually. Few that I can name - placing sand/gravel up in the air, will allow it to drop and thus leave it in the region; doors/beds will not re-pop correctly; torches if the block they are attached to is destroyed will not be registered, etc.
@deleted_6837836
not atm. I'm poking around atm to do different things like that, but don't have anything done yet.
I have a question, will this bring back chest/dispenser's contents when it gets regenerated?