Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
EpiCanard committed Dec 20, 2024
1 parent db9952e commit 92a56ff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;


public class CommandHandler implements CommandExecutor, TabCompleter {

Expand Down Expand Up @@ -159,7 +157,9 @@ private List<String> shopLocationTabComplete(CommandSender sender, String[] args
}
if (args.length == 2) {
return GlobalMarketChest.plugin.shopManager.getShops().stream()
.filter(shop -> shop.getExists() && shop.getGroup().equals(args[0]) && Integer.toString(shop.getId()).startsWith(args[1]) && shop.getTpLocation().isPresent())
.filter(shop -> {
return shop.getExists() && shop.getGroup().equals(args[0]) && Integer.toString(shop.getId()).startsWith(args[1]) && shop.getTpLocation().isPresent();
})
.map(shop -> WorldUtils.getStringFromLocation(shop.getTpLocation().get()))
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
import fr.epicanard.globalmarketchest.utils.LangUtils;
import fr.epicanard.globalmarketchest.utils.PlayerUtils;
import fr.epicanard.globalmarketchest.utils.WorldUtils;

import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;


import java.util.List;
import java.util.stream.Collectors;

import static fr.epicanard.globalmarketchest.utils.Option.forAll;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Boolean accept(CommandNode node, String command, CommandSender sender, St
&& exists(shop.getTpLocation(), loc -> args.length < 2 || WorldUtils.compareLocations(loc, argLoc)))
.collect(Collectors.toList());
if (shops.size() == 0) {
PlayerUtils.sendMessage(sender, String.format("%s%s %s", LangUtils.get("ErrorMessages.UnknownShop"), args[0], (args.length > 1) ? args[1]: ""));
PlayerUtils.sendMessage(sender, String.format("%s%s %s", LangUtils.get("ErrorMessages.UnknownShop"), args[0], (args.length > 1) ? args[1] : ""));
return false;
}
if (shops.size() > 1 && args.length < 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ private Boolean setPreparedOneField(PreparedStatement prepared, Object value, At
* @param builder BaseBuilder that contains the query
* @param onSuccess Callback called with the query response
*/
public <T extends BaseBuilder<T>> Boolean execute(final BaseBuilder<T> builder, final SqlConsumer<ResultSet> onSuccess, final Consumer<SQLException> onError) {
public <T extends BaseBuilder<T>> Boolean execute(
final BaseBuilder<T> builder,
final SqlConsumer<ResultSet> onSuccess,
final Consumer<SQLException> onError
) {
Connection co = GlobalMarketChest.plugin.getSqlConnector().getConnection();
Boolean ret = false;
AtomicReference<ResultSet> res = new AtomicReference<>();
Expand Down

0 comments on commit 92a56ff

Please sign in to comment.