Revert changes that resets user death count.

This commit is contained in:
BONNe1704 2019-01-02 15:03:22 +02:00
parent c2778960b3
commit de2052acb4

View File

@ -11,7 +11,6 @@ import world.bentobox.level.Level;
import world.bentobox.level.calculators.CalcIslandLevel;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandCreatedEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandResettedEvent;
import world.bentobox.bentobox.api.events.team.TeamEvent.TeamJoinEvent;
import world.bentobox.bentobox.database.objects.Island;
/**
@ -42,24 +41,6 @@ public class NewIslandListener implements Listener {
cil.putIfAbsent(e.getIsland(), new CalcIslandLevel(addon, e.getIsland(), () -> zeroLevel(e.getIsland())));
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onTeamJoin(TeamJoinEvent event)
{
if (this.addon.getSettings().isTeamJoinDeathReset())
{
this.cil.putIfAbsent(event.getIsland(),
new CalcIslandLevel(this.addon,
event.getIsland(),
() -> zeroLevel(event.getIsland())));
this.addon.getPlayers().setDeaths(event.getIsland().getWorld(),
event.getOwner(),
0);
}
}
private void zeroLevel(Island island) {
if (cil.containsKey(island)) {
addon.setInitialIslandLevel(island, cil.get(island).getResult().getLevel());