Skip to content

Commit

Permalink
Simplifying a few code writings
Browse files Browse the repository at this point in the history
  • Loading branch information
wellnesscookie committed Jan 17, 2020
1 parent 67bba40 commit a9dafe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ public void setup() {

@Override
public boolean canExecute(User user, String label, List<String> args) {
boolean is = false;

if(is = this.getIslands().getIslandAt(user.getLocation()).isPresent())
island = this.getIslands().getIslandAt(user.getLocation()).get();
return is;
island = this.getIslands().getIslandAt(user.getLocation()).orElse(null);
return island != null;
}

@Override
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/world/bentobox/chat/listeners/ChatListener.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package world.bentobox.chat.listeners;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.*;

import org.bukkit.Bukkit;
import org.bukkit.World;
Expand All @@ -29,7 +26,7 @@ public class ChatListener implements Listener {

private final Chat addon;
private final Set<UUID> teamChatUsers;
private final HashMap<Island, Set<Player>> islands;
private final Map<Island, Set<Player>> islands;
// List of which users are spying or not on team and island chat
private final Set<UUID> spies;
private final Set<UUID> islandSpies;
Expand Down

0 comments on commit a9dafe0

Please sign in to comment.