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:
Commit
1b60fee3b1
@ -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