Skip to content

Commit

Permalink
Follow DMK suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
CitralFlo committed Oct 12, 2023
1 parent b04ec7a commit a94e520
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/eternalcode/combat/fight/FightManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.UUID;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

public class FightManager {

private final Map<UUID, FightTag> fights = new HashMap<>();
private final ConcurrentHashMap<UUID, FightTag> fights = new ConcurrentHashMap<>();
private final EventCaller eventCaller;

public FightManager(EventCaller eventCaller) {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/eternalcode/combat/fight/FightTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import panda.utilities.text.Formatter;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class FightTask implements Runnable {
Expand All @@ -36,8 +34,7 @@ public FightTask(Server server, PluginConfig config, FightManager fightManager,


public void run() {
List<FightTag> fights = new ArrayList<>(this.fightManager.getFights());
for (FightTag fightTag : fights) {
for (FightTag fightTag : this.fightManager.getFights()) {
Player player = this.server.getPlayer(fightTag.getTaggedPlayer());

if (player == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public void onTag(FightTagEvent event) {

Player player = this.server.getPlayer(event.getPlayer());

if (player == null) {
return;
}
assert player != null;

this.effectSettings.customEffects.forEach((key, value) ->
this.effectService.applyCustomEffect(player, key, value));
Expand Down Expand Up @@ -65,9 +63,7 @@ public void onUntag(FightUntagEvent event) {

Player player = this.server.getPlayer(event.getPlayer());

if (player == null) {
return;
}
assert player != null;

this.effectSettings.customEffects.forEach((key, value) -> this.effectService.removeCustomEffect(player, key, value));

Expand Down

0 comments on commit a94e520

Please sign in to comment.