Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Destroys the instance, and removes it from the config "instances.yml"
- */
- public void destroy(){
- instanceFinishEvent event = new instanceFinishEvent(getHomeLocation().getWorld().getChunkAt(chunkX, chunkZ));
- Bukkit.getServer().getPluginManager().callEvent(event);
- IDinstance.remove(getID());
- instanceLocation.remove(world + chunkX + chunkZ);
- YamlConfiguration instances = YamlConfiguration.loadConfiguration(new File(InstancesBase.plugin.getDataFolder(),"instances.yml"));
- List<String> list = instances.getStringList(type.toString());
- if (list != null){
- if (list.contains(world + ":" + chunkX + ":" + chunkZ)){
- list.remove(world + ":" + chunkX + ":" + chunkZ);
- instances.set(type.toString(), list);
- try {
- instances.save(new File(InstancesBase.plugin.getDataFolder(),"instances.yml"));
- } catch (IOException e) {
- System.out.print("Unable to save the 'instances.yml'. Is the disk full?");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement