SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'Reset entities' (#255) from reset_entities into master

Reviewed-on: #255
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-09 16:06:36 +02:00
Commit 1b60fee3b1

Datei anzeigen

@ -27,6 +27,8 @@ import de.steamwar.fightsystem.states.StateDependent;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
public class FightWorld extends StateDependent {
@ -62,6 +64,12 @@ public class FightWorld extends StateDependent {
@Override
public void disable() {
for(Entity entity : world.getEntities()){
if(entity.getType() != EntityType.PLAYER){
entity.remove();
}
}
World backup = new WorldCreator(world.getName() + "/backup").createWorld();
assert backup != null;
Config.ArenaRegion.forEachChunk((x, z) -> resetChunk(backup, x, z));