SteamWar/FightSystem
Archiviert
13
1

Reset entities #255

Manuell gemergt
Lixfel hat 1 Commits von reset_entities nach master 2021-04-09 16:06:38 +02:00 zusammengeführt
Nur Änderungen aus Commit 0384062e60 werden angezeigt - Alle Commits anzeigen

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));