TemplateWorlds
TemplateWorlds
This is a library plugin to create worlds in Bukkit that can be restored back to an unchanging template.
Source is available on GitHub.
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);
Very good idea! I think it can be used to create raids into several dungeons.
This is amazing ! This saves me a lot of trouble with some projects I was going to create , thank you for creating this :) This helps with things like, adventure maps , custom made games , just beholds a lot of work that I won't need to do any more.