promotional bannermobile promotional banner

TemplateWorlds

Reverting worlds to an unchanging template

TemplateWorlds

This is a library plugin to create worlds in Bukkit that can be restored back to an unchanging template.

Source is available on GitHubGitHub.

This project uses semantic versioning for its "api" package.

Usage guide

Put this into your Maven pom.xml to include the API jar as a dependency:

<dependency>
	<groupId>com.github.riking.lib.templateworlds</groupId>
	<artifactId>templateworlds</artifactId>
	<version>2.0.0</version>
</dependency>

(Repository info coming soon!)

Simple usage

Here, we create a 'lobby' world which is a clone of 'lobby-template'. Note that the template world is not kept, while the created lobby world is.

ApiMain templateApi = getServer().getServicesManager().getRegistration(ApiMain.class).getProvider();
World templateLobby = getServer().createWorld(new WorldCreator("lobby-template"));
this.lobby = twApi.createWorld("lobby", templateLobby);

Let's say that while the players are waiting for the game to start, the lobby world gets a bit trashed. To revert it back, you want to first remove all players from that world - maybe the game starts, so there's nobody there anymore. Use the resetArea() method over the whole area that the lobby is in:

twApi.resetArea(this.lobby, -5, -5, 5, 5);

The TemplateWorlds Team

profile avatar
  • 5
    Projects
  • 8.3K
    Downloads

More from riking27altView all