Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
InventivetalentDev committed May 28, 2021
2 parents cb5f180 + ccc013f commit 9ad545c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@
import java.io.FileNotFoundException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.*;

public class Commands {

Expand Down Expand Up @@ -286,7 +283,7 @@ public void frameRemove(final List<String> completions, final Player sender, fin
public void frameList(final Player sender) {
sender.sendMessage(" ");

Set<AnimatedFrame> frames = plugin.frameManager.getFrames();
List<AnimatedFrame> frames = plugin.frameManager.getSortedFrames();
sender.sendMessage("§eFrames (" + frames.size() + "): ");
for (AnimatedFrame frame : frames) {
TextComponent component = new TextComponent(frame.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;

Expand Down Expand Up @@ -229,6 +226,11 @@ public Set<AnimatedFrame> getFrames() {
return new HashSet<>(frameMap.values());
}

@Synchronized
public List<AnimatedFrame> getSortedFrames() {
return new ArrayList<>(frameMap.values());
}

@Synchronized
public Set<AnimatedFrame> getFramesInWorld(String worldName) {
Set<AnimatedFrame> frames = new HashSet<>();
Expand Down

0 comments on commit 9ad545c

Please sign in to comment.