Replace API
ReplaceAPI
By ZockerAxel
Github
Description
This API allows you to easily replace blocks with other blocks and specify the Delay.
Information
ReplaceAPI.ReplaceBlock(Plugin pl, final Block b, final Material BlockMaterial, int DelayInSeconds)
ReplaceAPI.ReplaceBlock replaces a selected Block (Block b) with a new selected Block (Material BlockMaterial) after selected Seconds(DelayInSeconds)
ReplaceAPI.ReplaceEntity(Plugin pl, final Entity e, final int Count, int SecondsTillRemove ,final Block position, final EntityType newEntity, int SecondsTillNewSpawn)
ReplaceAPI.ReplaceEntity kills a selected Entity (Entity e) after selected Seconds (int SecondsTillRemove) at a selected position (Block position) and spawns in another selected entity(EntityType newEntity) after selected Seconds (int SecondsTillNewSpawn)
Warning: The SecondsTillRemove should never be higher than SecondsTillNewSpawn!!
ReplaceAPI.ReplaceSelection(Plugin pl, final World w, final HashMap<Block, Material> coords_replacement, int DelayInSeconds)
ReplaceAPI.ReplaceSelection is more or less the same as ReplaceAPI.ReplaceBlock, execpt that you can save multiple blocks in one HashMap for example to regenerate 500 blocks at once without having to run 500 ReplaceAPI.ReplaceBlock's
Example Uses
1. If you want that a block is replaced 5/10/12/50/etc seconds after anything
2. If you want to replace an entity with another entity
3. If you want to Replace many many blocks with one method
What is the point of this?
Just use bukkits schedular
you just have to save every block in a hashmap, since the new version hashmaps are included
you can do how many seconds you want, its all included, see Information
Can I use it to make an area get reset every 12h? (Worldguard region?) *1. If you want that a block is replaced 5 seconds after it has been destroyed*