SteamWar/FightSystem
Archiviert
13
1
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-09 14:23:50 +02:00
Ursprung a62d9ab48a
Commit 0384062e60

Datei anzeigen

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