Skip to content

Commit

Permalink
fix #178 (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei1058 authored Jan 10, 2022
1 parent 38285c8 commit 8962f90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2372,10 +2372,11 @@ public void destroyData() {
for (IGenerator og : oreGenerators) {
og.destroyData();
}
isOnABase.entrySet().removeIf(entry -> entry.getValue().getArena().equals(this));
for (ITeam bwt : teams) {
bwt.destroyData();
}
playerLocation.entrySet().removeIf(e -> e.getValue().getWorld().getName().equalsIgnoreCase(worldName));
playerLocation.entrySet().removeIf(e -> Objects.requireNonNull(e.getValue().getWorld()).getName().equalsIgnoreCase(worldName));
teams = null;
placed = null;
nextEvents = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.andrei1058.bedwars.api.arena.team.ITeam;
import com.andrei1058.bedwars.api.events.player.PlayerBaseEnterEvent;
import com.andrei1058.bedwars.api.events.player.PlayerBaseLeaveEvent;
import com.andrei1058.bedwars.api.events.player.PlayerLeaveArenaEvent;
import com.andrei1058.bedwars.api.events.upgrades.UpgradeBuyEvent;
import com.andrei1058.bedwars.api.upgrades.EnemyBaseEnterTrap;
import com.andrei1058.bedwars.arena.Arena;
Expand Down Expand Up @@ -191,4 +192,9 @@ public void onBaseLeave(PlayerBaseLeaveEvent e) {
}
}*/
}

@EventHandler
public void onArenaLeave(PlayerLeaveArenaEvent event){
isOnABase.remove(event.getPlayer());
}
}

0 comments on commit 8962f90

Please sign in to comment.