Reset entities
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
a62d9ab48a
Commit
0384062e60
@ -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));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren