me.riking.templateworlds.api
Interface ApiMain


public interface ApiMain


Method Summary
 org.bukkit.World createWorld(String name, org.bukkit.World template)
          Create a new templated world with the given name and template world
 org.bukkit.World createWorld(String name, org.bukkit.World template, Collection<org.bukkit.generator.BlockPopulator> extraPopulators)
          Create a templated world with the given name, template world, and extra BlockPopulators from your plugin.
 boolean isTemplatedWorld(org.bukkit.World world)
          Check whether the given World was created by this plugin.
 void onDisable(org.bukkit.plugin.Plugin templateWorlds)
          Please do not call this method.
 void onEnable(org.bukkit.plugin.Plugin templateWorlds)
          Please do not call this method.
 void resetArea(org.bukkit.World templated, int chunkMinX, int chunkMinZ, int chunkMaxX, int chunkMaxZ)
          Reset all chunks in the given area to the chunks in the template world.
 void resetArea(org.bukkit.World templated, org.bukkit.Location a, org.bukkit.Location b)
          Reset all chunks in the area bounded in X and Z by the two locations to the chunks in the template world.
 void resetAreaGradually(org.bukkit.World templated, int chunkMinX, int chunkMinZ, int chunkMaxX, int chunkMaxZ, Runnable callback)
          Reset all chunks in the given area to the chunks in the template world over time.
 void resetAreaGradually(org.bukkit.World templated, org.bukkit.Location a, org.bukkit.Location b, Runnable callback)
          Reset all chunks in the area bounded in X and Z by the two locations to the chunks in the template world over time.
 

Method Detail

onEnable

void onEnable(org.bukkit.plugin.Plugin templateWorlds)
Please do not call this method.


onDisable

void onDisable(org.bukkit.plugin.Plugin templateWorlds)
Please do not call this method.


createWorld

org.bukkit.World createWorld(String name,
                             org.bukkit.World template)
Create a new templated world with the given name and template world

Parameters:
name - name of the world folder for the templated world
template - the world to use as the template
Returns:
a World whose templated chunks must now be regenerated

createWorld

org.bukkit.World createWorld(String name,
                             org.bukkit.World template,
                             Collection<org.bukkit.generator.BlockPopulator> extraPopulators)
Create a templated world with the given name, template world, and extra BlockPopulators from your plugin. (This will typically create a different world each time, assuming the Populator uses the Random argument.)

Parameters:
name - name of the world folder for the templated world
template - the world to use as the template
Returns:
a WorldCreator ready to create a World

isTemplatedWorld

boolean isTemplatedWorld(org.bukkit.World world)
Check whether the given World was created by this plugin.

Parameters:
world - a world that may or may not be templated
Returns:
if the world was templated

resetAreaGradually

void resetAreaGradually(org.bukkit.World templated,
                        int chunkMinX,
                        int chunkMinZ,
                        int chunkMaxX,
                        int chunkMaxZ,
                        Runnable callback)
Reset all chunks in the given area to the chunks in the template world over time. The provided Runnable will be executed once the reset is complete.

Parameters:
templated - A templated world
chunkMinX - low chunk-coord X to regenerate
chunkMinZ - low chunk-coord Z to regenerate
chunkMaxX - high chunk-coord X to regenerate
chunkMaxZ - high chunk-coord Z to regenerate
callback - A Runnable to execute once the resetting is completed. It will be executed on the server main thread. May be null.
Throws:
IllegalArgumentException - if max < min
IllegalArgumentException - if the provided world is not a templated world

resetAreaGradually

void resetAreaGradually(org.bukkit.World templated,
                        org.bukkit.Location a,
                        org.bukkit.Location b,
                        Runnable callback)
Reset all chunks in the area bounded in X and Z by the two locations to the chunks in the template world over time. The provided Runnable will be executed once the reset is complete.

Parameters:
templated - A templated world
a - one corner of the bounding box
b - opposite corner of the bounding box
callback - A Runnable to execute once the resetting is completed. It will be executed on the server main thread. May be null.
Throws:
IllegalArgumentException - if the provided world is not a templated world

resetArea

void resetArea(org.bukkit.World templated,
               int chunkMinX,
               int chunkMinZ,
               int chunkMaxX,
               int chunkMaxZ)
Reset all chunks in the given area to the chunks in the template world.

Parameters:
templated - A templated world
chunkMinX - low chunk-coord X to regenerate
chunkMinZ - low chunk-coord Z to regenerate
chunkMaxX - high chunk-coord X to regenerate
chunkMaxZ - high chunk-coord Z to regenerate
Throws:
IllegalArgumentException - if max < min
IllegalArgumentException - if the provided world is not a templated world

resetArea

void resetArea(org.bukkit.World templated,
               org.bukkit.Location a,
               org.bukkit.Location b)
Reset all chunks in the area bounded in X and Z by the two locations to the chunks in the template world.

Parameters:
templated - A templated world
a - one corner of the bounding box
b - opposite corner of the bounding box
Throws:
IllegalArgumentException - if the provided world is not a templated world


Copyright © 2013. All rights reserved.